This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by junaire on Jun 14 2022, 2:53 AM.

Details

Summary

This reverts commits:
d3ddc251acae631bf5ab4da13878f7e8b5b5a451
d90eecff5c9e7e9f8263de6cd72d70322400829f

This relands below commit with asan fix:

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: Axel Naumann <Axel.Naumann@cern.ch>
Signed-off-by: Jun Zhang <jun@junz.org>

Diff Detail

Event Timeline

junaire created this revision.Jun 14 2022, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 2:53 AM
junaire requested review of this revision.Jun 14 2022, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 2:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision was not accepted when it landed; it landed in state Needs Review.Jun 14 2022, 3:37 AM
This revision was automatically updated to reflect the committed changes.