Use clang::VarDecl name instead of llvm::GlobalVariable name.

llvm::GLobalVariable name may not match user visibile name for function static variables.

llvm-svn: 102644
This commit is contained in:
Devang Patel
2010-04-29 17:48:37 +00:00
parent 3b9ad93a35
commit dfcd0661a1
2 changed files with 7 additions and 3 deletions

View File

@@ -1601,7 +1601,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
T = CGM.getContext().getConstantArrayType(ET, ConstVal,
ArrayType::Normal, 0);
}
llvm::StringRef DeclName = Var->getName();
llvm::StringRef DeclName = D->getName();
llvm::DIDescriptor DContext =
getContextDescriptor(dyn_cast<Decl>(D->getDeclContext()), Unit);
DebugFactory.CreateGlobalVariable(DContext, DeclName,