[llvm-commits] [llvm] r63156 - /llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
Bill Wendling
isanbard at gmail.com
Tue Jan 27 15:47:37 PST 2009
Author: void
Date: Tue Jan 27 17:47:37 2009
New Revision: 63156
URL: http://llvm.org/viewvc/llvm-project?rev=63156&view=rev
Log:
Pull r63154 into Dib:
Add type DIE into appropriate context DIE.
Modified:
llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=63156&r1=63155&r2=63156&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 27 17:47:37 2009
@@ -1687,9 +1687,23 @@
ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getGV()));
}
- // Add debug information entry to entity and unit.
- DIE *Die = DW_Unit->AddDie(Buffer);
- SetDIEntry(Slot, Die);
+ // Add debug information entry to entity and appropriate context.
+ DIE *Die = NULL;
+ DIDescriptor Context = Ty.getContext();
+ if (!Context.isNull())
+ Die = DW_Unit->getDieMapSlotFor(Context.getGV());
+
+ if (Die) {
+ DIE *Child = new DIE(Buffer);
+ Die->AddChild(Child);
+ Buffer.Detach();
+ SetDIEntry(Slot, Child);
+ }
+ else {
+ Die = DW_Unit->AddDie(Buffer);
+ SetDIEntry(Slot, Die);
+ }
+
Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot);
}
More information about the llvm-commits
mailing list