This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Stop exporting empty debug MD strings
ClosedPublic

Authored by Dinistro on Feb 17 2023, 6:27 AM.

Details

Summary

This commit ensures that no empty debug metadata strings are exported as
these are not legal names. Additionally, this commit ensures that
non-existing strings are not accidentially imported as empty strings.

Diff Detail

Event Timeline

Dinistro created this revision.Feb 17 2023, 6:27 AM
Herald added a project: Restricted Project. · View Herald Transcript
Dinistro requested review of this revision.Feb 17 2023, 6:27 AM
Dinistro updated this revision to Diff 498358.Feb 17 2023, 7:06 AM

Make now potential null attr optional

gysit added inline comments.Feb 17 2023, 7:21 AM
mlir/lib/Target/LLVMIR/DebugTranslation.cpp
115–116

I think this should also be getMDStringOrNull(attr.getProducer())?

148–149

That seems to be a debug leftover?

Dinistro updated this revision to Diff 498369.Feb 17 2023, 7:32 AM
Dinistro marked an inline comment as done.

address review comments

gysit accepted this revision.Feb 17 2023, 7:53 AM

LGTM

mlir/lib/Target/LLVMIR/DebugTranslation.h
81

nit: an string -> a string

This revision is now accepted and ready to land.Feb 17 2023, 7:53 AM
This revision was automatically updated to reflect the committed changes.
Dinistro marked 2 inline comments as done.