Construct enumerator DIE using DebugInfo.
authorDevang Patel <dpatel@apple.com>
Mon, 5 Jan 2009 18:38:38 +0000 (18:38 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 5 Jan 2009 18:38:38 +0000 (18:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61726 91177308-0d34-0410-b5e6-96231b3b80d8

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

index fac86b3e01d873cb8a5f4350bb12d0ae242ee6a7..c97cb2616f2ac4c938c2c8c94990ffa7c680716b 100644 (file)
@@ -126,7 +126,7 @@ namespace llvm {
     explicit DIEnumerator(GlobalVariable *GV = 0);
     
     std::string getName() const  { return getStringField(1); }
-    uint64_t getLanguage() const { return getUInt64Field(2); }
+    uint64_t getEnumValue() const { return getUInt64Field(2); }
   };
   
   /// DIType - This is a wrapper for a type.
index af4198222558d5254dfcf6fe221ac301e4d70e8f..3176c38141db6c9db09f52c6f1d27595cea65120 100644 (file)
@@ -1579,6 +1579,17 @@ private:
     }
   }
 
+  /// ConstructEnumTypeDIE - Construct enum type DIE from 
+  /// DIEnumerator.
+  void ConstructEnumType(CompileUnit *DW_Unit, 
+                         DIE &Buffer, DIEnumerator *ETy) {
+
+    DIE *Enumerator = new DIE(DW_TAG_enumerator);
+    AddString(Enumerator, DW_AT_name, DW_FORM_string, ETy->getName());
+    int64_t Value = ETy->getEnumValue();                             
+    AddSInt(Enumerator, DW_AT_const_value, DW_FORM_sdata, Value);
+    Buffer.AddChild(Enumerator);
+  }
 
   /// ConstructType - Adds all the required attributes to the type.
   ///