mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Added basic support for typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -430,6 +430,7 @@ DebugInfoDesc *DebugInfoDesc::DescFactory(unsigned Tag) {
|
||||
case DI_TAG_global_variable: return new GlobalVariableDesc();
|
||||
case DI_TAG_subprogram: return new SubprogramDesc();
|
||||
case DI_TAG_basictype: return new BasicTypeDesc();
|
||||
case DI_TAG_typedef: return new TypedefDesc();
|
||||
default: break;
|
||||
}
|
||||
return NULL;
|
||||
@ -561,8 +562,6 @@ void CompileUnitDesc::dump() {
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
TypeDesc::TypeDesc(unsigned T)
|
||||
: DebugInfoDesc(T)
|
||||
, Context(NULL)
|
||||
@ -627,6 +626,37 @@ void BasicTypeDesc::dump() {
|
||||
<< "Encoding(" << Encoding << ")\n";
|
||||
}
|
||||
#endif
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
TypedefDesc::TypedefDesc()
|
||||
: TypeDesc(DI_TAG_typedef)
|
||||
, FromType(NULL)
|
||||
, File(NULL)
|
||||
, Line(0)
|
||||
{}
|
||||
|
||||
/// ApplyToFields - Target the visitor to the fields of the TypedefDesc.
|
||||
///
|
||||
void TypedefDesc::ApplyToFields(DIVisitor *Visitor) {
|
||||
TypeDesc::ApplyToFields(Visitor);
|
||||
|
||||
Visitor->Apply((DebugInfoDesc *&)FromType);
|
||||
Visitor->Apply((DebugInfoDesc *&)File);
|
||||
Visitor->Apply(Line);
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
void TypedefDesc::dump() {
|
||||
std::cerr << getDescString() << " "
|
||||
<< "Tag(" << getTag() << "), "
|
||||
<< "Context(" << getContext() << "), "
|
||||
<< "Name(\"" << getName() << "\"), "
|
||||
<< "Size(" << getSize() << "), "
|
||||
<< "FromType(" << FromType << "), "
|
||||
<< "File(" << File << "), "
|
||||
<< "Line(" << Line << ")\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
Reference in New Issue
Block a user