} // namespace
// Returns callbacks that can be used to update the FileIndex with new ASTs.
-std::unique_ptr<ParsingCallbacks> makeUpdateCallbacks(FileIndex *FIndex) {
+static std::unique_ptr<ParsingCallbacks>
+makeUpdateCallbacks(FileIndex *FIndex) {
struct CB : public ParsingCallbacks {
CB(FileIndex *FIndex) : FIndex(FIndex) {}
FileIndex *FIndex;
return false;
}
+namespace {
class FindUninitializedField {
public:
SmallVector<const FieldDecl *, 10> FieldChain;
return false;
}
};
+} // namespace
bool CallAndMessageChecker::PreVisitProcessArg(CheckerContext &C,
SVal V,
C.addTransition(C.getState()->set<DenotedSymbols>(Sym, E));
}
+namespace {
class SymbolExpressor
: public SymExprVisitor<SymbolExpressor, Optional<std::string>> {
ProgramStateRef State;
return None;
}
};
+} // namespace
void ExprInspectionChecker::analyzerExpress(const CallExpr *CE,
CheckerContext &C) const {
STATISTIC(NumTimesRetriedWithoutInlining,
"The # of times we re-evaluated a call without inlining");
-
//===----------------------------------------------------------------------===//
// Internal program state traits.
//===----------------------------------------------------------------------===//
+namespace {
+
// When modeling a C++ constructor, for a variety of reasons we need to track
// the location of the object for the duration of its ConstructionContext.
// ObjectsUnderConstruction maps statements within the construction context
return Impl < RHS.Impl;
}
};
+} // namespace
typedef llvm::ImmutableMap<ConstructedObjectKey, SVal>
ObjectsUnderConstructionMap;
return N;
}
-IntrinsicFunctionKind
+static IntrinsicFunctionKind
translateIntrinsicFunctionCode(char CH, FunctionIdentifierCodeGroup Group) {
// Not all ? identifiers are intrinsics *functions*. This function only maps
// operator codes for the special functions, all others are handled elsewhere,
outputHex(OS, C);
}
-unsigned countTrailingNullBytes(const uint8_t *StringBytes, int Length) {
+static unsigned countTrailingNullBytes(const uint8_t *StringBytes, int Length) {
const uint8_t *End = StringBytes + Length - 1;
unsigned Count = 0;
while (Length > 0 && *End == 0) {
return Count;
}
-unsigned countEmbeddedNulls(const uint8_t *StringBytes, unsigned Length) {
+static unsigned countEmbeddedNulls(const uint8_t *StringBytes,
+ unsigned Length) {
unsigned Result = 0;
for (unsigned I = 0; I < Length; ++I) {
if (*StringBytes++ == 0)
return Result;
}
-unsigned guessCharByteSize(const uint8_t *StringBytes, unsigned NumChars,
- unsigned NumBytes) {
+static unsigned guessCharByteSize(const uint8_t *StringBytes, unsigned NumChars,
+ unsigned NumBytes) {
assert(NumBytes > 0);
// If the number of bytes is odd, this is guaranteed to be a char string.
return false;
}
-CCValAssign::LocInfo determineLocInfo(const MVT RegisterVT, const EVT VT,
- const ISD::ArgFlagsTy &Flags) {
+static CCValAssign::LocInfo determineLocInfo(const MVT RegisterVT, const EVT VT,
+ const ISD::ArgFlagsTy &Flags) {
// > does not mean loss of information as type RegisterVT can't hold type VT,
// it means that type VT is split into multiple registers of type RegisterVT
if (VT.getSizeInBits() >= RegisterVT.getSizeInBits())
}
template <typename T>
-void setLocInfo(SmallVectorImpl<CCValAssign> &ArgLocs,
- const SmallVectorImpl<T> &Arguments) {
+static void setLocInfo(SmallVectorImpl<CCValAssign> &ArgLocs,
+ const SmallVectorImpl<T> &Arguments) {
for (unsigned i = 0; i < ArgLocs.size(); ++i) {
const CCValAssign &VA = ArgLocs[i];
CCValAssign::LocInfo LocInfo = determineLocInfo(
// possible search paths should be the same.
// Returns nullptr in case it does not find any EH pad in the search, or finds
// multiple different EH pads.
-MachineBasicBlock *GetMatchingEHPad(MachineInstr *MI) {
+static MachineBasicBlock *GetMatchingEHPad(MachineInstr *MI) {
MachineFunction *MF = MI->getParent()->getParent();
SmallVector<MachineBasicBlock *, 2> WL;
SmallPtrSet<MachineBasicBlock *, 2> Visited;
return new X86CondBrFoldingPass();
}
+namespace {
// A class the stores the auxiliary information for each MBB.
struct TargetMBBInfo {
MachineBasicBlock *TBB;
return MBBInfos[MBB->getNumber()].get();
}
};
+} // namespace
// Find a valid path that we can reuse the CondCode.
// The resulted path (if return true) is stored in BranchPath.
// CHRBiasThreshold, put Key into TrueSet and return true. If FalseProb >=
// CHRBiasThreshold, put Key into FalseSet and return true. Otherwise, return
// false.
-template<typename K, typename S, typename M>
-bool checkBias(K *Key, BranchProbability TrueProb, BranchProbability FalseProb,
- S &TrueSet, S &FalseSet, M &BiasMap) {
+template <typename K, typename S, typename M>
+static bool checkBias(K *Key, BranchProbability TrueProb,
+ BranchProbability FalseProb, S &TrueSet, S &FalseSet,
+ M &BiasMap) {
BranchProbability Threshold = getCHRBiasThreshold();
if (TrueProb >= Threshold) {
TrueSet.insert(Key);