You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[clang-repl] Put CompilerInstance from IncrementalAction to use for non-assert/assert builds (#155400)
See
#137458 (comment)
Context: So the CompilerInstance CI being used with the Incremental
Action are tightly coupled in any case. Which means
the CI put to use while constructing the IncrementalAction
```
Act = TSCtx->withContextDo([&](llvm::LLVMContext *Ctx) {
return std::make_unique<IncrementalAction>(*CI, *Ctx, ErrOut, *this,
std::move(Consumer));
});
```
Is also the CI through which the we call `ExecuteAction` on `Act`
```
CI->ExecuteAction(*Act);
```
So we need to use CI as a member variable in IncrementalAction for
assert builds for
https://github.com/llvm/llvm-project/blob/bddac5eda9b7591e05ccdc86a5e86c592085f318/clang/lib/Interpreter/IncrementalAction.cpp#L97-L108
The same can be put to use for `CreateASTConsumer` too as all of these
are referring to the same CI
```
std::unique_ptr<ASTConsumer>
IncrementalAction::CreateASTConsumer(CompilerInstance & /*CI*/, StringRef InFile) {
std::unique_ptr<ASTConsumer> C =
WrapperFrontendAction::CreateASTConsumer(this->CI, InFile);
```
0 commit comments