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 | f6728fcbec62be94469a6e80c7e7e32e3f2c3329 (patch) | |
tree | 6f98e546d9a5745080675b16ffea08ef584280c4 /lib/CodeGen/CGDebugInfo.cpp | |
parent | 3c989027f68e2d9dfd57c018ccc550bd9fb79920 (diff) |
Comment the reasons for the strange little dance we do with the main file name for debug information
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99215 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index ad97d08a2b..df1a24ce31 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/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(); |