-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[clang] Rename ReadPCHAndPreprocessAction (NFC) #122390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[clang] Rename ReadPCHAndPreprocessAction (NFC) #122390
Conversation
Created using spr 1.3.5
@llvm/pr-subscribers-clang Author: Steven Wu (cachemeifyoucan) ChangesRename Full diff: https://github.com/llvm/llvm-project/pull/122390.diff 3 Files Affected:
diff --git a/clang/include/clang/Frontend/FrontendActions.h b/clang/include/clang/Frontend/FrontendActions.h
index a620ddfc40447d..f16c68344479e4 100644
--- a/clang/include/clang/Frontend/FrontendActions.h
+++ b/clang/include/clang/Frontend/FrontendActions.h
@@ -32,8 +32,8 @@ class InitOnlyAction : public FrontendAction {
bool usesPreprocessorOnly() const override { return false; }
};
-/// Preprocessor-based frontend action that also loads PCH files.
-class ReadPCHAndPreprocessAction : public FrontendAction {
+/// Preprocessor-based frontend action that is used for dependency scanning.
+class DependencyScanningFrontendAction : public FrontendAction {
void ExecuteAction() override;
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 30dfa5481d070a..f2a9602bdcafaf 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -69,7 +69,7 @@ void InitOnlyAction::ExecuteAction() {
}
// Basically PreprocessOnlyAction::ExecuteAction.
-void ReadPCHAndPreprocessAction::ExecuteAction() {
+void DependencyScanningFrontendAction::ExecuteAction() {
Preprocessor &PP = getCompilerInstance().getPreprocessor();
// Ignore unknown pragmas.
@@ -84,7 +84,7 @@ void ReadPCHAndPreprocessAction::ExecuteAction() {
}
std::unique_ptr<ASTConsumer>
-ReadPCHAndPreprocessAction::CreateASTConsumer(CompilerInstance &CI,
+DependencyScanningFrontendAction::CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) {
return std::make_unique<ASTConsumer>();
}
diff --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
index 5a648df05e4fd3..6db5a1cb41da1f 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -439,7 +439,7 @@ class DependencyScanningAction : public tooling::ToolAction {
else if (ModuleName)
Action = std::make_unique<GetDependenciesByModuleNameAction>(*ModuleName);
else
- Action = std::make_unique<ReadPCHAndPreprocessAction>();
+ Action = std::make_unique<DependencyScanningFrontendAction>();
if (ScanInstance.getDiagnostics().hasErrorOccurred())
return false;
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
Created using spr 1.3.5
I agree that the name can be confusing. I think the original motivation for this name was to avoid spreading the concept of modular dependency scanning through the Clang codebase. Could we move this class into |
Rename
ReadPCHAndPreprocessAction
class. This frontend action is usedfor dependency scanning only and the current name is confusing for what
it actually does. Rename the class to
DependencyScanningFrontendAction
to be clear for its usage.