diff --git a/mlir/include/mlir/IR/OpAsmInterface.td b/mlir/include/mlir/IR/OpAsmInterface.td --- a/mlir/include/mlir/IR/OpAsmInterface.td +++ b/mlir/include/mlir/IR/OpAsmInterface.td @@ -47,7 +47,7 @@ %first_result, %middle_results:2, %0 = "my.op" ... ``` }], - "void", "getAsmResultNames", (ins "OpAsmSetValueNameFn":$setNameFn) + "void", "getAsmResultNames", (ins "::mlir::OpAsmSetValueNameFn":$setNameFn) >, ]; } diff --git a/mlir/include/mlir/IR/SymbolInterfaces.td b/mlir/include/mlir/IR/SymbolInterfaces.td --- a/mlir/include/mlir/IR/SymbolInterfaces.td +++ b/mlir/include/mlir/IR/SymbolInterfaces.td @@ -206,7 +206,7 @@ let methods = [ InterfaceMethod<"Verify the symbol uses held by this operation.", - "LogicalResult", "verifySymbolUses", + "::mlir::LogicalResult", "verifySymbolUses", (ins "::mlir::SymbolTableCollection &":$symbolTable) >, ]; diff --git a/mlir/include/mlir/Interfaces/CopyOpInterface.td b/mlir/include/mlir/Interfaces/CopyOpInterface.td --- a/mlir/include/mlir/Interfaces/CopyOpInterface.td +++ b/mlir/include/mlir/Interfaces/CopyOpInterface.td @@ -24,12 +24,12 @@ let methods = [ InterfaceMethod< /*desc=*/"Returns the source value for this copy operation", - /*retTy=*/"Value", + /*retTy=*/"::mlir::Value", /*methodName=*/"getSource" >, InterfaceMethod< /*desc=*/"Returns the target value for this copy operation", - /*retTy=*/"Value", + /*retTy=*/"::mlir::Value", /*methodName=*/"getTarget" > ]; diff --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td --- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td +++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td @@ -90,14 +90,14 @@ may be returned by this function while returning success. E.g., partial population of components is not error condition. }], - /*retTy=*/"LogicalResult", + /*retTy=*/"::mlir::LogicalResult", /*methodName=*/"inferReturnTypeComponents", - /*args=*/(ins "MLIRContext*":$context, - "Optional":$location, - "ValueRange":$operands, - "DictionaryAttr":$attributes, - "RegionRange":$regions, - "SmallVectorImpl&": + /*args=*/(ins "::mlir::MLIRContext*":$context, + "::mlir::Optional<::mlir::Location>":$location, + "::mlir::ValueRange":$operands, + "::mlir::DictionaryAttr":$attributes, + "::mlir::RegionRange":$regions, + "::mlir::SmallVectorImpl<::mlir::ShapedTypeComponents>&": $inferredReturnShapes) >, InterfaceMethod< @@ -106,12 +106,12 @@ Insert operations using the given OpBuilder that computes the result shape. }], - /*retTy=*/"LogicalResult", + /*retTy=*/"::mlir::LogicalResult", /*methodName=*/"reifyReturnTypeShapes", - /*args=*/(ins "OpBuilder&":$builder, - "SmallVectorImpl&":$reifiedReturnShapes), + /*args=*/(ins "::mlir::OpBuilder&":$builder, + "::mlir::SmallVectorImpl<::mlir::Value>&":$reifiedReturnShapes), /*methodBody=*/[{}], - /*defaultImplementation=*/[{ return failure(); }] + /*defaultImplementation=*/[{ return ::mlir::failure(); }] >, ]; } diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp --- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -898,8 +898,9 @@ if (operand.isOptional()) { m = opClass.addMethodAndPrune("::mlir::Value", operand.name); - m->body() << " auto operands = getODSOperands(" << i << ");\n" - << " return operands.empty() ? Value() : *operands.begin();"; + m->body() + << " auto operands = getODSOperands(" << i << ");\n" + << " return operands.empty() ? ::mlir::Value() : *operands.begin();"; } else if (operand.isVariadic()) { m = opClass.addMethodAndPrune(rangeType, operand.name); m->body() << " return getODSOperands(" << i << ");"; diff --git a/mlir/tools/mlir-tblgen/RewriterGen.cpp b/mlir/tools/mlir-tblgen/RewriterGen.cpp --- a/mlir/tools/mlir-tblgen/RewriterGen.cpp +++ b/mlir/tools/mlir-tblgen/RewriterGen.cpp @@ -260,7 +260,7 @@ raw_indented_ostream::DelimitedScope scope(os); - os << "if(!" << opName << ") return failure();\n"; + os << "if(!" << opName << ") return ::mlir::failure();\n"; for (int i = 0, e = tree.getNumArgs(); i != e; ++i) { std::string argName = formatv("arg{0}_{1}", depth, i); if (DagNode argTree = tree.getArgAsNestedDag(i)) { @@ -286,7 +286,7 @@ fmt, &fmtCtx.addSubst("_loc", locToUse), opName, capture[0], capture[1], capture[2], capture[3], capture[4], capture[5], capture[6], capture[7])); - os << "if (failed(" << nativeCodeCall << ")) return failure();\n"; + os << "if (failed(" << nativeCodeCall << ")) return ::mlir::failure();\n"; for (int i = 0, e = tree.getNumArgs(); i != e; ++i) { auto name = tree.getArgName(i); @@ -336,7 +336,7 @@ // Skip the operand matching at depth 0 as the pattern rewriter already does. if (depth != 0) { // Skip if there is no defining operation (e.g., arguments to function). - os << formatv("if (!{0}) return failure();\n", castedName); + os << formatv("if (!{0}) return ::mlir::failure();\n", castedName); } if (tree.getNumArgs() != op.getNumArgs()) { PrintFatalError(loc, formatv("op '{0}' argument number mismatch: {1} in "