mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 19:24:25 +00:00
Add DbgVariable::resolve per Eric's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192218 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -116,6 +116,13 @@ static const unsigned InitAbbreviationsSetSize = 9; // log2(512)
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
|
/// resolve - Look in the DwarfDebug map for the MDNode that
|
||||||
|
/// corresponds to the reference.
|
||||||
|
template <typename T>
|
||||||
|
T DbgVariable::resolve(DIRef<T> Ref) const {
|
||||||
|
return DD->resolve(Ref);
|
||||||
|
}
|
||||||
|
|
||||||
DIType DbgVariable::getType() const {
|
DIType DbgVariable::getType() const {
|
||||||
DIType Ty = Var.getType();
|
DIType Ty = Var.getType();
|
||||||
// FIXME: isBlockByrefVariable should be reformulated in terms of complex
|
// FIXME: isBlockByrefVariable should be reformulated in terms of complex
|
||||||
@ -149,13 +156,13 @@ DIType DbgVariable::getType() const {
|
|||||||
uint16_t tag = Ty.getTag();
|
uint16_t tag = Ty.getTag();
|
||||||
|
|
||||||
if (tag == dwarf::DW_TAG_pointer_type)
|
if (tag == dwarf::DW_TAG_pointer_type)
|
||||||
subType = DD->resolve(DIDerivedType(Ty).getTypeDerivedFrom());
|
subType = resolve(DIDerivedType(Ty).getTypeDerivedFrom());
|
||||||
|
|
||||||
DIArray Elements = DICompositeType(subType).getTypeArray();
|
DIArray Elements = DICompositeType(subType).getTypeArray();
|
||||||
for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) {
|
for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) {
|
||||||
DIDerivedType DT = DIDerivedType(Elements.getElement(i));
|
DIDerivedType DT = DIDerivedType(Elements.getElement(i));
|
||||||
if (getName() == DT.getName())
|
if (getName() == DT.getName())
|
||||||
return (DD->resolve(DT.getTypeDerivedFrom()));
|
return (resolve(DT.getTypeDerivedFrom()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Ty;
|
return Ty;
|
||||||
|
@ -209,6 +209,11 @@ public:
|
|||||||
return Var.getAddrElement(i);
|
return Var.getAddrElement(i);
|
||||||
}
|
}
|
||||||
DIType getType() const;
|
DIType getType() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// resolve - Look in the DwarfDebug map for the MDNode that
|
||||||
|
/// corresponds to the reference.
|
||||||
|
template <typename T> T resolve(DIRef<T> Ref) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief Collects and handles information specific to a particular
|
/// \brief Collects and handles information specific to a particular
|
||||||
|
Reference in New Issue
Block a user