diff --git a/README.md b/README.md index 314cf22..d8fd4c6 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,5 @@ Common options are: Testing ======= -Run the `check-llvm-dialects` target to run a suite of automated tests. +Run the `check-llvm-dialects` and `check-llvm-dialects-units` targets to run a +suite of automated tests. diff --git a/lib/TableGen/Operations.cpp b/lib/TableGen/Operations.cpp index 22244b8..c208f0d 100644 --- a/lib/TableGen/Operations.cpp +++ b/lib/TableGen/Operations.cpp @@ -553,7 +553,7 @@ void BuilderMethod::emitDeclaration(raw_ostream &out, FmtContext &fmt) const { for (const auto &builderArg : m_arguments) { out << ", " << builderArg.cppType << " " << builderArg.name; } - out << ", const llvm::Twine &instName = \"\");\n"; + out << ", const llvm::Twine &inst__name = \"\");\n"; } void BuilderMethod::emitDefinition(raw_ostream &out, FmtContext &fmt, @@ -572,7 +572,7 @@ void BuilderMethod::emitDefinition(raw_ostream &out, FmtContext &fmt, for (const auto &builderArg : m_arguments) out << tgfmt(", $0 $1", &fmt, builderArg.cppType, builderArg.name); - out << tgfmt(R"(, const llvm::Twine &instName) { + out << tgfmt(R"(, const llvm::Twine &inst__name) { ::llvm::LLVMContext& $_context = $_builder.getContext(); (void)$_context; ::llvm::Module& $_module = *$_builder.GetInsertBlock()->getModule(); @@ -711,11 +711,11 @@ void BuilderMethod::emitDefinition(raw_ostream &out, FmtContext &fmt, out << tgfmt(R"( }; $varArgInitializer - return ::llvm::cast<$_op>($_builder.CreateCall($fn, $args, instName)); + return ::llvm::cast<$_op>($_builder.CreateCall($fn, $args, inst__name)); )", &fmt); } else { - out << tgfmt("return ::llvm::cast<$_op>($_builder.CreateCall($fn, std::nullopt, instName));\n", + out << tgfmt("return ::llvm::cast<$_op>($_builder.CreateCall($fn, std::nullopt, inst__name));\n", &fmt); } diff --git a/test/example/generated/ExampleDialect.cpp.inc b/test/example/generated/ExampleDialect.cpp.inc index de6b72d..a395562 100644 --- a/test/example/generated/ExampleDialect.cpp.inc +++ b/test/example/generated/ExampleDialect.cpp.inc @@ -297,7 +297,7 @@ return true; const ::llvm::StringLiteral Add32Op::s_name{"xd.add32"}; - Add32Op* Add32Op::create(llvm_dialects::Builder& b, ::llvm::Value * lhs, ::llvm::Value * rhs, uint32_t extra, const llvm::Twine &instName) { + Add32Op* Add32Op::create(llvm_dialects::Builder& b, ::llvm::Value * lhs, ::llvm::Value * rhs, uint32_t extra, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -334,7 +334,7 @@ rhs, ::llvm::ConstantInt::get(::llvm::IntegerType::get(context, 32), extra) }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -419,7 +419,7 @@ uint32_t const extra = getExtra(); const ::llvm::StringLiteral CombineOp::s_name{"xd.combine"}; - CombineOp* CombineOp::create(llvm_dialects::Builder& b, ::llvm::Value * lhs, ::llvm::Value * rhs, const llvm::Twine &instName) { + CombineOp* CombineOp::create(llvm_dialects::Builder& b, ::llvm::Value * lhs, ::llvm::Value * rhs, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -453,7 +453,7 @@ lhs, rhs }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -514,7 +514,7 @@ rhs const ::llvm::StringLiteral ExtractElementOp::s_name{"xd.extractelement"}; - ExtractElementOp* ExtractElementOp::create(llvm_dialects::Builder& b, ::llvm::Value * vector, ::llvm::Value * index, const llvm::Twine &instName) { + ExtractElementOp* ExtractElementOp::create(llvm_dialects::Builder& b, ::llvm::Value * vector, ::llvm::Value * index, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -548,7 +548,7 @@ vector, index }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -618,7 +618,7 @@ index const ::llvm::StringLiteral FromFixedVectorOp::s_name{"xd.fromfixedvector"}; - FromFixedVectorOp* FromFixedVectorOp::create(llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &instName) { + FromFixedVectorOp* FromFixedVectorOp::create(llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -651,7 +651,7 @@ index source }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -788,7 +788,7 @@ source const ::llvm::StringLiteral HandleGetOp::s_name{"xd.handle.get"}; - HandleGetOp* HandleGetOp::create(llvm_dialects::Builder& b, const llvm::Twine &instName) { + HandleGetOp* HandleGetOp::create(llvm_dialects::Builder& b, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -815,7 +815,7 @@ source assert(fn.getFunctionType() == fnType); assert(::llvm::cast<::llvm::Function>(fn.getCallee())->getFunctionType() == fn.getFunctionType()); - return ::llvm::cast(b.CreateCall(fn, std::nullopt, instName)); + return ::llvm::cast(b.CreateCall(fn, std::nullopt, inst__name)); } @@ -850,7 +850,7 @@ source const ::llvm::StringLiteral IExtOp::s_name{"xd.iext"}; - IExtOp* IExtOp::create(llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &instName) { + IExtOp* IExtOp::create(llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -883,7 +883,7 @@ source source }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -948,7 +948,7 @@ source const ::llvm::StringLiteral ITruncOp::s_name{"xd.itrunc"}; - ITruncOp* ITruncOp::create(llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &instName) { + ITruncOp* ITruncOp::create(llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -981,7 +981,7 @@ source source }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -1046,7 +1046,7 @@ source const ::llvm::StringLiteral InsertElementOp::s_name{"xd.insertelement"}; - InsertElementOp* InsertElementOp::create(llvm_dialects::Builder& b, ::llvm::Value * vector, ::llvm::Value * value, ::llvm::Value * index, const llvm::Twine &instName) { + InsertElementOp* InsertElementOp::create(llvm_dialects::Builder& b, ::llvm::Value * vector, ::llvm::Value * value, ::llvm::Value * index, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1081,7 +1081,7 @@ value, index }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -1168,7 +1168,7 @@ index const ::llvm::StringLiteral ReadOp::s_name{"xd.read"}; - ReadOp* ReadOp::create(llvm_dialects::Builder& b, ::llvm::Type* dataType, const llvm::Twine &instName) { + ReadOp* ReadOp::create(llvm_dialects::Builder& b, ::llvm::Type* dataType, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1198,7 +1198,7 @@ index assert(fn.getFunctionType() == fnType); assert(::llvm::cast<::llvm::Function>(fn.getCallee())->getFunctionType() == fn.getFunctionType()); - return ::llvm::cast(b.CreateCall(fn, std::nullopt, instName)); + return ::llvm::cast(b.CreateCall(fn, std::nullopt, inst__name)); } @@ -1225,7 +1225,7 @@ index const ::llvm::StringLiteral SetReadOp::s_name{"xd.set.read"}; - SetReadOp* SetReadOp::create(llvm_dialects::Builder& b, ::llvm::Type* dataType, const llvm::Twine &instName) { + SetReadOp* SetReadOp::create(llvm_dialects::Builder& b, ::llvm::Type* dataType, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1255,7 +1255,7 @@ index assert(fn.getFunctionType() == fnType); assert(::llvm::cast<::llvm::Function>(fn.getCallee())->getFunctionType() == fn.getFunctionType()); - return ::llvm::cast(b.CreateCall(fn, std::nullopt, instName)); + return ::llvm::cast(b.CreateCall(fn, std::nullopt, inst__name)); } @@ -1282,7 +1282,7 @@ index const ::llvm::StringLiteral SetWriteOp::s_name{"xd.set.write"}; - SetWriteOp* SetWriteOp::create(llvm_dialects::Builder& b, ::llvm::Value * data, const llvm::Twine &instName) { + SetWriteOp* SetWriteOp::create(llvm_dialects::Builder& b, ::llvm::Value * data, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1312,7 +1312,7 @@ index data }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -1345,7 +1345,7 @@ data const ::llvm::StringLiteral SizeOfOp::s_name{"xd.sizeof"}; - SizeOfOp* SizeOfOp::create(llvm_dialects::Builder& b, ::llvm::Type * sizeofType, const llvm::Twine &instName) { + SizeOfOp* SizeOfOp::create(llvm_dialects::Builder& b, ::llvm::Type * sizeofType, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1375,7 +1375,7 @@ data ::llvm::PoisonValue::get(sizeofType) }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -1419,7 +1419,7 @@ data const ::llvm::StringLiteral StreamAddOp::s_name{"xd.stream.add"}; - StreamAddOp* StreamAddOp::create(llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &instName) { + StreamAddOp* StreamAddOp::create(llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1454,7 +1454,7 @@ count, initial }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -1511,7 +1511,7 @@ initial const ::llvm::StringLiteral StreamMaxOp::s_name{"xd.stream.max"}; - StreamMaxOp* StreamMaxOp::create(llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &instName) { + StreamMaxOp* StreamMaxOp::create(llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1546,7 +1546,7 @@ count, initial }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -1603,7 +1603,7 @@ initial const ::llvm::StringLiteral StreamMinOp::s_name{"xd.stream.min"}; - StreamMinOp* StreamMinOp::create(llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &instName) { + StreamMinOp* StreamMinOp::create(llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1638,7 +1638,7 @@ count, initial }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -1695,7 +1695,7 @@ initial const ::llvm::StringLiteral WriteOp::s_name{"xd.write"}; - WriteOp* WriteOp::create(llvm_dialects::Builder& b, ::llvm::Value * data, const llvm::Twine &instName) { + WriteOp* WriteOp::create(llvm_dialects::Builder& b, ::llvm::Value * data, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1725,7 +1725,7 @@ initial data }; - return ::llvm::cast(b.CreateCall(fn, args, instName)); + return ::llvm::cast(b.CreateCall(fn, args, inst__name)); } @@ -1758,7 +1758,7 @@ data const ::llvm::StringLiteral WriteVarArgOp::s_name{"xd.write.vararg"}; - WriteVarArgOp* WriteVarArgOp::create(llvm_dialects::Builder& b, ::llvm::Value * data, ::llvm::ArrayRef<::llvm::Value *> args, const llvm::Twine &instName) { + WriteVarArgOp* WriteVarArgOp::create(llvm_dialects::Builder& b, ::llvm::Value * data, ::llvm::ArrayRef<::llvm::Value *> args, const llvm::Twine &inst__name) { ::llvm::LLVMContext& context = b.getContext(); (void)context; ::llvm::Module& module = *b.GetInsertBlock()->getModule(); @@ -1790,7 +1790,7 @@ data arguments.append(args.begin(), args.end()); - return ::llvm::cast(b.CreateCall(fn, arguments, instName)); + return ::llvm::cast(b.CreateCall(fn, arguments, inst__name)); } diff --git a/test/example/generated/ExampleDialect.h.inc b/test/example/generated/ExampleDialect.h.inc index 8e875c6..9697ef8 100644 --- a/test/example/generated/ExampleDialect.h.inc +++ b/test/example/generated/ExampleDialect.h.inc @@ -115,7 +115,7 @@ uint32_t getNumElements() const; return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static Add32Op* create(::llvm_dialects::Builder& b, ::llvm::Value * lhs, ::llvm::Value * rhs, uint32_t extra, const llvm::Twine &instName = ""); + static Add32Op* create(::llvm_dialects::Builder& b, ::llvm::Value * lhs, ::llvm::Value * rhs, uint32_t extra, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -142,7 +142,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static CombineOp* create(::llvm_dialects::Builder& b, ::llvm::Value * lhs, ::llvm::Value * rhs, const llvm::Twine &instName = ""); + static CombineOp* create(::llvm_dialects::Builder& b, ::llvm::Value * lhs, ::llvm::Value * rhs, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -167,7 +167,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static ExtractElementOp* create(::llvm_dialects::Builder& b, ::llvm::Value * vector, ::llvm::Value * index, const llvm::Twine &instName = ""); + static ExtractElementOp* create(::llvm_dialects::Builder& b, ::llvm::Value * vector, ::llvm::Value * index, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -192,7 +192,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static FromFixedVectorOp* create(::llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &instName = ""); + static FromFixedVectorOp* create(::llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -215,7 +215,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static HandleGetOp* create(::llvm_dialects::Builder& b, const llvm::Twine &instName = ""); + static HandleGetOp* create(::llvm_dialects::Builder& b, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -236,7 +236,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static IExtOp* create(::llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &instName = ""); + static IExtOp* create(::llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -259,7 +259,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static ITruncOp* create(::llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &instName = ""); + static ITruncOp* create(::llvm_dialects::Builder& b, ::llvm::Type* resultType, ::llvm::Value * source, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -282,7 +282,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static InsertElementOp* create(::llvm_dialects::Builder& b, ::llvm::Value * vector, ::llvm::Value * value, ::llvm::Value * index, const llvm::Twine &instName = ""); + static InsertElementOp* create(::llvm_dialects::Builder& b, ::llvm::Value * vector, ::llvm::Value * value, ::llvm::Value * index, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -309,7 +309,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static ReadOp* create(::llvm_dialects::Builder& b, ::llvm::Type* dataType, const llvm::Twine &instName = ""); + static ReadOp* create(::llvm_dialects::Builder& b, ::llvm::Type* dataType, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -330,7 +330,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static SetReadOp* create(::llvm_dialects::Builder& b, ::llvm::Type* dataType, const llvm::Twine &instName = ""); + static SetReadOp* create(::llvm_dialects::Builder& b, ::llvm::Type* dataType, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -351,7 +351,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static SetWriteOp* create(::llvm_dialects::Builder& b, ::llvm::Value * data, const llvm::Twine &instName = ""); + static SetWriteOp* create(::llvm_dialects::Builder& b, ::llvm::Value * data, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -373,7 +373,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static SizeOfOp* create(::llvm_dialects::Builder& b, ::llvm::Type * sizeofType, const llvm::Twine &instName = ""); + static SizeOfOp* create(::llvm_dialects::Builder& b, ::llvm::Type * sizeofType, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -396,7 +396,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static StreamAddOp* create(::llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &instName = ""); + static StreamAddOp* create(::llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -417,7 +417,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static StreamMaxOp* create(::llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &instName = ""); + static StreamMaxOp* create(::llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -438,7 +438,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static StreamMinOp* create(::llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &instName = ""); + static StreamMinOp* create(::llvm_dialects::Builder& b, ::llvm::Value * ptr, ::llvm::Value * count, ::llvm::Value * initial, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -459,7 +459,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static WriteOp* create(::llvm_dialects::Builder& b, ::llvm::Value * data, const llvm::Twine &instName = ""); + static WriteOp* create(::llvm_dialects::Builder& b, ::llvm::Value * data, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); @@ -481,7 +481,7 @@ bool verifier(::llvm::raw_ostream &errs); return ::llvm::isa<::llvm::CallInst>(v) && classof(::llvm::cast<::llvm::CallInst>(v)); } - static WriteVarArgOp* create(::llvm_dialects::Builder& b, ::llvm::Value * data, ::llvm::ArrayRef<::llvm::Value *> args, const llvm::Twine &instName = ""); + static WriteVarArgOp* create(::llvm_dialects::Builder& b, ::llvm::Value * data, ::llvm::ArrayRef<::llvm::Value *> args, const llvm::Twine &inst__name = ""); bool verifier(::llvm::raw_ostream &errs); diff --git a/test/unit/dialect/TestDialect.td b/test/unit/dialect/TestDialect.td index 6add4ae..b22c36e 100644 --- a/test/unit/dialect/TestDialect.td +++ b/test/unit/dialect/TestDialect.td @@ -65,3 +65,27 @@ def DialectOp4 : TestOp<"dialect.op.4", []> { let summary = "Test operation 4"; } + +def InstNameConflictTestOp : Op { + let results = (outs); + let arguments = (ins value:$instName, value:$inst__name); + + let summary = "a test case for instName parameter escaping"; + let description = [{ + The builder accepts an additional argument to set the name of the created + value like IRBuilder methods. This op tries to produce a conflict + }]; +} + +def InstNameConflictWithExplRetTestOp : Op { + let results = (outs); + let arguments = (ins value:$instName, value:$inst__name); + + let defaultBuilderHasExplicitResultType = true; + + let summary = "same with explicit return"; + let description = [{ + The builder accepts an additional argument to set the name of the created + value like IRBuilder methods. This op tries to produce a conflict + }]; +}