[llvm-commits] [LLVMbugs] [Bug 9761] New: AsmPrinter::EmitEndOfAsmFile is not the final code emission point.

Villmow, Micah Micah.Villmow at amd.com
Thu Apr 21 15:05:10 PDT 2011


I've attached a patch for this bug,  would it be possible to get a review and commit? It seems like a rather benign change.

> -----Original Message-----
> From: llvmbugs-bounces at cs.uiuc.edu [mailto:llvmbugs-
> bounces at cs.uiuc.edu] On Behalf Of bugzilla-daemon at llvm.org
> Sent: Wednesday, April 20, 2011 12:05 PM
> To: llvmbugs at cs.uiuc.edu
> Subject: [LLVMbugs] [Bug 9761] New: AsmPrinter::EmitEndOfAsmFile is not
> the final code emission point.
> 
> http://llvm.org/bugs/show_bug.cgi?id=9761
> 
>            Summary: AsmPrinter::EmitEndOfAsmFile is not the final code
>                     emission point.
>            Product: libraries
>            Version: trunk
>           Platform: PC
>         OS/Version: Linux
>             Status: NEW
>           Severity: normal
>           Priority: P
>          Component: Common Code Generator Code
>         AssignedTo: unassignedbugs at nondot.org
>         ReportedBy: micah.villmow at amd.com
>                 CC: llvmbugs at cs.uiuc.edu
> 
> 
> The comments for this function is:
> "/// EmitEndOfAsmFile - This virtual method can be overridden by
> targets that
> /// want to emit something at the end of their file."
> 
> This to me means that nothing else should be emitted after this point.
> 
> However, in doFinalization of AsmPrinter, the sequence is as follows:
>  // Allow the target to emit any magic that it wants at the end of the
> file,
>  // after everything else has gone out.
>  EmitEndOfAsmFile(M);
> 
>  delete Mang; Mang = 0;
>  MMI = 0;
> 
>  OutStreamer.Finish();
> 
> The comment above EmitEndOfAsmFile also implies that nothing else
> should be
> emitted after this location. The problem comes from the
> OutStreamer.Finish()
> function which emits the following:
> void MCAsmStreamer::Finish() {
>   // Dump out the dwarf file & directory tables and line tables.
>   if (getContext().hasDwarfFiles() && !UseLoc)
>     MCDwarfFileTable::Emit(this);
> }
> 
> The DwarfFileTable is emitted AFTER the last item that should be
> emitted into
> the file. Nothing should be emitted to the output stream after
> EmitEndOfAsmFile, otherwise there is no point in having the hook.
> 
> --
> Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.
> _______________________________________________
> LLVMbugs mailing list
> LLVMbugs at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs






More information about the llvm-commits mailing list