]> granicus.if.org Git - clang/commitdiff
Directly use NamespaceDecl->getLocation() to find the source file.
authorDevang Patel <dpatel@apple.com>
Thu, 28 Oct 2010 19:12:46 +0000 (19:12 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 28 Oct 2010 19:12:46 +0000 (19:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117576 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index e4ae3bd3bc66694fce7d92986e89163978d8a2e5..97639db887abca0ed5ae756b5baa9adb6ea8fd2c 100644 (file)
@@ -2036,12 +2036,11 @@ CGDebugInfo::getOrCreateNameSpace(const NamespaceDecl *NSDecl,
     return llvm::DINameSpace(cast<llvm::MDNode>(I->second));
   
   unsigned LineNo = getLineNumber(NSDecl->getLocation());
-
+  llvm::DIFile FileD = getOrCreateFile(NSDecl->getLocation());
   llvm::DIDescriptor Context = 
     getContextDescriptor(dyn_cast<Decl>(NSDecl->getDeclContext()), Unit);
   llvm::DINameSpace NS =
-    DebugFactory.CreateNameSpace(Context, NSDecl->getName(), 
-                                 llvm::DIFile(Unit), LineNo);
+    DebugFactory.CreateNameSpace(Context, NSDecl->getName(), FileD, LineNo);
   NameSpaceCache[NSDecl] = llvm::WeakVH(NS);
   return NS;
 }