aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineDebugInfo.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-02-24 16:46:40 +0000
committerJim Laskey <jlaskey@mac.com>2006-02-24 16:46:40 +0000
commit6990600f93c212bd73623d523eb8f53ae0b6eee5 (patch)
tree260d82f54c0f8bcb48647e6b521d7fb74663e01b /lib/CodeGen/MachineDebugInfo.cpp
parent7e88103cdea8c36b2229dae8c60def14e3816512 (diff)
Add pointer and reference types. Added short-term code to ignore NULL types
(to allow llvm-gcc4 to build.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineDebugInfo.cpp')
-rw-r--r--lib/CodeGen/MachineDebugInfo.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp
index 1652881268..72da0a0406 100644
--- a/lib/CodeGen/MachineDebugInfo.cpp
+++ b/lib/CodeGen/MachineDebugInfo.cpp
@@ -430,7 +430,9 @@ 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();
+ case DI_TAG_typedef: return new DerivedTypeDesc(DI_TAG_typedef);
+ case DI_TAG_pointer: return new DerivedTypeDesc(DI_TAG_pointer);
+ case DI_TAG_reference: return new DerivedTypeDesc(DI_TAG_reference);
default: break;
}
return NULL;
@@ -566,16 +568,19 @@ TypeDesc::TypeDesc(unsigned T)
: DebugInfoDesc(T)
, Context(NULL)
, Name("")
+, File(NULL)
, Size(0)
{}
-/// ApplyToFields - Target the visitor to the fields of the TypeDesc.
+/// ApplyToFields - Target the visitor to the fields of the TypeDesc.
///
void TypeDesc::ApplyToFields(DIVisitor *Visitor) {
DebugInfoDesc::ApplyToFields(Visitor);
Visitor->Apply(Context);
Visitor->Apply(Name);
+ Visitor->Apply((DebugInfoDesc *&)File);
+ Visitor->Apply(Line);
Visitor->Apply(Size);
}
@@ -597,6 +602,8 @@ void TypeDesc::dump() {
<< "Tag(" << getTag() << "), "
<< "Context(" << Context << "), "
<< "Name(\"" << Name << "\"), "
+ << "File(" << File << "), "
+ << "Line(" << Line << "), "
<< "Size(" << Size << ")\n";
}
#endif
@@ -608,7 +615,7 @@ BasicTypeDesc::BasicTypeDesc()
, Encoding(0)
{}
-/// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc.
+/// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc.
///
void BasicTypeDesc::ApplyToFields(DIVisitor *Visitor) {
TypeDesc::ApplyToFields(Visitor);
@@ -628,33 +635,32 @@ void BasicTypeDesc::dump() {
#endif
//===----------------------------------------------------------------------===//
-TypedefDesc::TypedefDesc()
-: TypeDesc(DI_TAG_typedef)
+DerivedTypeDesc::DerivedTypeDesc(unsigned T)
+: TypeDesc(T)
, FromType(NULL)
-, File(NULL)
-, Line(0)
-{}
+{
+ assert((T == DI_TAG_typedef || T == DI_TAG_pointer || T == DI_TAG_reference)&&
+ "Unknown derived type.");
+}
-/// ApplyToFields - Target the visitor to the fields of the TypedefDesc.
+/// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc.
///
-void TypedefDesc::ApplyToFields(DIVisitor *Visitor) {
+void DerivedTypeDesc::ApplyToFields(DIVisitor *Visitor) {
TypeDesc::ApplyToFields(Visitor);
Visitor->Apply((DebugInfoDesc *&)FromType);
- Visitor->Apply((DebugInfoDesc *&)File);
- Visitor->Apply(Line);
}
#ifndef NDEBUG
-void TypedefDesc::dump() {
+void DerivedTypeDesc::dump() {
std::cerr << getDescString() << " "
<< "Tag(" << getTag() << "), "
<< "Context(" << getContext() << "), "
<< "Name(\"" << getName() << "\"), "
<< "Size(" << getSize() << "), "
- << "FromType(" << FromType << "), "
- << "File(" << File << "), "
- << "Line(" << Line << ")\n";
+ << "File(" << getFile() << "), "
+ << "Line(" << getLine() << "), "
+ << "FromType(" << FromType << ")\n";
}
#endif