Skip to content

Conversation

@jurahul
Copy link
Contributor

@jurahul jurahul commented Oct 14, 2025

Remove iterativelyFlattenCFG out of anonymous namespace and mark it static.

Remove `iterativelyFlattenCFG` out of anonymous namespace and mark
it static.
@jurahul jurahul marked this pull request as ready for review October 14, 2025 03:14
@llvmbot
Copy link
Member

llvmbot commented Oct 14, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Rahul Joshi (jurahul)

Changes

Remove iterativelyFlattenCFG out of anonymous namespace and mark it static.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp (+2-2)
diff --git a/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp b/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
index 213d0f389c2e4..1335665e114dd 100644
--- a/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
@@ -39,10 +39,11 @@ struct FlattenCFGLegacyPass : public FunctionPass {
 private:
   AliasAnalysis *AA;
 };
+} // namespace
 
 /// iterativelyFlattenCFG - Call FlattenCFG on all the blocks in the function,
 /// iterating until no more changes are made.
-bool iterativelyFlattenCFG(Function &F, AliasAnalysis *AA) {
+static bool iterativelyFlattenCFG(Function &F, AliasAnalysis *AA) {
   bool Changed = false;
   bool LocalChange = true;
 
@@ -67,7 +68,6 @@ bool iterativelyFlattenCFG(Function &F, AliasAnalysis *AA) {
   }
   return Changed;
 }
-} // namespace
 
 char FlattenCFGLegacyPass::ID = 0;
 

Copy link
Contributor

@kazutakahirata kazutakahirata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@jurahul jurahul merged commit f973d77 into llvm:main Oct 14, 2025
14 checks passed
@jurahul jurahul deleted the nfc_ns_cleanup_flattencfg branch October 14, 2025 14:57
akadutta pushed a commit to akadutta/llvm-project that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants