]> granicus.if.org Git - clang/commitdiff
Set isMain bit for MainFile.
authorDevang Patel <dpatel@apple.com>
Thu, 5 Mar 2009 01:55:07 +0000 (01:55 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 5 Mar 2009 01:55:07 +0000 (01:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66120 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 63ba0dfd39b50a4852e4bb48e287aeac558e50fb..dcf34bbd2e989d6613f3dc3d27b40a8e2f712f0e 100644 (file)
@@ -69,11 +69,13 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) {
   const char *FileName = FE ? FE->getName() : "<unknown>";
   const char *DirName = FE ? FE->getDir()->getName() : "<unknown>";
   
+  bool isMain = (FE == SM.getFileEntryForID(SM.getMainFileID()));
   // Create new compile unit.
   // FIXME: Handle other language IDs as well.
   // FIXME: Do not know how to get clang version yet.
   return Unit = DebugFactory.CreateCompileUnit(llvm::dwarf::DW_LANG_C89,
-                                               FileName, DirName, "clang");
+                                               FileName, DirName, "clang",
+                                               isMain);
 }
 
 /// CreateType - Get the Basic type from the cache or create a new