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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234796 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-13 20:39:25 +00:00
parent 57ea789c3e
commit 7153e0d49b
3 changed files with 3 additions and 9 deletions

View File

@ -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) &&