From 0df4e226029f6e3bdaed0d66282c38ca35867240 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 9 Mar 2015 16:23:46 +0000 Subject: [PATCH] Make helper functions static. Found by -Wmissing-prototypes. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231664 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopInterchange.cpp | 5 +- .../Scalar/RewriteStatepointsForGC.cpp | 10 ++-- lib/Transforms/Vectorize/LoopVectorize.cpp | 7 ++- tools/llvm-config/llvm-config.cpp | 8 ++-- tools/llvm-cov/gcov.cpp | 7 +-- tools/llvm-cov/llvm-cov.cpp | 2 +- tools/llvm-lto/llvm-lto.cpp | 8 ++-- tools/llvm-objdump/MachODump.cpp | 47 ++++++++++--------- tools/llvm-profdata/llvm-profdata.cpp | 26 +++++----- tools/llvm-rtdyld/llvm-rtdyld.cpp | 8 ++-- tools/llvm-vtabledump/llvm-vtabledump.cpp | 2 +- tools/opt/opt.cpp | 2 +- tools/yaml2obj/yaml2coff.cpp | 2 +- tools/yaml2obj/yaml2obj.cpp | 3 +- 14 files changed, 71 insertions(+), 66 deletions(-) diff --git a/lib/Transforms/Scalar/LoopInterchange.cpp b/lib/Transforms/Scalar/LoopInterchange.cpp index c8c01407caf..591d56a4087 100644 --- a/lib/Transforms/Scalar/LoopInterchange.cpp +++ b/lib/Transforms/Scalar/LoopInterchange.cpp @@ -851,8 +851,9 @@ int LoopInterchangeProfitability::getInstrOrderCost() { return GoodOrder - BadOrder; } -bool isProfitabileForVectorization(unsigned InnerLoopId, unsigned OuterLoopId, - CharMatrix &DepMatrix) { +static bool isProfitabileForVectorization(unsigned InnerLoopId, + unsigned OuterLoopId, + CharMatrix &DepMatrix) { // TODO: Improve this heuristic to catch more cases. // If the inner loop is loop independent or doesn't carry any dependency it is // profitable to move this to outer position. diff --git a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index ed8029b8a37..f5d21fffda2 100644 --- a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -1165,11 +1165,11 @@ static AttributeSet legalizeCallAttributes(AttributeSet AS) { /// statepointToken - statepoint instruction to which relocates should be /// bound. /// Builder - Llvm IR builder to be used to construct new calls. -void CreateGCRelocates(ArrayRef liveVariables, - const int liveStart, - ArrayRef basePtrs, - Instruction *statepointToken, IRBuilder<> Builder) { - +static void CreateGCRelocates(ArrayRef liveVariables, + const int liveStart, + ArrayRef basePtrs, + Instruction *statepointToken, + IRBuilder<> Builder) { SmallVector NewDefs; NewDefs.reserve(liveVariables.size()); diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index 781e224eef6..d22b469046f 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2533,10 +2533,9 @@ getReductionBinOp(LoopVectorizationLegality::ReductionKind Kind) { } } -Value *createMinMaxOp(IRBuilder<> &Builder, - LoopVectorizationLegality::MinMaxReductionKind RK, - Value *Left, - Value *Right) { +static Value *createMinMaxOp(IRBuilder<> &Builder, + LoopVectorizationLegality::MinMaxReductionKind RK, + Value *Left, Value *Right) { CmpInst::Predicate P = CmpInst::ICMP_NE; switch (RK) { default: diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp index 224035ac497..879b9ab0945 100644 --- a/tools/llvm-config/llvm-config.cpp +++ b/tools/llvm-config/llvm-config.cpp @@ -91,9 +91,9 @@ static void VisitComponent(StringRef Name, /// are required to link the given components. /// \param IncludeNonInstalled - Whether non-installed components should be /// reported. -void ComputeLibsForComponents(const std::vector &Components, - std::vector &RequiredLibs, - bool IncludeNonInstalled) { +static void ComputeLibsForComponents(const std::vector &Components, + std::vector &RequiredLibs, + bool IncludeNonInstalled) { std::set VisitedComponents; // Build a map of component names to information. @@ -126,7 +126,7 @@ void ComputeLibsForComponents(const std::vector &Components, /* *** */ -void usage() { +static void usage() { errs() << "\ usage: llvm-config