diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-23 22:29:09 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-23 22:29:09 +0000 |
commit | c5225dfbea3ecd581b9d2b5285334bf45594c1a8 (patch) | |
tree | 8f39b89f1b9de89f3dc6a4560f85add0a74ba0a3 /llvm/lib/IR/DIBuilder.cpp | |
parent | 4652c595680cee60e2ea1bb6f6a447a6a993592e (diff) | |
download | llvm-c5225dfbea3ecd581b9d2b5285334bf45594c1a8.zip llvm-c5225dfbea3ecd581b9d2b5285334bf45594c1a8.tar.gz llvm-c5225dfbea3ecd581b9d2b5285334bf45594c1a8.tar.bz2 |
DebugInfo: Change DIBuilder to make distinct DIGlobalVariables
A long overdue change to make DIGlobalVariable distinct. Much like
DISubprogram definitions (changed in r246098), it isn't logical to
unique DIGlobalVariable definitions from two different compile units.
(Longer-term, we should also find a way to reverse the link between
GlobalVariable and DIGlobalVariable, and between DIGlobalVariable and
DICompileUnit, so that debug info to do with optimized-out globals
disappears. Admittedly it's harder than with Function/DISubprogram,
since global variables may be constant-folded and the debug info should
still describe that somehow.)
llvm-svn: 267301
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index f0baff7..9a61afb 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -560,10 +560,10 @@ DIGlobalVariable *DIBuilder::createGlobalVariable( MDNode *Decl) { checkGlobalVariableScope(Context); - auto *N = - DIGlobalVariable::get(VMContext, cast_or_null<DIScope>(Context), Name, - LinkageName, F, LineNumber, Ty, isLocalToUnit, true, - Val, cast_or_null<DIDerivedType>(Decl)); + auto *N = DIGlobalVariable::getDistinct( + VMContext, cast_or_null<DIScope>(Context), Name, LinkageName, F, + LineNumber, Ty, isLocalToUnit, true, Val, + cast_or_null<DIDerivedType>(Decl)); AllGVs.push_back(N); return N; } |