]> granicus.if.org Git - clang/commitdiff
Comment the reasons for the strange little dance we do with the main file name for...
authorDouglas Gregor <dgregor@apple.com>
Mon, 22 Mar 2010 21:28:29 +0000 (21:28 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 22 Mar 2010 21:28:29 +0000 (21:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99215 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index ad97d08a2bf7f623bcae46e5243a9785f90dfe73..df1a24ce31cfff4bf54e19ff4dee4af4467be6b6 100644 (file)
@@ -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();