[llvm-commits] [llvm] r80061 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Devang Patel dpatel at apple.com
Tue Aug 25 17:39:51 PDT 2009


Author: dpatel
Date: Tue Aug 25 19:39:50 2009
New Revision: 80061

URL: http://llvm.org/viewvc/llvm-project?rev=80061&view=rev
Log:
Add isClosure() predicate. This is used to add DW_AT_APPLE_block attribute.
Patch by Caroline Tice.

Modified:
    llvm/trunk/include/llvm/Analysis/DebugInfo.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=80061&r1=80060&r2=80061&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Tue Aug 25 19:39:50 2009
@@ -173,7 +173,8 @@
     enum {
       FlagPrivate   = 1 << 0,
       FlagProtected = 1 << 1,
-      FlagFwdDecl   = 1 << 2
+      FlagFwdDecl   = 1 << 2,
+      FlagClosure   = 1 << 3
     };
 
   protected:
@@ -226,6 +227,9 @@
     bool isForwardDecl() const          {
         return (getFlags() & FlagFwdDecl) != 0; 
     }
+    bool isClosure() const          {
+        return (getFlags() & FlagClosure) != 0; 
+    }
 
     /// dump - print type.
     void dump() const;

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=80061&r1=80060&r2=80061&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Aug 25 19:39:50 2009
@@ -695,10 +695,7 @@
       Buffer.AddChild(ElemDie);
     }
 
-    // FIXME: We'd like an API to register additional attributes for the
-    // frontend to use while synthesizing, and then we'd use that api in clang
-    // instead of this.
-    if (Name == "__block_literal_generic")
+    if (CTy.isClosure())
       AddUInt(&Buffer, dwarf::DW_AT_APPLE_block, dwarf::DW_FORM_flag, 1);
 
     unsigned RLang = CTy.getRunTimeLang();





More information about the llvm-commits mailing list