Reorder the sections being output to reduce the number of assembler
authorEric Christopher <echristo@apple.com>
Thu, 1 Mar 2012 22:50:31 +0000 (22:50 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 1 Mar 2012 22:50:31 +0000 (22:50 +0000)
fixups that are being used to determine section offsets. Reduces
the total number of fixups by 50% for a non-trivial testcase.

Part of rdar://10413936

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151852 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/X86/stringpool.ll

index 58e40e17c52e8d02cb8e57620943eba7036b55e5..9f1aed4890241c35e70d5825b9722250b34d48ce 100644 (file)
@@ -804,6 +804,9 @@ void DwarfDebug::endModule() {
   // Compute DIE offsets and sizes.
   computeSizeAndOffsets();
 
+  // Emit info into a debug str section.
+  emitDebugStr();
+
   // Emit all the DIEs into a debug info section
   emitDebugInfo();
 
@@ -836,9 +839,6 @@ void DwarfDebug::endModule() {
   // Emit inline info.
   emitDebugInlineInfo();
 
-  // Emit info into a debug str section.
-  emitDebugStr();
-
   // clean up.
   DeleteContainerSeconds(DeadFnScopeMap);
   SPMap.clear();
index 2cd100156aada13acf0aff9b7b49190f0e95c71b..89266a5d8f954aa34b9cf01416c3513436242e70 100644 (file)
 !6 = metadata !{i32 720937, metadata !"z.c", metadata !"/home/nicholas", null} ; [ DW_TAG_file_type ]
 !7 = metadata !{i32 720932, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
 
+; Verify that "yyyy" ended up in the stringpool.
+; LINUX: .section .debug_str,"MS",@progbits,1
+; LINUX: yyyy
+; LINUX: .section .debug_info
+; DARWIN: .section __DWARF,__debug_str,regular,debug
+; DARWIN: yyyy
+; DARWIN: .section __DWARF,__debug_info
+
 ; Verify that we refer to 'yyyy' with a relocation.
 ; LINUX:      .long   .Lstring3               # DW_AT_name
 ; LINUX-NEXT: .long   39                      # DW_AT_type
 ; DARWIN-NEXT:        .byte   9                       ## DW_AT_location
 ; DARWIN-NEXT:        .byte   3
 ; DARWIN-NEXT:        .quad   _yyyy
-
-; Verify that "yyyy" ended up in the stringpool.
-; LINUX: .section .debug_str,"MS",@progbits,1
-; LINUX-NOT: .section
-; LINUX: yyyy
-; DARWIN: .section __DWARF,__debug_str,regular,debug
-; DARWIN-NOT: .section
-; DARWIN: yyyy