mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-12 22:53:08 +00:00
Fix getFieldAs() to use the parameter instead of 6.
Add missing DIType constructor, needed by DIVariable::getType(). llvm-svn: 60976
This commit is contained in:
parent
2880dc8e8c
commit
8898288749
@ -60,7 +60,7 @@ namespace llvm {
|
|||||||
|
|
||||||
template <typename DescTy>
|
template <typename DescTy>
|
||||||
DescTy getFieldAs(unsigned Elt) const {
|
DescTy getFieldAs(unsigned Elt) const {
|
||||||
return DescTy(getDescriptorField(6).getGV());
|
return DescTy(getDescriptorField(Elt).getGV());
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalVariable *getGlobalVariableField(unsigned Elt) const;
|
GlobalVariable *getGlobalVariableField(unsigned Elt) const;
|
||||||
|
@ -100,6 +100,14 @@ DIGlobalVariable::DIGlobalVariable(GlobalVariable *GV)
|
|||||||
: DIGlobal(GV, dwarf::DW_TAG_variable) {}
|
: DIGlobal(GV, dwarf::DW_TAG_variable) {}
|
||||||
DIBlock::DIBlock(GlobalVariable *GV)
|
DIBlock::DIBlock(GlobalVariable *GV)
|
||||||
: DIDescriptor(GV, dwarf::DW_TAG_lexical_block) {}
|
: DIDescriptor(GV, dwarf::DW_TAG_lexical_block) {}
|
||||||
|
// needed by DIVariable::getType()
|
||||||
|
DIType::DIType(GlobalVariable *GV) : DIDescriptor(GV) {
|
||||||
|
if (!GV) return;
|
||||||
|
unsigned tag = getTag();
|
||||||
|
if (tag != dwarf::DW_TAG_base_type && !DIDerivedType::isDerivedType(tag) &&
|
||||||
|
!DICompositeType::isCompositeType(tag))
|
||||||
|
GV = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/// isDerivedType - Return true if the specified tag is legal for
|
/// isDerivedType - Return true if the specified tag is legal for
|
||||||
/// DIDerivedType.
|
/// DIDerivedType.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user