Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6f73e4b

Browse filesBrowse files
[mlir][MLProgram][NFC] Migrate to OpAsmAttrInterface for ASM alias generation
1 parent 87b4cac commit 6f73e4b
Copy full SHA for 6f73e4b

File tree

2 files changed

+3
-8
lines changed
Filter options

2 files changed

+3
-8
lines changed

‎mlir/include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.td

Copy file name to clipboardExpand all lines: mlir/include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.td
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ def MLProgram_ExternAttr : MLProgram_Attr<"Extern", [TypedAttrInterface]> {
4040
let parameters = (ins AttributeSelfTypeParameter<"">:$type);
4141
let mnemonic = "extern";
4242
let assemblyFormat = "";
43+
44+
// Generate mnemonic alias for the attribute.
45+
let genMnemonicAlias = 1;
4346
}
4447

4548
#endif // MLPROGRAM_ATTRIBUTES

‎mlir/lib/Dialect/MLProgram/IR/MLProgramDialect.cpp

Copy file name to clipboardExpand all lines: mlir/lib/Dialect/MLProgram/IR/MLProgramDialect.cpp
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ struct MLProgramInlinerInterface : public DialectInlinerInterface {
3939

4040
struct MLProgramOpAsmDialectInterface : public OpAsmDialectInterface {
4141
using OpAsmDialectInterface::OpAsmDialectInterface;
42-
43-
AliasResult getAlias(Attribute attr, raw_ostream &os) const override {
44-
if (llvm::isa<ExternAttr>(attr)) {
45-
os << "extern";
46-
return AliasResult::OverridableAlias;
47-
}
48-
return AliasResult::NoAlias;
49-
}
5042
};
5143
} // namespace
5244

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.