Page MenuHomePhabricator

Avoid appending the source directory to an absolute path
ClosedPublic

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

Details

Summary

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.

rdar://problem/46045865

Diff Detail

Event Timeline

aprantl created this revision.Oct 18 2019, 7:52 PM
JDevlieghere added inline comments.Mon, Oct 21, 9:15 AM
clang/lib/CodeGen/CGDebugInfo.cpp
543

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

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

LGTM modulo the comment.

This revision is now accepted and ready to land.Mon, Oct 21, 9:16 AM
aprantl marked an inline comment as done.Mon, Oct 21, 9:22 AM
aprantl added inline comments.
clang/lib/CodeGen/CGDebugInfo.cpp
543

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 TranscriptMon, Oct 21, 9:48 AM