Make helpers static. NFC.

llvm-svn: 329170
This commit is contained in:
Benjamin Kramer 2018-04-04 11:45:11 +00:00
parent ac74acdefe
commit 1fc0da4849
6 changed files with 14 additions and 10 deletions

View File

@ -914,11 +914,8 @@ static bool isInitializationOfVar(const ExplodedNode *N, const VarRegion *VR) {
}
/// Show diagnostics for initializing or declaring a region \p R with a bad value.
void showBRDiagnostics(const char *action,
llvm::raw_svector_ostream& os,
const MemRegion *R,
SVal V,
const DeclStmt *DS) {
static void showBRDiagnostics(const char *action, llvm::raw_svector_ostream &os,
const MemRegion *R, SVal V, const DeclStmt *DS) {
if (R->canPrintPretty()) {
R->printPretty(os);
os << " ";

View File

@ -190,6 +190,7 @@ std::unique_ptr<WorkList> WorkList::makeUnexploredFirst() {
return llvm::make_unique<UnexploredFirstStack>();
}
namespace {
class UnexploredFirstPriorityQueue : public WorkList {
using BlockID = unsigned;
using LocIdentifier = std::pair<BlockID, const StackFrameContext *>;
@ -246,6 +247,7 @@ public:
return U.first;
}
};
} // namespace
std::unique_ptr<WorkList> WorkList::makeUnexploredFirstPriorityQueue() {
return llvm::make_unique<UnexploredFirstPriorityQueue>();

View File

@ -184,7 +184,7 @@ FunctionPass *llvm::createMustExecutePrinter() {
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 &I, Loop *L, DominatorTree *DT) {
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();

View File

@ -7934,9 +7934,9 @@ static SDValue materializeVectorConstant(SDValue Op, SelectionDAG &DAG,
/// 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();

View File

@ -309,6 +309,7 @@ static void dump(StringRef Title, SpillInfo const &Spills) {
}
#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 {

View File

@ -450,7 +450,8 @@ getGUID(const std::pair<const GlobalValue::GUID, unsigned> &P) {
}
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)))