diff options
author | Adrian Prantl <aprantl@apple.com> | 2018-12-01 00:24:27 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2018-12-01 00:24:27 +0000 |
commit | 4caba9b460c14f1ebf60fd7ae7b377f3d2493b2f (patch) | |
tree | 700aeeecc37821de04db25555cd16ad899cbc3f4 /lib/AST/TypePrinter.cpp | |
parent | aa528ab4a083268edddd038d0f251afe792cfa36 (diff) |
Honor -fdebug-prefix-map when creating function names for the debug info.
This adds a callback to PrintingPolicy to allow CGDebugInfo to remap
file paths according to -fdebug-prefix-map. Otherwise the debug info
(particularly function names for C++ lambdas) may contain paths that
should have been remapped in the debug info.
<rdar://problem/46128056>
Differential Revision: https://reviews.llvm.org/D55137
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TypePrinter.cpp')
-rw-r--r-- | lib/AST/TypePrinter.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp index 365f84c599..c05169389c 100644 --- a/lib/AST/TypePrinter.cpp +++ b/lib/AST/TypePrinter.cpp @@ -1157,9 +1157,13 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) { PresumedLoc PLoc = D->getASTContext().getSourceManager().getPresumedLoc( D->getLocation()); if (PLoc.isValid()) { - OS << " at " << PLoc.getFilename() - << ':' << PLoc.getLine() - << ':' << PLoc.getColumn(); + OS << " at "; + StringRef File = PLoc.getFilename(); + if (Policy.RemapFilePaths) + OS << Policy.remapPath(File); + else + OS << File; + OS << ':' << PLoc.getLine() << ':' << PLoc.getColumn(); } } |