summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-06-15 20:51:43 +0000
committerJim Laskey <jlaskey@mac.com>2006-06-15 20:51:43 +0000
commitf8a01a966120a041fe96300271573a8bf5a3e668 (patch)
treeb9470b8d3bd8be4edbffa9928f0b2016e87487e5 /lib/CodeGen
parentd5a932b92af122209bfb53fc3198698a4af18371 (diff)
downloadllvm-f8a01a966120a041fe96300271573a8bf5a3e668.tar.gz
llvm-f8a01a966120a041fe96300271573a8bf5a3e668.tar.bz2
llvm-f8a01a966120a041fe96300271573a8bf5a3e668.tar.xz
1. Support standard dwarf format (was bootstrapping in Apple format.)
2. Add vector support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28807 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/DwarfWriter.cpp16
-rw-r--r--lib/CodeGen/MachineDebugInfo.cpp2
2 files changed, 14 insertions, 4 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index 3aadd97f2a..7805bbcbbf 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -1265,7 +1265,7 @@ DIE *DwarfWriter::NewType(DIE *Context, TypeDesc *TyDesc, CompileUnit *Unit) {
// Fundamental types like int, float, bool
Slot = Ty = new DIE(DW_TAG_base_type);
unsigned Encoding = BasicTy->getEncoding();
- Ty->AddUInt (DW_AT_encoding, DW_FORM_data1, Encoding);
+ Ty->AddUInt(DW_AT_encoding, DW_FORM_data1, Encoding);
} else if (DerivedTypeDesc *DerivedTy = dyn_cast<DerivedTypeDesc>(TyDesc)) {
// Create specific DIE.
Slot = Ty = new DIE(DerivedTy->getTag());
@@ -1287,6 +1287,12 @@ DIE *DwarfWriter::NewType(DIE *Context, TypeDesc *TyDesc, CompileUnit *Unit) {
Ty->AddDIEntry(DW_AT_type, DW_FORM_ref4,
NewType(Context, FromTy, Unit));
}
+
+ // check for vector type
+ if (CompTy->isVector()) {
+ Ty->AddUInt(DW_AT_GNU_vector, DW_FORM_flag, 1);
+ }
+
// Don't emit size attribute.
Size = 0;
@@ -1419,7 +1425,8 @@ CompileUnit *DwarfWriter::NewCompileUnit(CompileUnitDesc *UnitDesc,
unsigned ID) {
// Construct debug information entry.
DIE *Die = new DIE(DW_TAG_compile_unit);
- Die->AddLabel (DW_AT_stmt_list, DW_FORM_data4, DWLabel("line", 0));
+ Die->AddDelta (DW_AT_stmt_list, DW_FORM_data4, DWLabel("line", 0),
+ DWLabel("section_line", 0));
Die->AddLabel (DW_AT_high_pc, DW_FORM_addr, DWLabel("text_end", 0));
Die->AddLabel (DW_AT_low_pc, DW_FORM_addr, DWLabel("text_begin", 0));
Die->AddString(DW_AT_producer, DW_FORM_string, UnitDesc->getProducer());
@@ -1842,7 +1849,7 @@ void DwarfWriter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
int stackGrowth =
Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
TargetFrameInfo::StackGrowsUp ?
- AddressSize : -AddressSize;
+ AddressSize : -AddressSize;
EmitULEB128Bytes(Src.getOffset() / stackGrowth);
EOL("Offset");
@@ -1875,7 +1882,8 @@ void DwarfWriter::EmitDebugInfo() const {
EmitInt32(ContentSize); EOL("Length of Compilation Unit Info");
EmitInt16(DWARF_VERSION); EOL("DWARF version number");
- EmitReference("abbrev_begin", 0); EOL("Offset Into Abbrev. Section");
+ EmitDifference("abbrev_begin", 0, "section_abbrev", 0);
+ EOL("Offset Into Abbrev. Section");
EmitInt8(AddressSize); EOL("Address Size (in bytes)");
EmitDIE(Die);
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp
index fcdf30d9c9..a3013e9608 100644
--- a/lib/CodeGen/MachineDebugInfo.cpp
+++ b/lib/CodeGen/MachineDebugInfo.cpp
@@ -817,6 +817,7 @@ void DerivedTypeDesc::dump() {
CompositeTypeDesc::CompositeTypeDesc(unsigned T)
: DerivedTypeDesc(T)
+, IsVector(false)
, Elements()
{}
@@ -839,6 +840,7 @@ bool CompositeTypeDesc::classof(const DebugInfoDesc *D) {
void CompositeTypeDesc::ApplyToFields(DIVisitor *Visitor) {
DerivedTypeDesc::ApplyToFields(Visitor);
+ Visitor->Apply(IsVector);
Visitor->Apply(Elements);
}