Unverified Commit cd64a427 authored by Jun Zhang's avatar Jun Zhang
Browse files

Reland "[CodeGen] Keep track info of lazy-emitted symbols in ModuleBuilder"

This reverts commits:
d3ddc251
d90eecff

It turned out there're some options turned on that leaks the memory
intentionally, which fires the asan builds after the patch being
applied. The issue has been fixed in
7bc00ce5

, so reland it.

Below is the original commit message:

The intent of this patch is to selectively carry some states over to
the Builder so we won't lose the information of the previous symbols.

This used to be several downstream patches of Cling, it aims to fix
errors in Clang Interpreter when trying to use inline functions.
Before this patch:

clang-repl> inline int foo() { return 42;}
clang-repl> int x = foo();

JIT session error: Symbols not found: [ _Z3foov ]
error: Failed to materialize symbols:
{ (main, { x, $.incr_module_1.__inits.0, __orc_init_func.incr_module_1 }) }

Co-authored-by: default avatarAxel Naumann <Axel.Naumann@cern.ch>
Signed-off-by: default avatarJun Zhang <jun@junz.org>
parent 3ea14223
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment