DebugInfo: Inline DIVariable::isBlockByrefVariable() into its callers
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 14 Apr 2015 01:59:58 +0000 (01:59 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 14 Apr 2015 01:59:58 +0000 (01:59 +0000)
I don't think this API is helping much.  Change the callers to call
`MDType::isBlockByrefStruct()` directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234837 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/DebugInfo.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 462695b6c501503a62f98c41c279cb0b916f3be7..6eb37a075418e0fd7e7a284eee41335e1ad275ee 100644 (file)
@@ -643,11 +643,6 @@ public:
   /// \brief If this variable is inlined then return inline location.
   MDNode *getInlinedAt() const { return get()->getInlinedAt(); }
 
-  /// \brief Check if this is a "__block" variable (Apple Blocks).
-  bool isBlockByrefVariable(const DITypeIdentifierMap &Map) const {
-    return (getType().resolve(Map)).isBlockByrefStruct();
-  }
-
   void printExtendedName(raw_ostream &OS) const;
 };
 
index a10ceefa4f69b0b1caa68903e8aed14a8e3023fb..53cd85532aef7f72f3203cd592d730ea3256afa6 100644 (file)
@@ -135,14 +135,16 @@ template <typename T> T DbgVariable::resolve(DIRef<T> Ref) const {
 
 bool DbgVariable::isBlockByrefVariable() const {
   assert(Var && "Invalid complex DbgVariable!");
-  return Var.isBlockByrefVariable(DD->getTypeIdentifierMap());
+  return Var->getType()
+      .resolve(DD->getTypeIdentifierMap())
+      ->isBlockByrefStruct();
 }
 
 DIType DbgVariable::getType() const {
   DIType Ty = Var.getType().resolve(DD->getTypeIdentifierMap());
   // FIXME: isBlockByrefVariable should be reformulated in terms of complex
   // addresses instead.
-  if (Var.isBlockByrefVariable(DD->getTypeIdentifierMap())) {
+  if (Ty->isBlockByrefStruct()) {
     /* Byref variables, in Blocks, are declared by the programmer as
        "SomeType VarName;", but the compiler creates a
        __Block_byref_x_VarName struct, and gives the variable VarName