This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Add DINamespace attribute
ClosedPublic

Authored by Dinistro on Feb 17 2023, 12:40 AM.

Details

Summary

This commit introduces the DINamespaceAttr to model LLVM's DINamespace metadata.

Diff Detail

Event Timeline

Dinistro created this revision.Feb 17 2023, 12:40 AM
Herald added a project: Restricted Project. · View Herald Transcript
Dinistro requested review of this revision.Feb 17 2023, 12:40 AM
gysit added inline comments.Feb 17 2023, 1:28 AM
mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
49

nit: let's try to order this alphabetical? I think null type and namespace are now not in alphabetical order.

66

nit: same here.

mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
2804

nit: same here.

mlir/lib/Target/LLVMIR/DebugImporter.cpp
110–112

Can this happen after adding the namespace metadata?

120

Since the scope of the namespace is optional I would probably just return a namespace with the scope set to null in this case to stop the error propagation.

mlir/lib/Target/LLVMIR/DebugTranslation.cpp
244

nit: let's also reorder to make it alphabetical again.

Dinistro updated this revision to Diff 498284.Feb 17 2023, 1:59 AM
Dinistro marked 6 inline comments as done.

Address review comments

Dinistro added inline comments.Feb 17 2023, 1:59 AM
mlir/lib/Target/LLVMIR/DebugImporter.cpp
110–112

This is not entirely clear. The downstream testing application with 60k lines of LLVM IR does not reach this case, so I'll revert this part.

gysit accepted this revision.Feb 17 2023, 3:44 AM

Thanks, LGTM!

This revision is now accepted and ready to land.Feb 17 2023, 3:44 AM
This revision was automatically updated to reflect the committed changes.