Make a new X8632_MachoTargetObjectFile TLOF implementation whose
authorChris Lattner <sabre@nondot.org>
Fri, 18 Sep 2009 20:22:52 +0000 (20:22 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 18 Sep 2009 20:22:52 +0000 (20:22 +0000)
commit228252f98157132488a8e2616d9c95a28c167c5c
tree6f169a01303b459be5516de802d237ba72abaf2e
parentbd23d5fda85e38c88dfa668a99777cd05c524822
Make a new X8632_MachoTargetObjectFile TLOF implementation whose
getSymbolForDwarfGlobalReference is smart enough to know that it
needs to register the stub it references with MachineModuleInfoMachO,
so that it gets emitted at the end of the file.

Move stub emission from X86ATTAsmPrinter::doFinalization to the
new X86ATTAsmPrinter::EmitEndOfAsmFile asmprinter hook.  The important
thing here is that EmitEndOfAsmFile is called *after* the ehframes are
emitted, so we get all the stubs.

This allows us to remove a gross hack from the asmprinter where it would
"just know" that it needed to output stubs for personality functions.
Now this is all driven from a consistent interface.

The testcase change is just reordering the expected output now that the
stubs come out after the ehframe instead of before.

This also unblocks other changes that Bill wants to make.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82269 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86TargetObjectFile.cpp
lib/Target/X86/X86TargetObjectFile.h
test/CodeGen/X86/personality.ll