aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-01-05 19:55:07 +0000
committerDevang Patel <dpatel@apple.com>2009-01-05 19:55:07 +0000
commita22d57d6f8215717298ae0cef34d00ab5104ddea (patch)
tree22b9b66fdc9a11799666645ffc55d6c8d38feda3 /include
parent50b84f44e4bf4099d62a86abd4f553a095305eac (diff)
downloadexternal_llvm-a22d57d6f8215717298ae0cef34d00ab5104ddea.zip
external_llvm-a22d57d6f8215717298ae0cef34d00ab5104ddea.tar.gz
external_llvm-a22d57d6f8215717298ae0cef34d00ab5104ddea.tar.bz2
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
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/DebugInfo.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h
index bc89102..fae9a44 100644
--- a/include/llvm/Analysis/DebugInfo.h
+++ b/include/llvm/Analysis/DebugInfo.h
@@ -77,6 +77,7 @@ namespace llvm {
unsigned getTag() const {
return getUnsignedField(0) & ~VersionMask;
}
+ static inline bool classof(const DIDescriptor *D) { return true; }
};
/// DIAnchor - A wrapper for various anchor descriptors.
@@ -94,6 +95,11 @@ namespace llvm {
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.
@@ -102,8 +108,8 @@ namespace llvm {
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);
}
};
@@ -180,6 +186,11 @@ namespace llvm {
/// 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());
+ }
};
@@ -197,6 +208,10 @@ namespace llvm {
/// 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.