summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-22 21:28:29 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-22 21:28:29 +0000
commit65f7a3f801de0661361c17a71a59c8cf26b465d0 (patch)
treec67ac08af74adaae7e6d9a82b739a80cca0ad916 /clang/lib/CodeGen/CGDebugInfo.cpp
parent14694d366659881096fb4344c1bb301d7cdc85aa (diff)
downloadbcm5719-llvm-65f7a3f801de0661361c17a71a59c8cf26b465d0.tar.gz
bcm5719-llvm-65f7a3f801de0661361c17a71a59c8cf26b465d0.zip
Comment the reasons for the strange little dance we do with the main file name for debug information
llvm-svn: 99215
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index ad97d08a2bf..df1a24ce31c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -112,6 +112,10 @@ void CGDebugInfo::CreateCompileUnit() {
llvm::sys::Path AbsFileName(MainFileName);
AbsFileName.makeAbsolute();
+ // The main file name provided via the "-main-file-name" option contains just
+ // the file name itself with no path information. This file name may have had
+ // a relative path, so we look into the actual file entry for the main
+ // file to determine the real absolute path for the file.
std::string MainFileDir;
if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID()))
MainFileDir = MainFile->getDir()->getName();
OpenPOWER on IntegriCloud