diff options
| author | Devang Patel <dpatel@apple.com> | 2009-01-05 18:38:38 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-01-05 18:38:38 +0000 |
| commit | c0adc6b9bc6d45005458adaa18040574614ab37d (patch) | |
| tree | b7f8245a94e3c389db6fcb4ba87433157d064ca6 /llvm | |
| parent | 2ed06b4276d001e3b2d80c0524a9c069852e3232 (diff) | |
| download | bcm5719-llvm-c0adc6b9bc6d45005458adaa18040574614ab37d.tar.gz bcm5719-llvm-c0adc6b9bc6d45005458adaa18040574614ab37d.zip | |
Construct enumerator DIE using DebugInfo.
llvm-svn: 61726
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Analysis/DebugInfo.h | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/llvm/include/llvm/Analysis/DebugInfo.h b/llvm/include/llvm/Analysis/DebugInfo.h index fac86b3e01d..c97cb2616f2 100644 --- a/llvm/include/llvm/Analysis/DebugInfo.h +++ b/llvm/include/llvm/Analysis/DebugInfo.h @@ -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. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index af419822255..3176c38141d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -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. /// |

