summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-07 01:24:30 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-07 01:24:30 +0000
commit8395c21d775021accaea64bda80b20023354e95e (patch)
treef2426245641537be8803067712eb21ebb0d54120
parent5f3bcf7dc4b32328e2f408710b70d7b39a8ab1fc (diff)
DebugInfo: Move DIType::is*() queries to MDType
Move body of `DIType::isObjectPointer()` (etc.) to `MDType`, and change the versions in `DIType` to forward there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234275 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/IR/DebugInfo.h46
-rw-r--r--include/llvm/IR/DebugInfoMetadata.h23
2 files changed, 39 insertions, 30 deletions
diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h
index 1780232445c..f1827858da1 100644
--- a/include/llvm/IR/DebugInfo.h
+++ b/include/llvm/IR/DebugInfo.h
@@ -330,36 +330,22 @@ public:
// carry this is just plain insane.
uint64_t getOffsetInBits() const { return get()->getOffsetInBits(); }
unsigned getFlags() const { return get()->getFlags(); }
- bool isPrivate() const {
- return (getFlags() & FlagAccessibility) == FlagPrivate;
- }
- bool isProtected() const {
- return (getFlags() & FlagAccessibility) == FlagProtected;
- }
- bool isPublic() const {
- return (getFlags() & FlagAccessibility) == FlagPublic;
- }
- bool isForwardDecl() const { return (getFlags() & FlagFwdDecl) != 0; }
- bool isAppleBlockExtension() const {
- return (getFlags() & FlagAppleBlock) != 0;
- }
- bool isBlockByrefStruct() const {
- return (getFlags() & FlagBlockByrefStruct) != 0;
- }
- bool isVirtual() const { return (getFlags() & FlagVirtual) != 0; }
- bool isArtificial() const { return (getFlags() & FlagArtificial) != 0; }
- bool isObjectPointer() const { return (getFlags() & FlagObjectPointer) != 0; }
- bool isObjcClassComplete() const {
- return (getFlags() & FlagObjcClassComplete) != 0;
- }
- bool isVector() const { return (getFlags() & FlagVector) != 0; }
- bool isStaticMember() const { return (getFlags() & FlagStaticMember) != 0; }
- bool isLValueReference() const {
- return (getFlags() & FlagLValueReference) != 0;
- }
- bool isRValueReference() const {
- return (getFlags() & FlagRValueReference) != 0;
- }
+
+ bool isPrivate() const { return get()->isPrivate(); }
+ bool isProtected() const { return get()->isProtected(); }
+ bool isPublic() const { return get()->isPublic(); }
+ bool isForwardDecl() const { return get()->isForwardDecl(); }
+ bool isAppleBlockExtension() const { return get()->isAppleBlockExtension(); }
+ bool isBlockByrefStruct() const { return get()->isBlockByrefStruct(); }
+ bool isVirtual() const { return get()->isVirtual(); }
+ bool isArtificial() const { return get()->isArtificial(); }
+ bool isObjectPointer() const { return get()->isObjectPointer(); }
+ bool isObjcClassComplete() const { return get()->isObjcClassComplete(); }
+ bool isVector() const { return get()->isVector(); }
+ bool isStaticMember() const { return get()->isStaticMember(); }
+ bool isLValueReference() const { return get()->isLValueReference(); }
+ bool isRValueReference() const { return get()->isRValueReference(); }
+
bool isValid() const { return DbgNode && isa<MDType>(*this); }
};
diff --git a/include/llvm/IR/DebugInfoMetadata.h b/include/llvm/IR/DebugInfoMetadata.h
index ccbc4eeca26..9cf84afea75 100644
--- a/include/llvm/IR/DebugInfoMetadata.h
+++ b/include/llvm/IR/DebugInfoMetadata.h
@@ -530,6 +530,29 @@ public:
Flags = NewFlags;
}
+ bool isPrivate() const {
+ return (getFlags() & FlagAccessibility) == FlagPrivate;
+ }
+ bool isProtected() const {
+ return (getFlags() & FlagAccessibility) == FlagProtected;
+ }
+ bool isPublic() const {
+ return (getFlags() & FlagAccessibility) == FlagPublic;
+ }
+ bool isForwardDecl() const { return getFlags() & FlagFwdDecl; }
+ bool isAppleBlockExtension() const { return getFlags() & FlagAppleBlock; }
+ bool isBlockByrefStruct() const { return getFlags() & FlagBlockByrefStruct; }
+ bool isVirtual() const { return getFlags() & FlagVirtual; }
+ bool isArtificial() const { return getFlags() & FlagArtificial; }
+ bool isObjectPointer() const { return getFlags() & FlagObjectPointer; }
+ bool isObjcClassComplete() const {
+ return getFlags() & FlagObjcClassComplete;
+ }
+ bool isVector() const { return getFlags() & FlagVector; }
+ bool isStaticMember() const { return getFlags() & FlagStaticMember; }
+ bool isLValueReference() const { return getFlags() & FlagLValueReference; }
+ bool isRValueReference() const { return getFlags() & FlagRValueReference; }
+
MDTypeRef getRef() const { return MDTypeRef::get(this); }
static bool classof(const Metadata *MD) {