CodeGen and cleaning up initializers

Hi,

For our interpreter cling we do "incremental codegen": as C++ code lines
(aka top level decls) come by we CodeGen them. But of course we cannot
re-run initializers.

Attached patch would allow us to simply remove the initializer function
from the module and have it (and all C++ initializers) rebuilt
incrementally. I would expect the cost for regular use cases to be close
to zero.

If you can come up with a better (faster / less intrusive) way of doing
things please let me know! Otherwise I'd like to commit it.

Cheers, Axel.

CodeGen_clear_global_emits.diff (505 Bytes)

This looks fine to me. Patches should typically go to cfe-commits, though.

  - Doug