Construct enumerator DIE using DebugInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61726 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-01-05 18:38:38 +00:00
parent dfd19ddcfa
commit c69bf2c832
2 changed files with 12 additions and 1 deletions

View 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.

View 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.
///