[all-commits] [llvm/llvm-project] 75b36d: [clang-repl] Put CompilerInstance from Incremental...

Anutosh Bhat via All-commits all-commits at lists.llvm.org
Wed Aug 27 03:00:44 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 75b36d043e9992ec7c52c7d17f989c09a76011c7
      https://github.com/llvm/llvm-project/commit/75b36d043e9992ec7c52c7d17f989c09a76011c7
  Author: Anutosh Bhat <andersonbhat491 at gmail.com>
  Date:   2025-08-27 (Wed, 27 Aug 2025)

  Changed paths:
    M clang/lib/Interpreter/IncrementalAction.cpp
    M clang/lib/Interpreter/IncrementalAction.h

  Log Message:
  -----------
  [clang-repl] Put CompilerInstance from IncrementalAction to use for non-assert/assert builds (#155400)

See
https://github.com/llvm/llvm-project/pull/137458#discussion_r2300649286

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);
      
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list