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

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 20 12:05:09 PDT 2011


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.



More information about the llvm-bugs mailing list