This patch adds a new field called EmittedDeferredDecls in CodeGenModule
that keeps track of decls that were deferred and have been emitted.
The intention of this patch is to solve issues in the incremental c++,
we'll lose info of decls that are lazily emitted when we undo their
usage.
See example below:
clang-repl> inline int foo() { return 42;}
clang-repl> int bar = foo();
clang-repl> %undo
clang-repl> int baz = foo();
JIT session error: Symbols not found: [ _Z3foov ]
error: Failed to materialize symbols: { (main, { baz, $.incr_module_2.inits.0,
orc_init_func.incr_module_2 }) }
Signed-off-by: Jun Zhang <jun@junz.org>