[mlir] Fully specify removeAttr return type

This was added without full specification like other generated methods.
This then leads to other downstream dialects failing to compile the
generated code when they are not in the mlir namespace.

Differential Revision: https://reviews.llvm.org/D94132
This commit is contained in:
Tres Popp 2021-01-06 00:39:04 +01:00
parent b12e473531
commit cbda2cba4f
3 changed files with 5 additions and 5 deletions

View File

@ -80,7 +80,7 @@ def AOp : NS_Op<"a_op", []> {
// Test remove methods
// ---
// DEF: Attribute AOp::removeCAttrAttr() {
// DEF: ::mlir::Attribute AOp::removeCAttrAttr() {
// DEF-NEXT: return (*this)->removeAttr("cAttr");
// Test build methods
@ -271,7 +271,7 @@ def UnitAttrOp : NS_Op<"unit_attr_op", []> {
// DEF: bool UnitAttrOp::attr() {
// DEF: return {{.*}} != nullptr
// DEF: Attribute UnitAttrOp::removeAttrAttr() {
// DEF: ::mlir::Attribute UnitAttrOp::removeAttrAttr() {
// DEF-NEXT: (*this)->removeAttr("attr");
// DEF: build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, /*optional*/::mlir::UnitAttr attr)
@ -288,7 +288,7 @@ def SomeTypedArrayAttr : TypedArrayAttrBase<SomeAttr, "SomeAttr array">;
def Test_Dialect_2 : Dialect {
let name = "dialect_2";
}
def MyStruct : StructAttr<"MyStruct", Test_Dialect_2,
def MyStruct : StructAttr<"MyStruct", Test_Dialect_2,
[StructFieldAttr<"potatoes", I64ElementsAttr>]> {
let description = "A structure describing a number of potatoes.";
}

View File

@ -81,7 +81,7 @@ def NS_AOp : NS_Op<"a_op", [IsolatedFromAbove, IsolatedFromAbove]> {
// CHECK: uint32_t attr1();
// CHECK: ::mlir::FloatAttr attr2Attr()
// CHECK: ::llvm::Optional< ::llvm::APFloat > attr2();
// CHECK: Attribute removeAttr2Attr();
// CHECK: ::mlir::Attribute removeAttr2Attr();
// CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value val);
// CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, int integer = 0);
// CHECK: static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type r, ::mlir::TypeRange s, ::mlir::Value a, ::mlir::ValueRange b, ::mlir::IntegerAttr attr1, /*optional*/::mlir::FloatAttr attr2, unsigned someRegionsCount)

View File

@ -788,7 +788,7 @@ void OpEmitter::genOptionalAttrRemovers() {
auto upperInitial = name.take_front().upper();
auto suffix = name.drop_front();
auto *method = opClass.addMethodAndPrune(
"Attribute", ("remove" + upperInitial + suffix + "Attr").str());
"::mlir::Attribute", ("remove" + upperInitial + suffix + "Attr").str());
if (!method)
return;
auto &body = method->body();