diff options
author | Devang Patel <dpatel@apple.com> | 2009-08-26 00:39:50 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-08-26 00:39:50 +0000 |
commit | 8af76bdb7450b097efa17f7c192882111a9e8f10 (patch) | |
tree | eaabc543802e715a02a68e6321661b01e4e700cf | |
parent | ad7c3d55932f949e6bd428232999088a53f54a4f (diff) | |
download | llvm-8af76bdb7450b097efa17f7c192882111a9e8f10.tar.gz llvm-8af76bdb7450b097efa17f7c192882111a9e8f10.tar.bz2 llvm-8af76bdb7450b097efa17f7c192882111a9e8f10.tar.xz |
Add isClosure() predicate. This is used to add DW_AT_APPLE_block attribute.
Patch by Caroline Tice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80061 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 6 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index 4f86f50aec..aabddb01a5 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -173,7 +173,8 @@ namespace llvm { enum { FlagPrivate = 1 << 0, FlagProtected = 1 << 1, - FlagFwdDecl = 1 << 2 + FlagFwdDecl = 1 << 2, + FlagClosure = 1 << 3 }; protected: @@ -226,6 +227,9 @@ namespace llvm { bool isForwardDecl() const { return (getFlags() & FlagFwdDecl) != 0; } + bool isClosure() const { + return (getFlags() & FlagClosure) != 0; + } /// dump - print type. void dump() const; diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 067db8b848..e053597ab1 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -695,10 +695,7 @@ void DwarfDebug::ConstructTypeDIE(CompileUnit *DW_Unit, DIE &Buffer, 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(); |