-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch refactors the C++ compilation actions in `CcCompilationHelper`. It introduces a helper method `createSourceActionHelper` to streamline the creation of source actions and reduces duplicated code related to PIC and non-PIC compilation. ## Changes 1. **Refactored Source Action Creation**: - Introduced `createSourceActionHelper` to handle the common logic for creating compile actions. - This method consolidates the setup and finalization of compile actions for both PIC and non-PIC variants. - The helper method now handles setting up variables, creating temp actions, and registering the compile actions. 2. **Updated `createSourceAction` Method**: - The `createSourceAction` method now calls `createSourceActionHelper` for both PIC and non-PIC compile actions. - This change simplifies the `createSourceAction` method and removes redundancy. ## Background I'm working on support C++20 Modules in Bazel, see #19940 While constructing the action graph for compiling C++20 Modules, I noticed that the `createSourceAction` code could be reused. Therefore, I refactored `createSourceAction`. One potentially unusual aspect is the handling of `ArtifactCategory.CPP_MODULE` at the end. Since the logic for handling C++20 Modules differs from that of Clang Modules, this part of the logic was placed outside of `createSourceActionHelper`. the code of constructing the action graph for compiling C++20 Modules is #22553 Closes #22744. PiperOrigin-RevId: 719290267 Change-Id: I62cd8826261866ce3bd4225c099a479288a449aa
- Loading branch information
1 parent
7416b71
commit eb42f91
Showing
1 changed file
with
112 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters