Commit df186507 authored by Benjamin Kramer's avatar Benjamin Kramer
Browse files

Make helper functions static or move them into anonymous namespaces. NFC.

parent bff33bd5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3081,7 +3081,7 @@ Error ASTNodeImporter::ImportFunctionDeclBody(FunctionDecl *FromFD,

// Returns true if the given D has a DeclContext up to the TranslationUnitDecl
// which is equal to the given DC.
bool isAncestorDeclContextOf(const DeclContext *DC, const Decl *D) {
static bool isAncestorDeclContextOf(const DeclContext *DC, const Decl *D) {
  const DeclContext *DCi = D->getDeclContext();
  while (DCi != D->getTranslationUnitDecl()) {
    if (DCi == DC)
+2 −0
Original line number Diff line number Diff line
@@ -14260,6 +14260,7 @@ CodeGenFunction::EmitNVPTXBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
  }
}
namespace {
struct BuiltinAlignArgs {
  llvm::Value *Src = nullptr;
  llvm::Type *SrcType = nullptr;
@@ -14288,6 +14289,7 @@ struct BuiltinAlignArgs {
    Mask = CGF.Builder.CreateSub(Alignment, One, "mask");
  }
};
} // namespace
/// Generate (x & (y-1)) == 0.
RValue CodeGenFunction::EmitBuiltinIsAligned(const CallExpr *E) {
+4 −2
Original line number Diff line number Diff line
@@ -1438,6 +1438,7 @@ CGOpenMPRuntime::getUserDefinedReduction(const OMPDeclareReductionDecl *D) {
  return UDRMap.lookup(D);
}

namespace {
// Temporary RAII solution to perform a push/pop stack event on the OpenMP IR
// Builder if one is present.
struct PushAndPopStackRAII {
@@ -1481,6 +1482,7 @@ struct PushAndPopStackRAII {
  }
  llvm::OpenMPIRBuilder *OMPBuilder;
};
} // namespace

static llvm::Function *emitParallelOrTeamsOutlinedFunction(
    CodeGenModule &CGM, const OMPExecutableDirective &D, const CapturedStmt *CS,
@@ -11122,7 +11124,7 @@ bool checkContext<OMP_CTX_SET_device, OMP_CTX_kind, CodeGenModule &>(
  return true;
}

bool matchesContext(CodeGenModule &CGM,
static bool matchesContext(CodeGenModule &CGM,
                           const CompleteOMPContextSelectorData &ContextData) {
  for (const OMPContextSelectorData &Data : ContextData) {
    switch (Data.Ctx) {
+3 −3
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static void getARMHWDivFeatures(const Driver &D, const Arg *A,
}

// Handle -mfpu=.
unsigned getARMFPUFeatures(const Driver &D, const Arg *A,
static unsigned getARMFPUFeatures(const Driver &D, const Arg *A,
                                  const ArgList &Args, StringRef FPU,
                                  std::vector<StringRef> &Features) {
  unsigned FPUID = llvm::ARM::parseFPU(FPU);
+2 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
using namespace clang;
using namespace ento;

namespace {
class PlacementNewChecker : public Checker<check::PreStmt<CXXNewExpr>> {
public:
  void checkPreStmt(const CXXNewExpr *NE, CheckerContext &C) const;
@@ -22,6 +23,7 @@ private:
  BugType BT{this, "Insufficient storage for placement new",
             categories::MemoryError};
};
} // namespace

SVal PlacementNewChecker::getExtentSizeOfPlace(const Expr *Place,
                                               ProgramStateRef State,
Loading