summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2017-11-24 14:55:41 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2017-11-24 14:55:41 +0000
commit51ebcaaf258ee206c6e7179a6803ef4e13e32a2e (patch)
treeaf8e8561b1d1c720d55fd48ed46f9572b68f094e
parent72bac8f33716a8f38fab7acca4145d9c989d14d0 (diff)
downloadbcm5719-llvm-51ebcaaf258ee206c6e7179a6803ef4e13e32a2e.tar.gz
bcm5719-llvm-51ebcaaf258ee206c6e7179a6803ef4e13e32a2e.zip
Make helpers static. NFC.
llvm-svn: 318953
-rw-r--r--llvm/lib/CodeGen/MIRCanonicalizerPass.cpp8
-rw-r--r--llvm/lib/Support/FileOutputBuffer.cpp2
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp8
-rw-r--r--llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp8
4 files changed, 14 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
index 62596440c73..c1ccb94441a 100644
--- a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
+++ b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
@@ -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();
diff --git a/llvm/lib/Support/FileOutputBuffer.cpp b/llvm/lib/Support/FileOutputBuffer.cpp
index 1b1960395e2..c4ff563e5f4 100644
--- a/llvm/lib/Support/FileOutputBuffer.cpp
+++ b/llvm/lib/Support/FileOutputBuffer.cpp
@@ -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) {
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
index 714c60a7446..f594767c8ed 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
@@ -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());
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index 5cfd3cd7651..3d0fca0bc3a 100644
--- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -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.");
OpenPOWER on IntegriCloud