[PATCH] Fix GCMetadaPrinter::finishAssembly not executed

As discussed in LLVMdev [1], due to the execution order of
doFinalization functions, the GC information were deleted before
AsmPrinter::doFinalization was executed. Thus, the
GCMetadataPrinter::finishAssembly was never called.

The attached patch fixes that by moving the code of the
GCInfoDeleter::doFinalization to Printer::doFinalization. Pedro (cc'ed)
has already taken a look at this and he also thinks that it is OK.

I also tried to add a simple unit-test by using the available Ocaml
garbage collector. I 'm not very familiar with the code of that
collector so I'm not 100% sure that this suffices as a test; for
example, I only test that for the X86-64 architecture, should I add
similar tests for all architectures?

If nobody has any objections, can someone commit this for me? Because
every GC should be unusable right now! :slight_smile:

Thanks,
yiannis

[1]: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-February/059335.html

fix-gcmetadata.patch (3.22 KB)

As discussed in LLVMdev [1], due to the execution order of
doFinalization functions, the GC information were deleted before
AsmPrinter::doFinalization was executed. Thus, the
GCMetadataPrinter::finishAssembly was never called.

The attached patch fixes that by moving the code of the
GCInfoDeleter::doFinalization to Printer::doFinalization. Pedro (cc'ed)
has already taken a look at this and he also thinks that it is OK.

I also tried to add a simple unit-test by using the available Ocaml
garbage collector. I 'm not very familiar with the code of that
collector so I'm not 100% sure that this suffices as a test; for
example, I only test that for the X86-64 architecture, should I add
similar tests for all architectures?

If nobody has any objections, can someone commit this for me? Because
every GC should be unusable right now! :slight_smile:

Looks great, committed in r175528. Thanks for fixing this, the test case should make sure that it won't break as badly again.

- Ben