This is an archive of the discontinued LLVM Phabricator instance.

Avoid appending the source directory to an absolute path

Authored by aprantl on Oct 18 2019, 7:52 PM.



When building a precompiled header in -fmodule-format=obj (i.e., `-gmodules) in an absolute path, the locig in CGDebugInfo::createCompileUnit would unconditionally append the source directory to the -main-file-name. This patch avoids that behavior for absolute paths.


Diff Detail

Event Timeline

aprantl created this revision.Oct 18 2019, 7:52 PM
JDevlieghere added inline comments.Oct 21 2019, 9:15 AM

Should we check if MainFileDir is absolute to, instead of just checking for .?

JDevlieghere accepted this revision.Oct 21 2019, 9:16 AM

LGTM modulo the comment.

This revision is now accepted and ready to land.Oct 21 2019, 9:16 AM
aprantl marked an inline comment as done.Oct 21 2019, 9:22 AM
aprantl added inline comments.

We might want to unconditionally call remove-dots instead.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 21 2019, 9:48 AM