]> granicus.if.org Git - llvm/commitdiff
Give helper classes/functions internal linkage. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 10 Jul 2016 11:28:51 +0000 (11:28 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 10 Jul 2016 11:28:51 +0000 (11:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275014 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/DebugInfo/PDB/Raw/DbiStream.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Transforms/Scalar/DeadStoreElimination.cpp
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
lib/Transforms/Vectorize/SLPVectorizer.cpp

index 8cce0efb32d9e40340c12e4533edffcd2b2f730b..27ee96dfedfa11009c354a019a30bacdd3f1d008 100644 (file)
@@ -2731,7 +2731,7 @@ void SelectionDAGBuilder::visitFCmp(const User &I) {
 
 // Check if the condition of the select has one use or two users that are both
 // selects with the same condition.
-bool hasOnlySelectUsers(const Value *Cond) {
+static bool hasOnlySelectUsers(const Value *Cond) {
   return std::all_of(Cond->user_begin(), Cond->user_end(), [](const Value *V) {
     return isa<SelectInst>(V);
   });
index 28250c588ff1999e07458c45de2912ea90f003c4..ec807a29a037ee2ec5e03369d552d2d5d555b51f 100644 (file)
@@ -80,8 +80,8 @@ struct DbiStream::HeaderInfo {
 };
 
 template <typename ContribType>
-Error loadSectionContribs(FixedStreamArray<ContribType> &Output,
-                          StreamReader &Reader) {
+static Error loadSectionContribs(FixedStreamArray<ContribType> &Output,
+                                 StreamReader &Reader) {
   if (Reader.bytesRemaining() % sizeof(ContribType) != 0)
     return make_error<RawError>(
         raw_error_code::corrupt_file,
index 2fbf747526821f251288640e3292213300c76a24..b902b6056fca400a32db5553d5ee76881bb2ebeb 100644 (file)
@@ -3720,9 +3720,13 @@ SDValue ARMTargetLowering::getCMOV(const SDLoc &dl, EVT VT, SDValue FalseVal,
   }
 }
 
-bool isGTorGE(ISD::CondCode CC) { return CC == ISD::SETGT || CC == ISD::SETGE; }
+static bool isGTorGE(ISD::CondCode CC) {
+  return CC == ISD::SETGT || CC == ISD::SETGE;
+}
 
-bool isLTorLE(ISD::CondCode CC) { return CC == ISD::SETLT || CC == ISD::SETLE; }
+static bool isLTorLE(ISD::CondCode CC) {
+  return CC == ISD::SETLT || CC == ISD::SETLE;
+}
 
 // See if a conditional (LHS CC RHS ? TrueVal : FalseVal) is lower-saturating.
 // All of these conditions (and their <= and >= counterparts) will do:
@@ -3730,9 +3734,9 @@ bool isLTorLE(ISD::CondCode CC) { return CC == ISD::SETLT || CC == ISD::SETLE; }
 //          x > k ? x : k
 //          k < x ? x : k
 //          k > x ? k : x
-bool isLowerSaturate(const SDValue LHS, const SDValue RHS,
-                     const SDValue TrueVal, const SDValue FalseVal,
-                     const ISD::CondCode CC, const SDValue K) {
+static bool isLowerSaturate(const SDValue LHS, const SDValue RHS,
+                            const SDValue TrueVal, const SDValue FalseVal,
+                            const ISD::CondCode CC, const SDValue K) {
   return (isGTorGE(CC) &&
           ((K == LHS && K == TrueVal) || (K == RHS && K == FalseVal))) ||
          (isLTorLE(CC) &&
@@ -3740,9 +3744,9 @@ bool isLowerSaturate(const SDValue LHS, const SDValue RHS,
 }
 
 // Similar to isLowerSaturate(), but checks for upper-saturating conditions.
-bool isUpperSaturate(const SDValue LHS, const SDValue RHS,
-                     const SDValue TrueVal, const SDValue FalseVal,
-                     const ISD::CondCode CC, const SDValue K) {
+static bool isUpperSaturate(const SDValue LHS, const SDValue RHS,
+                            const SDValue TrueVal, const SDValue FalseVal,
+                            const ISD::CondCode CC, const SDValue K) {
   return (isGTorGE(CC) &&
           ((K == RHS && K == TrueVal) || (K == LHS && K == FalseVal))) ||
          (isLTorLE(CC) &&
@@ -3762,7 +3766,8 @@ bool isUpperSaturate(const SDValue LHS, const SDValue RHS,
 //
 // It returns true if the conversion can be done, false otherwise.
 // Additionally, the variable is returned in parameter V and the constant in K.
-bool isSaturatingConditional(const SDValue &Op, SDValue &V, uint64_t &K) {
+static bool isSaturatingConditional(const SDValue &Op, SDValue &V,
+                                    uint64_t &K) {
 
   SDValue LHS1 = Op.getOperand(0);
   SDValue RHS1 = Op.getOperand(1);
index 7f82596ae5411a0744ff87f4425d6a526fbd60c6..ed58a87ae1a8ad99c6cf4a577a06fb98d86a47cb 100644 (file)
@@ -1050,6 +1050,7 @@ PreservedAnalyses DSEPass::run(Function &F, FunctionAnalysisManager &AM) {
   return PA;
 }
 
+namespace {
 /// A legacy pass for the legacy pass manager that wraps \c DSEPass.
 class DSELegacyPass : public FunctionPass {
 public:
@@ -1084,6 +1085,7 @@ public:
 
   static char ID; // Pass identification, replacement for typeid
 };
+} // end anonymous namespace
 
 char DSELegacyPass::ID = 0;
 INITIALIZE_PASS_BEGIN(DSELegacyPass, "dse", "Dead Store Elimination", false,
index 549248fbf737d149785e3b832b2fd9d3f7f5c464..7a06a25a7073efd4b65931ba7cb44d24beb8c9f8 100644 (file)
@@ -49,6 +49,7 @@ static cl::opt<unsigned> DefaultRotationThreshold(
 
 STATISTIC(NumRotated, "Number of loops rotated");
 
+namespace {
 /// A simple loop rotation transformation.
 class LoopRotate {
   const unsigned MaxHeaderSize;
@@ -70,6 +71,7 @@ private:
   bool rotateLoop(Loop *L, bool SimplifiedLatch);
   bool simplifyLoopLatch(Loop *L);
 };
+} // end anonymous namespace
 
 /// RewriteUsesOfClonedInstructions - We just cloned the instructions from the
 /// old header into the preheader.  If there were uses of the values produced by
index 0a86920efbaae1b95bb99b1c9c063ef9e29ac643..30261b755001909b57e6cd74cd6f6f57e765a749 100644 (file)
@@ -93,6 +93,7 @@ using namespace llvm;
 
 #define DEBUG_TYPE "mldst-motion"
 
+namespace {
 //===----------------------------------------------------------------------===//
 //                         MergedLoadStoreMotion Pass
 //===----------------------------------------------------------------------===//
@@ -135,6 +136,7 @@ private:
   bool sinkStore(BasicBlock *BB, StoreInst *SinkCand, StoreInst *ElseInst);
   bool mergeStores(BasicBlock *BB);
 };
+} // end anonymous namespace
 
 ///
 /// \brief Remove instruction from parent and update memory dependence analysis.
index 9e531e30fb99ef3a4069a7dbadd67684b3f9a62e..8a3c4d14fecb6b2f16826a50b8ff72e8a1bbb4fb 100644 (file)
@@ -3426,6 +3426,7 @@ void BoUpSLP::computeMinimumValueSizes() {
     MinBWs[Scalar] = MaxBitWidth;
 }
 
+namespace {
 /// The SLPVectorizer Pass.
 struct SLPVectorizer : public FunctionPass {
   SLPVectorizerPass Impl;
@@ -3475,6 +3476,7 @@ struct SLPVectorizer : public FunctionPass {
     AU.setPreservesCFG();
   }
 };
+} // end anonymous namespace
 
 PreservedAnalyses SLPVectorizerPass::run(Function &F, FunctionAnalysisManager &AM) {
   auto *SE = &AM.getResult<ScalarEvolutionAnalysis>(F);