[llvm-branch-commits] [llvm] c80e193 - [NFC] Inline maxDevirtIterationsReached()

Arthur Eubanks via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 10 22:17:42 PST 2020


Author: Arthur Eubanks
Date: 2020-12-10T22:12:29-08:00
New Revision: c80e1935876424f9025238750a073092c24cbd44

URL: https://github.com/llvm/llvm-project/commit/c80e1935876424f9025238750a073092c24cbd44
DIFF: https://github.com/llvm/llvm-project/commit/c80e1935876424f9025238750a073092c24cbd44.diff

LOG: [NFC] Inline maxDevirtIterationsReached()

This was separated in the past because the cl::opt was in the .cpp file
but DevirtSCCRepeatedPass::run() was in the .h file. Now that
DevirtSCCRepeatedPass::run() is in the .cpp file, get rid of the tiny
maxDevirtIterationsReached(), it's bad for readability.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/CGSCCPassManager.h
    llvm/lib/Analysis/CGSCCPassManager.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h
index 99ad0f2dc938..985424a74054 100644
--- a/llvm/include/llvm/Analysis/CGSCCPassManager.h
+++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h
@@ -499,10 +499,6 @@ createCGSCCToFunctionPassAdaptor(FunctionPassT Pass) {
       std::make_unique<PassModelT>(std::move(Pass)));
 }
 
-/// Checks -abort-on-max-devirt-iterations-reached to see if we should report an
-/// error.
-void maxDevirtIterationsReached();
-
 /// A helper that repeats an SCC pass each time an indirect call is refined to
 /// a direct call by that pass.
 ///

diff  --git a/llvm/lib/Analysis/CGSCCPassManager.cpp b/llvm/lib/Analysis/CGSCCPassManager.cpp
index fae78273fb96..59df6059dcf6 100644
--- a/llvm/lib/Analysis/CGSCCPassManager.cpp
+++ b/llvm/lib/Analysis/CGSCCPassManager.cpp
@@ -489,7 +489,8 @@ PreservedAnalyses DevirtSCCRepeatedPass::run(LazyCallGraph::SCC &InitialC,
 
     // Otherwise, if we've already hit our max, we're done.
     if (Iteration >= MaxIterations) {
-      maxDevirtIterationsReached();
+      if (AbortOnMaxDevirtIterationsReached)
+        report_fatal_error("Max devirtualization iterations reached");
       LLVM_DEBUG(
           dbgs() << "Found another devirtualization after hitting the max "
                     "number of repetitions ("
@@ -815,11 +816,6 @@ static void updateNewSCCFunctionAnalyses(LazyCallGraph::SCC &C,
   }
 }
 
-void llvm::maxDevirtIterationsReached() {
-  if (AbortOnMaxDevirtIterationsReached)
-    report_fatal_error("Max devirtualization iterations reached");
-}
-
 /// Helper function to update both the \c CGSCCAnalysisManager \p AM and the \c
 /// CGSCCPassManager's \c CGSCCUpdateResult \p UR based on a range of newly
 /// added SCCs.


        


More information about the llvm-branch-commits mailing list