Add support to let FE mark explict methods as explict in debug info.
authorDevang Patel <dpatel@apple.com>
Fri, 1 Oct 2010 23:31:40 +0000 (23:31 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 1 Oct 2010 23:31:40 +0000 (23:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115378 91177308-0d34-0410-b5e6-96231b3b80d8

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

index d76271a99517d109d71e1bdcecdcf5c36846a1bd..4189f5d9b8459edfd00017fe6546f079c1f363cb 100644 (file)
@@ -54,7 +54,8 @@ namespace llvm {
       FlagAppleBlock       = 1 << 3,
       FlagBlockByrefStruct = 1 << 4,
       FlagVirtual          = 1 << 5,
-      FlagArtificial       = 1 << 6
+      FlagArtificial       = 1 << 6,
+      FlagExplicit         = 1 << 7
     };
   protected:
     const MDNode *DbgNode;
@@ -414,6 +415,13 @@ namespace llvm {
         return false;
       return (getUnsignedField(14) & FlagProtected) != 0;
     }
+    /// isExplicit - Return true if this subprogram is marked as explicit.
+    bool isExplicit() const    { 
+      if (getVersion() <= llvm::LLVMDebugVersion8)
+        return false;
+      return (getUnsignedField(14) & FlagExplicit) != 0;
+    }
+
     unsigned isOptimized() const;
 
     StringRef getFilename() const    { 
index e6ac0ebc2daf04794bfaabf6a8633c91ab693146..ddda18440700d36c73d6f0d9e35ba614d46a33a8 100644 (file)
@@ -1081,6 +1081,8 @@ void DwarfDebug::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
         else 
           addUInt(ElemDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_flag,
             dwarf::DW_ACCESS_public);
+        if (SP.isExplicit())
+          addUInt(ElemDie, dwarf::DW_AT_explicit, dwarf::DW_FORM_flag, 1);
       }
       else if (Element.isVariable()) {
         DIVariable DV(Element);