[llvm] r234275 - DebugInfo: Move DIType::is*() queries to MDType

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Apr 6 18:24:30 PDT 2015


Author: dexonsmith
Date: Mon Apr  6 20:24:30 2015
New Revision: 234275

URL: http://llvm.org/viewvc/llvm-project?rev=234275&view=rev
Log:
DebugInfo: Move DIType::is*() queries to MDType

Move body of `DIType::isObjectPointer()` (etc.) to `MDType`, and change
the versions in `DIType` to forward there.

Modified:
    llvm/trunk/include/llvm/IR/DebugInfo.h
    llvm/trunk/include/llvm/IR/DebugInfoMetadata.h

Modified: llvm/trunk/include/llvm/IR/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=234275&r1=234274&r2=234275&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfo.h Mon Apr  6 20:24:30 2015
@@ -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); }
 };
 

Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=234275&r1=234274&r2=234275&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Mon Apr  6 20:24:30 2015
@@ -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) {





More information about the llvm-commits mailing list