This is the corresponding method to
OpAsmParser::parseOptionalLocationSpecifier that prints a location
loc(...) based on the op printing flags. Together, these two functions
allow propagating user-level location info outside of their usual spots.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/IR/OpImplementation.h | ||
---|---|---|
333 | I would drop the allowAlias. Locations printed this way should never be deferred, and should always allow aliases. | |
mlir/lib/IR/AsmPrinter.cpp | ||
567 | This should use printAttribute on the provided location, otherwise this will break if there is a deferred alias. |
mlir/include/mlir/IR/OpImplementation.h | ||
---|---|---|
330–331 | I would drop this. The part about aliases isn't completely relevant to users here. | |
mlir/test/lib/Dialect/Test/TestDialect.cpp | ||
1039 | Can you move the encoding part to later and just grab the SMLoc here? Encoding involves uniquing the attribute (+ some other stuff), which we should only do if we need to (i.e. in the else branch here). It's good to keep this clean in case people look at it as an example usage. |
I would drop this. The part about aliases isn't completely relevant to users here.