mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-15 09:33:39 +00:00
Add classof() methods so that dwarf writer can decide what DIDescriptor is in its hand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61740 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
50b84f44e4
commit
a22d57d6f8
@ -77,6 +77,7 @@ namespace llvm {
|
|||||||
unsigned getTag() const {
|
unsigned getTag() const {
|
||||||
return getUnsignedField(0) & ~VersionMask;
|
return getUnsignedField(0) & ~VersionMask;
|
||||||
}
|
}
|
||||||
|
static inline bool classof(const DIDescriptor *D) { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DIAnchor - A wrapper for various anchor descriptors.
|
/// DIAnchor - A wrapper for various anchor descriptors.
|
||||||
@ -94,6 +95,11 @@ namespace llvm {
|
|||||||
|
|
||||||
int64_t getLo() const { return (int64_t)getUInt64Field(1); }
|
int64_t getLo() const { return (int64_t)getUInt64Field(1); }
|
||||||
int64_t getHi() const { return (int64_t)getUInt64Field(2); }
|
int64_t getHi() const { return (int64_t)getUInt64Field(2); }
|
||||||
|
static bool isSubrange(unsigned);
|
||||||
|
static inline bool classof(const DISubrange *) { return true; }
|
||||||
|
static inline bool classof(const DIDescriptor *D) {
|
||||||
|
return isSubrange(D->getTag());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DIArray - This descriptor holds an array of descriptors.
|
/// DIArray - This descriptor holds an array of descriptors.
|
||||||
@ -102,8 +108,8 @@ namespace llvm {
|
|||||||
explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {}
|
explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {}
|
||||||
|
|
||||||
unsigned getNumElements() const;
|
unsigned getNumElements() const;
|
||||||
DISubrange getElement(unsigned Idx) const {
|
DIDescriptor getElement(unsigned Idx) const {
|
||||||
return getFieldAs<DISubrange>(Idx);
|
return getDescriptorField(Idx);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -180,6 +186,11 @@ namespace llvm {
|
|||||||
/// isDerivedType - Return true if the specified tag is legal for
|
/// isDerivedType - Return true if the specified tag is legal for
|
||||||
/// DIDerivedType.
|
/// DIDerivedType.
|
||||||
static bool isDerivedType(unsigned TAG);
|
static bool isDerivedType(unsigned TAG);
|
||||||
|
|
||||||
|
static inline bool classof(const DIDerivedType *) { return true; }
|
||||||
|
static inline bool classof(const DIDescriptor *D) {
|
||||||
|
return isDerivedType(D->getTag());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -197,6 +208,10 @@ namespace llvm {
|
|||||||
/// isCompositeType - Return true if the specified tag is legal for
|
/// isCompositeType - Return true if the specified tag is legal for
|
||||||
/// DICompositeType.
|
/// DICompositeType.
|
||||||
static bool isCompositeType(unsigned TAG);
|
static bool isCompositeType(unsigned TAG);
|
||||||
|
static inline bool classof(const DIDerivedType *) { return true; }
|
||||||
|
static inline bool classof(const DIDescriptor *D) {
|
||||||
|
return isCompositeType(D->getTag());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DIGlobal - This is a common class for global variables and subprograms.
|
/// DIGlobal - This is a common class for global variables and subprograms.
|
||||||
|
@ -181,6 +181,11 @@ unsigned DIArray::getNumElements() const {
|
|||||||
return C->getNumOperands();
|
return C->getNumOperands();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// isSubrange - Return true if the specified tag is legal for DISubrange.
|
||||||
|
bool DISubrange::isSubrange(unsigned Tag) {
|
||||||
|
return Tag == dwarf::DW_TAG_subrange_type;
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// DIFactory: Basic Helpers
|
// DIFactory: Basic Helpers
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user