From 566062da2987dee9bc92dd46cc2105be029ad6fd Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 26 May 2017 20:08:24 +0000 Subject: [PATCH] Make helper functions static. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304028 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/DeclBase.cpp | 4 ++-- lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 14 +++++++------- lib/Frontend/TextDiagnostic.cpp | 6 +++--- lib/Sema/SemaDeclAttr.cpp | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 085fb52293..032a20afa8 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -448,8 +448,8 @@ const Attr *Decl::getDefiningAttr() const { return nullptr; } -StringRef getRealizedPlatform(const AvailabilityAttr *A, - const ASTContext &Context) { +static StringRef getRealizedPlatform(const AvailabilityAttr *A, + const ASTContext &Context) { // Check if this is an App Extension "platform", and if so chop off // the suffix for matching with the actual platform. StringRef RealizedPlatform = A->getPlatform()->getName(); diff --git a/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp index c3391d087b..c4cbaa4d6f 100644 --- a/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp +++ b/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp @@ -1243,10 +1243,10 @@ static void emitReductionListCopy( /// local = local @ remote /// else /// local = remote -llvm::Value *emitReduceScratchpadFunction(CodeGenModule &CGM, - ArrayRef Privates, - QualType ReductionArrayTy, - llvm::Value *ReduceFn) { +static llvm::Value * +emitReduceScratchpadFunction(CodeGenModule &CGM, + ArrayRef Privates, + QualType ReductionArrayTy, llvm::Value *ReduceFn) { auto &C = CGM.getContext(); auto Int32Ty = C.getIntTypeForBitwidth(32, /* Signed */ true); @@ -1372,9 +1372,9 @@ llvm::Value *emitReduceScratchpadFunction(CodeGenModule &CGM, /// for elem in Reduce List: /// scratchpad[elem_id][index] = elem /// -llvm::Value *emitCopyToScratchpad(CodeGenModule &CGM, - ArrayRef Privates, - QualType ReductionArrayTy) { +static llvm::Value *emitCopyToScratchpad(CodeGenModule &CGM, + ArrayRef Privates, + QualType ReductionArrayTy) { auto &C = CGM.getContext(); auto Int32Ty = C.getIntTypeForBitwidth(32, /* Signed */ true); diff --git a/lib/Frontend/TextDiagnostic.cpp b/lib/Frontend/TextDiagnostic.cpp index c43d9aa98d..a24d5768f5 100644 --- a/lib/Frontend/TextDiagnostic.cpp +++ b/lib/Frontend/TextDiagnostic.cpp @@ -945,9 +945,9 @@ findLinesForRange(const CharSourceRange &R, FileID FID, /// Add as much of range B into range A as possible without exceeding a maximum /// size of MaxRange. Ranges are inclusive. -std::pair maybeAddRange(std::pair A, - std::pair B, - unsigned MaxRange) { +static std::pair +maybeAddRange(std::pair A, std::pair B, + unsigned MaxRange) { // If A is already the maximum size, we're done. unsigned Slack = MaxRange - (A.second - A.first + 1); if (Slack == 0) diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index a7d7d3b2d3..6c492fac9e 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -238,7 +238,7 @@ static typename std::enable_if::value, getAttrName(const AttrInfo &Attr) { return &Attr; } -const IdentifierInfo *getAttrName(const clang::AttributeList &Attr) { +static const IdentifierInfo *getAttrName(const clang::AttributeList &Attr) { return Attr.getName(); } -- 2.40.0