This is an archive of the discontinued LLVM Phabricator instance.

Honor -fdebug-prefix-map when creating function names for the debug info.
ClosedPublic

Authored by aprantl on Nov 30 2018, 11:33 AM.

Diff Detail

Event Timeline

aprantl updated this revision to Diff 176174.Nov 30 2018, 11:33 AM
aprantl created this revision.

fix a comment.

Can't say I know much abouth the path remapping functionality - what it's used for, where it's implemented in general, etc - so figure someone with more of that knowledge might be best off reviewing this.

probinson added inline comments.
lib/CodeGen/CGDebugInfo.cpp
238

Unconditionally?

Can't say I know much abouth the path remapping functionality - what it's used for, where it's implemented in general, etc - so figure someone with more of that knowledge might be best off reviewing this.

One common use-case for path remapping is a build system that builds on a different machine in some local directory, but wanting the debug info appear as if the source code were in a previously agreed-upon path so it can be debugged on another machine were the source code can be found in that same path.

aprantl updated this revision to Diff 176194.Nov 30 2018, 1:38 PM

Only initialize RemapFilePaths when DebugPrefixMap is nonempty. Should be slightly faster.

aprantl marked an inline comment as done.Nov 30 2018, 1:38 PM
aprantl added a reviewer: probinson.
probinson accepted this revision.Nov 30 2018, 1:48 PM

LGTM aside from a grump about the test, which is totally up to you.

test/CodeGenCXX/debug-prefix-map-lambda.cpp
8

I've never liked tests that hard-code the test file name. FileCheck lets you define variables on the RUN line, is there a lit substitution that will return just the basename?

This revision is now accepted and ready to land.Nov 30 2018, 1:48 PM
aprantl marked an inline comment as done.Nov 30 2018, 4:24 PM
aprantl added inline comments.
test/CodeGenCXX/debug-prefix-map-lambda.cpp
8

Looks like there is not LIT substitution for the filename without the path. At least not a documented one.

This revision was automatically updated to reflect the committed changes.