Directly use NamespaceDecl->getLocation() to find the source file.

llvm-svn: 117576
This commit is contained in:
Devang Patel 2010-10-28 19:12:46 +00:00
parent 29f70afbae
commit faadd7b72d
1 changed files with 2 additions and 3 deletions

View 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;
}