mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 16:06:07 +00:00
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:
parent
3b9ad93a35
commit
dfcd0661a1
@ -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,
|
||||
|
@ -1,4 +1,8 @@
|
||||
// RUN: %clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s
|
||||
int global;
|
||||
// CHECK: asciz "global" ## External Name
|
||||
int main() { return 0;}
|
||||
// CHECK: asciz "global" ## External Name
|
||||
// CHECK: asciz "localstatic" ## External Name
|
||||
int main() {
|
||||
static int localstatic;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user