[llvm-commits] [llvm] r119777 - in /llvm/trunk: include/llvm/MC/MCDwarf.h include/llvm/MC/MCStreamer.h include/llvm/Target/TargetMachine.h lib/CodeGen/LLVMTargetMachine.cpp lib/MC/MCAsmStreamer.cpp lib/MC/MCDwarf.cpp lib/MC/MCELFStreamer.cpp lib/

Devang Patel dpatel at apple.com
Wed Dec 1 07:45:27 PST 2010


On Dec 1, 2010, at 7:21 AM, Rafael EspĂ­ndola wrote:

>> It does not help when .loc is not used, say darwin9 :)
> 
> on llvm-gcc. Would it help if I added a debug option to llvm-gcc to use it?

I just added llc option to disable use of .loc. However, if it helps debugging feel free to add llvm-gcc debug option.

> 
> So, given the hypothetical -fdwarf2-cfi-asm to llvm-gcc, the bug you
> have is that
> 
> llvm-gcc -S -fdwarf2-cfi-asm t.c -o t.s && llvm-mc -filetype=obj t.s -o t-mc.o

The linker is not able to handle t.o assembled by system assembler using t.s. In other case, dwarfdump flagged an error.

> produces different output from
> 
> llvm-gcc -S t.c -o t.s && llvm-mc -filetype=obj t.s -o t-test.o
> 
> Correct? In general the output will be different, but for a case
> without pointer updates I don't see why it should be. If that is
> really the bug, I can take a look. Would you mind adding something to
> bugzilla?

PR 8715.

Initially I thought following MCDwarf.cpp patch will help but it is not letting me complete llvm-gcc bootstrap. So I'd appreciate if you can take a look.

@@ -339,6 +342,22 @@
     delete Line;
   }
 
+  if (MCLineSectionOrder.begin() == MCLineSectionOrder.end()) {
+    // Complete section if line table entry is empty.
+    // Create a symbol at the end of the section.
+    MCSymbol *SectionEnd = MCOS->getContext().CreateTempSymbol();
+    // Set the value of the symbol, as we are at the end of the section.
+    MCOS->EmitLabel(SectionEnd);
+
+    // Switch back the the dwarf line section.
+    MCOS->SwitchSection(DwarfLineSection);
+
+    // emit the sequence to set the address
+    EmitDwarfSetAddress(MCOS, SectionEnd, PointerSize);
+    // emit the sequence for the LineDelta (from 1) and a zero address delta.
+    MCDwarfLineAddr::Emit(MCOS, INT64_MAX, 0);
+  }
+
   // This is the end of the section, so set the value of the symbol at the end
   // of this section (that was used in a previous expression).
   MCOS->EmitLabel(LineEndSym);

Thanks!
-
Devang





More information about the llvm-commits mailing list