mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
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:
@ -681,7 +681,6 @@ public:
|
|||||||
StringRef getDirectory() const { return get()->getDirectory(); }
|
StringRef getDirectory() const { return get()->getDirectory(); }
|
||||||
DITypeRef getType() const { return get()->getType(); }
|
DITypeRef getType() const { return get()->getType(); }
|
||||||
|
|
||||||
GlobalVariable *getGlobal() const;
|
|
||||||
Constant *getConstant() const { return get()->getVariable(); }
|
Constant *getConstant() const { return get()->getVariable(); }
|
||||||
DIDerivedType getStaticDataMemberDeclaration() const {
|
DIDerivedType getStaticDataMemberDeclaration() const {
|
||||||
return DIDerivedType(get()->getStaticDataMemberDeclaration());
|
return DIDerivedType(get()->getStaticDataMemberDeclaration());
|
||||||
|
@ -140,12 +140,11 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(DIGlobalVariable GV) {
|
|||||||
|
|
||||||
// Add location.
|
// Add location.
|
||||||
bool addToAccelTable = false;
|
bool addToAccelTable = false;
|
||||||
bool isGlobalVariable = GV.getGlobal() != nullptr;
|
if (auto *Global = dyn_cast_or_null<GlobalVariable>(GV.getConstant())) {
|
||||||
if (isGlobalVariable) {
|
|
||||||
addToAccelTable = true;
|
addToAccelTable = true;
|
||||||
DIELoc *Loc = new (DIEValueAllocator) DIELoc();
|
DIELoc *Loc = new (DIEValueAllocator) DIELoc();
|
||||||
const MCSymbol *Sym = Asm->getSymbol(GV.getGlobal());
|
const MCSymbol *Sym = Asm->getSymbol(Global);
|
||||||
if (GV.getGlobal()->isThreadLocal()) {
|
if (Global->isThreadLocal()) {
|
||||||
// FIXME: Make this work with -gsplit-dwarf.
|
// FIXME: Make this work with -gsplit-dwarf.
|
||||||
unsigned PointerSize = Asm->getDataLayout().getPointerSize();
|
unsigned PointerSize = Asm->getDataLayout().getPointerSize();
|
||||||
assert((PointerSize == 4 || PointerSize == 8) &&
|
assert((PointerSize == 4 || PointerSize == 8) &&
|
||||||
|
@ -49,10 +49,6 @@ bool DIVariable::isInlinedFnArgument(const Function *CurFn) {
|
|||||||
return !SP.describes(CurFn);
|
return !SP.describes(CurFn);
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalVariable *DIGlobalVariable::getGlobal() const {
|
|
||||||
return dyn_cast_or_null<GlobalVariable>(getConstant());
|
|
||||||
}
|
|
||||||
|
|
||||||
void DICompileUnit::replaceSubprograms(DIArray Subprograms) {
|
void DICompileUnit::replaceSubprograms(DIArray Subprograms) {
|
||||||
get()->replaceSubprograms(MDSubprogramArray(Subprograms));
|
get()->replaceSubprograms(MDSubprogramArray(Subprograms));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user