summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
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')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp7
-rw-r--r--llvm/lib/IR/DebugInfo.cpp4
2 files changed, 3 insertions, 8 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) &&
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index d7f5f6396aa..20467c93adb 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -49,10 +49,6 @@ bool DIVariable::isInlinedFnArgument(const Function *CurFn) {
return !SP.describes(CurFn);
}
-GlobalVariable *DIGlobalVariable::getGlobal() const {
- return dyn_cast_or_null<GlobalVariable>(getConstant());
-}
-
void DICompileUnit::replaceSubprograms(DIArray Subprograms) {
get()->replaceSubprograms(MDSubprogramArray(Subprograms));
}
OpenPOWER on IntegriCloud