Page MenuHomePhabricator

[CodeGen] Keep track of decls that were deferred and have been emitted.
ClosedPublic

Authored by junaire on Jun 28 2022, 10:53 PM.

Details

Summary

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>

Diff Detail

Event Timeline

junaire created this revision.Jun 28 2022, 10:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2022, 10:53 PM
junaire requested review of this revision.Jun 28 2022, 10:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2022, 10:53 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
junaire updated this revision to Diff 441667.Jul 1 2022, 5:25 AM
  • Rebase
  • turn clang-format off in tests
v.g.vassilev added a subscriber: rjmccall.

I am adding some more reviewers as I think this patch is ready to go.

@rjmccall, could you take a look?

gentle ping~

v.g.vassilev accepted this revision.Jul 12 2022, 10:50 AM

I would propose to move forward with this patch. It was partially discussed in https://reviews.llvm.org/D126781 and we can rely on a post-commit review if necessary.

This revision is now accepted and ready to land.Jul 12 2022, 10:50 AM