This is an archive of the discontinued LLVM Phabricator instance.

Use debug-prefix-map for AT_NAME
ClosedPublic

Authored by starsid on Jul 11 2018, 1:05 AM.

Details

Summary

AT_NAME was being emitted before the directory paths were remapped. This
ensures that all paths are remapped before anything is emitted.

An additional test case has been added.

Note that this only works if the replacement string is an absolute path. If not,
then AT_decl_file believes the new path is a relative path, and joins that path
with the compilation directory. I do not know of a good way to resolve this.

Diff Detail

Repository
rL LLVM

Event Timeline

starsid created this revision.Jul 11 2018, 1:05 AM
starsid updated this revision to Diff 154943.Jul 11 2018, 1:28 AM

improve test

starsid edited the summary of this revision. (Show Details)Jul 11 2018, 1:34 AM
JDevlieghere accepted this revision.Jul 11 2018, 2:44 AM

LGTM with inline comments.

lib/MC/MCContext.cpp
545 ↗(On Diff #154943)

I might have missed something, but can't this be a std::string&?

545 ↗(On Diff #154943)

I probably would've made this a static non-member function, but I don't think there's anything wrong with a lambda.

This revision is now accepted and ready to land.Jul 11 2018, 2:44 AM
starsid marked 2 inline comments as done.Jul 11 2018, 3:17 AM

I actually do not have permissions to commit the revision. So if you don't want me to make more changes, can you please commit this.

Please let me know if you want me to follow up on the suggested changes in the inline comments.

lib/MC/MCContext.cpp
545 ↗(On Diff #154943)

Ack.

Let me know if you actually do want me to convert this to a static non-member function.

545 ↗(On Diff #154943)

It can be std::string&, but I thought when your intention is to modify the argument, you take it as a pointer. Sorry, this is my first change following LLVM code style so I am not familiar with what is expected.

JDevlieghere added inline comments.Jul 11 2018, 5:34 AM
lib/MC/MCContext.cpp
545 ↗(On Diff #154943)

No, it's perfectly fine. I was only curious if there was a particular reason that I didn't consider :-)

545 ↗(On Diff #154943)

No worries, I don't think they coding standard has an explicit entry on this. I think a non-const ref is the way to go here because passing nullptr doesn't mean anything here. Based on your reply I've made the change before committing, as it didn't seem worth the trouble to have you update the patch.

This revision was automatically updated to reflect the committed changes.