]> granicus.if.org Git - llvm/commitdiff
Make helpers static. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 24 Nov 2017 14:55:41 +0000 (14:55 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 24 Nov 2017 14:55:41 +0000 (14:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318953 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MIRCanonicalizerPass.cpp
lib/Support/FileOutputBuffer.cpp
lib/Target/AMDGPU/AMDGPULibCalls.cpp
lib/Transforms/Scalar/SimpleLoopUnswitch.cpp

index 62596440c73a4197109178dbedae006fb2b6e313..c1ccb94441ab8fd4522e21126895c11652f78946 100644 (file)
@@ -261,10 +261,10 @@ static std::vector<MachineInstr *> populateCandidates(MachineBasicBlock *MBB) {
   return Candidates;
 }
 
-void doCandidateWalk(std::vector<TypedVReg> &VRegs,
-                     std::queue <TypedVReg> &RegQueue,
-                     std::vector<MachineInstr *> &VisitedMIs,
-                     const MachineBasicBlock *MBB) {
+static void doCandidateWalk(std::vector<TypedVReg> &VRegs,
+                            std::queue<TypedVReg> &RegQueue,
+                            std::vector<MachineInstr *> &VisitedMIs,
+                            const MachineBasicBlock *MBB) {
 
   const MachineFunction &MF = *MBB->getParent();
   const MachineRegisterInfo &MRI = MF.getRegInfo();
index 1b1960395e2e353d2a8a6bfa40fbf0282df8bc4c..c4ff563e5f44dc69d6dab9f6ee5cc2a77551f1c4 100644 (file)
@@ -28,6 +28,7 @@
 using namespace llvm;
 using namespace llvm::sys;
 
+namespace {
 // A FileOutputBuffer which creates a temporary file in the same directory
 // as the final output file. The final output file is atomically replaced
 // with the temporary file on commit().
@@ -94,6 +95,7 @@ private:
   OwningMemoryBlock Buffer;
   unsigned Mode;
 };
+} // namespace
 
 static Expected<std::unique_ptr<InMemoryBuffer>>
 createInMemoryBuffer(StringRef Path, size_t Size, unsigned Mode) {
index 714c60a7446bcb51a0f47ea3ae48129e908012f6..f594767c8edb240f8ac3af6bd38e601563e1cec8 100644 (file)
@@ -217,8 +217,8 @@ INITIALIZE_PASS(AMDGPUUseNativeCalls, "amdgpu-usenative",
                 false, false)
 
 template <typename IRB>
-CallInst *CreateCallEx(IRB &B, Value *Callee, Value *Arg, const Twine &Name="")
-{
+static CallInst *CreateCallEx(IRB &B, Value *Callee, Value *Arg,
+                              const Twine &Name = "") {
   CallInst *R = B.CreateCall(Callee, Arg, Name);
   if (Function* F = dyn_cast<Function>(Callee))
     R->setCallingConv(F->getCallingConv());
@@ -226,8 +226,8 @@ CallInst *CreateCallEx(IRB &B, Value *Callee, Value *Arg, const Twine &Name="")
 }
 
 template <typename IRB>
-CallInst *CreateCallEx2(IRB &B, Value *Callee, Value *Arg1, Value *Arg2,
-                        const Twine &Name="") {
+static CallInst *CreateCallEx2(IRB &B, Value *Callee, Value *Arg1, Value *Arg2,
+                               const Twine &Name = "") {
   CallInst *R = B.CreateCall(Callee, {Arg1, Arg2}, Name);
   if (Function* F = dyn_cast<Function>(Callee))
     R->setCallingConv(F->getCallingConv());
index 5cfd3cd76510c1c46d552b1b56e13e9a501f76b1..3d0fca0bc3a5aaa5c7b8beadbcdef85cdf722ea1 100644 (file)
@@ -136,10 +136,10 @@ static bool updateIDomWithKnownCommonDominator(BasicBlock *BB,
 // FIXME: Neither of these issues are a big deal and could be addressed with
 // some amount of refactoring of IDFCalculator. That would allow us to share
 // the core logic here (which is solving the same core problem).
-void appendDomFrontier(DomTreeNode *Node,
-                       SmallSetVector<BasicBlock *, 4> &Worklist,
-                       SmallVectorImpl<DomTreeNode *> &DomNodes,
-                       SmallPtrSetImpl<BasicBlock *> &DomSet) {
+static void appendDomFrontier(DomTreeNode *Node,
+                              SmallSetVector<BasicBlock *, 4> &Worklist,
+                              SmallVectorImpl<DomTreeNode *> &DomNodes,
+                              SmallPtrSetImpl<BasicBlock *> &DomSet) {
   assert(DomNodes.empty() && "Must start with no dominator nodes.");
   assert(DomSet.empty() && "Must start with an empty dominator set.");