Skip to content

[PassManager] Drop Function.h and Module.h includes (NFC) #96892

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

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Jun 27, 2024

Replace them with forward declarations.

Replace them with forward declarations.
@nikic nikic added the skip-precommit-approval PR for CI feedback, not intended for review label Jun 27, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 27, 2024

@llvm/pr-subscribers-llvm-ir

Author: Nikita Popov (nikic)

Changes

Replace them with forward declarations.


Full diff: https://github.com/llvm/llvm-project/pull/96892.diff

1 Files Affected:

  • (modified) llvm/include/llvm/IR/PassManager.h (+3-2)
diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h
index 226eba7d8027a..d269221fac070 100644
--- a/llvm/include/llvm/IR/PassManager.h
+++ b/llvm/include/llvm/IR/PassManager.h
@@ -42,8 +42,6 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/TinyPtrVector.h"
 #include "llvm/IR/Analysis.h"
-#include "llvm/IR/Function.h"
-#include "llvm/IR/Module.h"
 #include "llvm/IR/PassManagerInternal.h"
 #include "llvm/Support/TypeName.h"
 #include <cassert>
@@ -58,6 +56,9 @@
 
 namespace llvm {
 
+class Function;
+class Module;
+
 // Forward declare the analysis manager template.
 template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager;
 

@nikic
Copy link
Contributor Author

nikic commented Jun 27, 2024

Turns out this doesn't really do anything, because the headers still get pulled in by Analysis.h, and dropping them from there is significantly more involved. Still going to merge this to clarify that this header doesn't need them.

@nikic nikic merged commit 656b8f5 into llvm:main Jun 27, 2024
8 of 9 checks passed
@nikic nikic deleted the pm-remove-includes branch June 27, 2024 12:36
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:ir skip-precommit-approval PR for CI feedback, not intended for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants