unsigned getTag() const {
return getUnsignedField(0) & ~VersionMask;
}
+ static inline bool classof(const DIDescriptor *D) { return true; }
};
/// DIAnchor - A wrapper for various anchor descriptors.
int64_t getLo() const { return (int64_t)getUInt64Field(1); }
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.
explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {}
unsigned getNumElements() const;
- DISubrange getElement(unsigned Idx) const {
- return getFieldAs<DISubrange>(Idx);
+ DIDescriptor getElement(unsigned Idx) const {
+ return getDescriptorField(Idx);
}
};
/// isDerivedType - Return true if the specified tag is legal for
/// DIDerivedType.
static bool isDerivedType(unsigned TAG);
+
+ static inline bool classof(const DIDerivedType *) { return true; }
+ static inline bool classof(const DIDescriptor *D) {
+ return isDerivedType(D->getTag());
+ }
};
/// isCompositeType - Return true if the specified tag is legal for
/// DICompositeType.
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.
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
//===----------------------------------------------------------------------===//