diff options
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index f8cd01abddd..6769ed4cff0 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -114,6 +114,16 @@ StringRef CodeViewDebug::getFullFilepath(const DIFile *File) { StringRef Dir = File->getDirectory(), Filename = File->getFilename(); + // If this is a Unix-style path, just use it as is. Don't try to canonicalize + // it textually because one of the path components could be a symlink. + if (!Dir.empty() && Dir[0] == '/') { + Filepath = Dir; + if (Dir.back() != '/') + Filepath += '/'; + Filepath += Filename; + return Filepath; + } + // Clang emits directory and relative filename info into the IR, but CodeView // operates on full paths. We could change Clang to emit full paths too, but // that would increase the IR size and probably not needed for other users. |