mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Support for enumerations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26466 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -516,6 +516,7 @@ DebugInfoDesc *DebugInfoDesc::DescFactory(unsigned Tag) {
|
||||
case DW_TAG_union_type:
|
||||
case DW_TAG_enumeration_type: return new CompositeTypeDesc(Tag);
|
||||
case DW_TAG_subrange_type: return new SubrangeDesc();
|
||||
case DW_TAG_enumerator: return new EnumeratorDesc();
|
||||
default: break;
|
||||
}
|
||||
return NULL;
|
||||
@@ -909,6 +910,49 @@ void SubrangeDesc::dump() {
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
EnumeratorDesc::EnumeratorDesc()
|
||||
: DebugInfoDesc(DW_TAG_enumerator)
|
||||
, Name("")
|
||||
, Value(0)
|
||||
{}
|
||||
|
||||
// Implement isa/cast/dyncast.
|
||||
bool EnumeratorDesc::classof(const DebugInfoDesc *D) {
|
||||
return D->getTag() == DW_TAG_enumerator;
|
||||
}
|
||||
|
||||
/// ApplyToFields - Target the visitor to the fields of the EnumeratorDesc.
|
||||
///
|
||||
void EnumeratorDesc::ApplyToFields(DIVisitor *Visitor) {
|
||||
DebugInfoDesc::ApplyToFields(Visitor);
|
||||
|
||||
Visitor->Apply(Name);
|
||||
Visitor->Apply(Value);
|
||||
}
|
||||
|
||||
/// getDescString - Return a string used to compose global names and labels.
|
||||
///
|
||||
const char *EnumeratorDesc::getDescString() const {
|
||||
return "llvm.dbg.enumerator";
|
||||
}
|
||||
|
||||
/// getTypeString - Return a string used to label this descriptor's type.
|
||||
///
|
||||
const char *EnumeratorDesc::getTypeString() const {
|
||||
return "llvm.dbg.enumerator.type";
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
void EnumeratorDesc::dump() {
|
||||
std::cerr << getDescString() << " "
|
||||
<< "Tag(" << getTag() << "), "
|
||||
<< "Name(" << Name << "), "
|
||||
<< "Value(" << Value << ")\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
GlobalDesc::GlobalDesc(unsigned T)
|
||||
: AnchoredDesc(T)
|
||||
, Context(0)
|
||||
|
||||
Reference in New Issue
Block a user