diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-22 21:28:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-22 21:28:29 +0000 |
commit | 65f7a3f801de0661361c17a71a59c8cf26b465d0 (patch) | |
tree | c67ac08af74adaae7e6d9a82b739a80cca0ad916 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 14694d366659881096fb4344c1bb301d7cdc85aa (diff) | |
download | bcm5719-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.cpp | 4 |
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(); |