summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-13 20:39:25 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-13 20:39:25 +0000
commitcca5f68e5310b7ada3f0eb9b724d483c59da4f7b (patch)
tree41b960e652f431f0691d7f0e2dbea133489cd86d /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent2c4487de6de9fbdc7cf2ee7d9ea6f462b2f425d6 (diff)
downloadbcm5719-llvm-cca5f68e5310b7ada3f0eb9b724d483c59da4f7b.tar.gz
bcm5719-llvm-cca5f68e5310b7ada3f0eb9b724d483c59da4f7b.zip
DebugInfo: Remove DIGlobalVariable::getGlobal()
`DIGlobalVariable::getGlobal()` isn't really helpful, it just does a `dyn_cast_or_null<>`. Simplify its only user by doing the cast directly and delete the code. llvm-svn: 234796
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index d84b17a92f1..bc4d5e75fa0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -140,12 +140,11 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(DIGlobalVariable GV) {
// Add location.
bool addToAccelTable = false;
- bool isGlobalVariable = GV.getGlobal() != nullptr;
- if (isGlobalVariable) {
+ if (auto *Global = dyn_cast_or_null<GlobalVariable>(GV.getConstant())) {
addToAccelTable = true;
DIELoc *Loc = new (DIEValueAllocator) DIELoc();
- const MCSymbol *Sym = Asm->getSymbol(GV.getGlobal());
- if (GV.getGlobal()->isThreadLocal()) {
+ const MCSymbol *Sym = Asm->getSymbol(Global);
+ if (Global->isThreadLocal()) {
// FIXME: Make this work with -gsplit-dwarf.
unsigned PointerSize = Asm->getDataLayout().getPointerSize();
assert((PointerSize == 4 || PointerSize == 8) &&
OpenPOWER on IntegriCloud