This is an archive of the discontinued LLVM Phabricator instance.

AsmPrinter: Emit debug information sections lasst
AbandonedPublic

Authored by MatzeB on Feb 1 2017, 11:18 AM.

Details

Summary

Attaching debug information should ideally not change the rest of the
binary. This works best when the debug information sections come last in
the file. See also the discussion in https://reviews.llvm.org/D29315 or
r197922 or rdar://15623193

This means that we should output the debug information after calling the
targets EmitEndOfAsmFile.

@rafael: Could you please look at the changes to test/DebugInfo/X86/arange-and-stub.ll. This patch moves ".section .data.DW.ref.foo,"aGw",@progbits,DW.ref.foo,comdat" from the end of the file to before the debug info which "CHECK: .data" catches unitentionally I think.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB created this revision.Feb 1 2017, 11:18 AM
aprantl added inline comments.Feb 1 2017, 11:27 AM
include/llvm/CodeGen/AsmPrinter.h
129

Is this supposed to mean "(The) Handler's" or "Handles", or can I just not parse that sentence? ;-)

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
257

enum or /*EmitLate=*/ ?

MatzeB added inline comments.Feb 1 2017, 11:30 AM
include/llvm/CodeGen/AsmPrinter.h
129

Yep I meant "The Handler's" and tried hard to stay within 80 columns, looks like I need a line break after all :)

echristo added inline comments.Feb 2 2017, 12:29 PM
include/llvm/CodeGen/AsmPrinter.h
129

Let's try to avoid booleans here and define an enum of "when to emit" at least?

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
1204

This loop makes it feel like we should actually be checking EH for "emit early" rather than everything else for emit late...

1285

Unconvinced that this should go after EmitEndOfAsmFile... what's the rationale here?

1292

Comment as to why this isn't next to the endModule above.

echristo requested changes to this revision.Mar 16 2017, 4:30 PM
This revision now requires changes to proceed.Mar 16 2017, 4:30 PM
espindola edited reviewers, added: espindola; removed: rafael.Mar 14 2018, 4:57 PM
MatzeB abandoned this revision.Sep 10 2021, 10:10 AM