[llvm] r329170 - Make helpers static. NFC.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 04:45:11 PDT 2018


Author: d0k
Date: Wed Apr  4 04:45:11 2018
New Revision: 329170

URL: http://llvm.org/viewvc/llvm-project?rev=329170&view=rev
Log:
Make helpers static. NFC.

Modified:
    llvm/trunk/lib/Analysis/MustExecute.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp
    llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp

Modified: llvm/trunk/lib/Analysis/MustExecute.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MustExecute.cpp?rev=329170&r1=329169&r2=329170&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MustExecute.cpp (original)
+++ llvm/trunk/lib/Analysis/MustExecute.cpp Wed Apr  4 04:45:11 2018
@@ -184,7 +184,7 @@ FunctionPass *llvm::createMustExecutePri
   return new MustExecutePrinter();
 }
 
-bool isMustExecuteIn(const Instruction &I, Loop *L, DominatorTree *DT) {
+static bool isMustExecuteIn(const Instruction &I, Loop *L, DominatorTree *DT) {
   // TODO: merge these two routines.  For the moment, we display the best
   // result obtained by *either* implementation.  This is a bit unfair since no
   // caller actually gets the full power at the moment.
@@ -194,6 +194,7 @@ bool isMustExecuteIn(const Instruction &
     isGuaranteedToExecuteForEveryIteration(&I, L);
 }
 
+namespace {
 /// \brief An assembly annotator class to print must execute information in
 /// comments.
 class MustExecuteAnnotatedWriter : public AssemblyAnnotationWriter {
@@ -248,6 +249,7 @@ public:
     OS << ")";
   }
 };
+} // namespace
 
 bool MustExecutePrinter::runOnFunction(Function &F) {
   auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=329170&r1=329169&r2=329170&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Apr  4 04:45:11 2018
@@ -7934,9 +7934,9 @@ static SDValue materializeVectorConstant
 /// Look for opportunities to create a VPERMV/VPERMILPV/PSHUFB variable permute
 /// from a vector of source values and a vector of extraction indices.
 /// The vectors might be manipulated to match the type of the permute op.
-SDValue createVariablePermute(MVT VT, SDValue SrcVec, SDValue IndicesVec,
-                              SDLoc &DL, SelectionDAG &DAG,
-                              const X86Subtarget &Subtarget) {
+static SDValue createVariablePermute(MVT VT, SDValue SrcVec, SDValue IndicesVec,
+                                     SDLoc &DL, SelectionDAG &DAG,
+                                     const X86Subtarget &Subtarget) {
   MVT ShuffleVT = VT;
   EVT IndicesVT = EVT(VT).changeVectorElementTypeToInteger();
   unsigned NumElts = VT.getVectorNumElements();

Modified: llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp?rev=329170&r1=329169&r2=329170&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp (original)
+++ llvm/trunk/lib/Transforms/Coroutines/CoroFrame.cpp Wed Apr  4 04:45:11 2018
@@ -309,6 +309,7 @@ static void dump(StringRef Title, SpillI
 }
 #endif
 
+namespace {
 // We cannot rely solely on natural alignment of a type when building a
 // coroutine frame and if the alignment specified on the Alloca instruction
 // differs from the natural alignment of the alloca type we will need to insert
@@ -357,6 +358,7 @@ struct PaddingCalculator {
     return nullptr;
   }
 };
+} // namespace
 
 // Build a struct that will keep state for an active coroutine.
 //   struct f.frame {

Modified: llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp?rev=329170&r1=329169&r2=329170&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp Wed Apr  4 04:45:11 2018
@@ -450,7 +450,8 @@ getGUID(const std::pair<const GlobalValu
 }
 
 template <class T>
-unsigned numGlobalVarSummaries(const ModuleSummaryIndex &Index, T &Cont) {
+static unsigned numGlobalVarSummaries(const ModuleSummaryIndex &Index,
+                                      T &Cont) {
   unsigned NumGVS = 0;
   for (auto &V : Cont)
     if (isGlobalVarSummary(Index, getGUID(V)))




More information about the llvm-commits mailing list