[Mlir-commits] [mlir] b1e9ce7 - Add ::mlir:: prefix to Attribute	type in the generated code.
    llvmlistbot at llvm.org 
    llvmlistbot at llvm.org
       
    Mon Oct 17 22:14:32 PDT 2022
    
    
  
Author: bixia1
Date: 2022-10-17T22:14:26-07:00
New Revision: b1e9ce7f22458c74f3a8fcff36ce107cbc3ddc4e
URL: https://github.com/llvm/llvm-project/commit/b1e9ce7f22458c74f3a8fcff36ce107cbc3ddc4e
DIFF: https://github.com/llvm/llvm-project/commit/b1e9ce7f22458c74f3a8fcff36ce107cbc3ddc4e.diff
LOG: Add ::mlir:: prefix to Attribute type in the generated code.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D136129
Added: 
    
Modified: 
    mlir/tools/mlir-tblgen/OpFormatGen.cpp
Removed: 
    
################################################################################
diff  --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
index ef410c947344f..111cb0098c66f 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -1668,7 +1668,8 @@ static void genAttrDictPrinter(OperationFormat &fmt, Operator &op,
           tgfmt(attr.getConstBuilderTemplate(), &fctx, attr.getDefaultValue()));
       body << "  {\n";
       body << "     ::mlir::Builder odsBuilder(getContext());\n";
-      body << "     Attribute attr = " << op.getGetterName(name) << "Attr();\n";
+      body << "     ::mlir::Attribute attr = " << op.getGetterName(name)
+           << "Attr();\n";
       body << "     if(attr && (attr == " << defaultValue << "))\n";
       body << "       elidedAttrs.push_back(\"" << name << "\");\n";
       body << "  }\n";
        
    
    
More information about the Mlir-commits
mailing list