Add flag to mark structs for Apple Block "byref" variables; also add code to
modify the type and location debug information for these variables to match the
programmer's expectations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80625 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h
index b8a6ce3..314873a 100644
--- a/include/llvm/Analysis/DebugInfo.h
+++ b/include/llvm/Analysis/DebugInfo.h
@@ -191,7 +191,8 @@
       FlagPrivate    = 1 << 0,
       FlagProtected  = 1 << 1,
       FlagFwdDecl    = 1 << 2,
-      FlagAppleBlock = 1 << 3
+      FlagAppleBlock = 1 << 3,
+      FlagBlockByrefStruct = 1 << 4
     };
 
   protected:
@@ -235,6 +236,9 @@
     bool isAppleBlockExtension() const {
       return (getFlags() & FlagAppleBlock) != 0; 
     }
+    bool isBlockByrefStruct() const {
+      return (getFlags() & FlagBlockByrefStruct) != 0;
+    }
 
     /// dump - print type.
     void dump() const;
@@ -401,6 +405,12 @@
     /// Verify - Verify that a variable descriptor is well formed.
     bool Verify() const;
 
+    /// isBlockByrefVariable - Return true if the variable was declared as
+    /// a "__block" variable (Apple Blocks).
+    bool isBlockByrefVariable() const { 
+      return getType().isBlockByrefStruct(); 
+    }
+
     /// dump - print variable.
     void dump() const;
   };