]> granicus.if.org Git - clang/commitdiff
Make helper functions static. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 26 May 2017 20:08:24 +0000 (20:08 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 26 May 2017 20:08:24 +0000 (20:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304028 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclBase.cpp
lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
lib/Frontend/TextDiagnostic.cpp
lib/Sema/SemaDeclAttr.cpp

index 085fb522932a63bdc8dcbf2ceb84dc404d417503..032a20afa8343cf4a8ad092ea81fd4d1b6cec971 100644 (file)
@@ -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();
index c3391d087b75923b583b29c0ba2eff6e2ed8f6d8..c4cbaa4d6fe15c40b2bc6017ca9947b034c6195b 100644 (file)
@@ -1243,10 +1243,10 @@ static void emitReductionListCopy(
 ///    local = local @ remote
 ///  else
 ///    local = remote
-llvm::Value *emitReduceScratchpadFunction(CodeGenModule &CGM,
-                                          ArrayRef<const Expr *> Privates,
-                                          QualType ReductionArrayTy,
-                                          llvm::Value *ReduceFn) {
+static llvm::Value *
+emitReduceScratchpadFunction(CodeGenModule &CGM,
+                             ArrayRef<const Expr *> 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<const Expr *> Privates,
-                                  QualType ReductionArrayTy) {
+static llvm::Value *emitCopyToScratchpad(CodeGenModule &CGM,
+                                         ArrayRef<const Expr *> Privates,
+                                         QualType ReductionArrayTy) {
 
   auto &C = CGM.getContext();
   auto Int32Ty = C.getIntTypeForBitwidth(32, /* Signed */ true);
index c43d9aa98d11a5376f556c9eb2fadce6b00a00c2..a24d5768f558262085e539be2d25cc2a1e77e1db 100644 (file)
@@ -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<unsigned, unsigned> maybeAddRange(std::pair<unsigned, unsigned> A,
-                                            std::pair<unsigned, unsigned> B,
-                                            unsigned MaxRange) {
+static std::pair<unsigned, unsigned>
+maybeAddRange(std::pair<unsigned, unsigned> A, std::pair<unsigned, unsigned> B,
+              unsigned MaxRange) {
   // If A is already the maximum size, we're done.
   unsigned Slack = MaxRange - (A.second - A.first + 1);
   if (Slack == 0)
index a7d7d3b2d3a7c9c447b7b8866a74183135176225..6c492fac9eb9d8d6847241a4c47962bbe5d6a576 100644 (file)
@@ -238,7 +238,7 @@ static typename std::enable_if<std::is_base_of<clang::Attr, AttrInfo>::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();
 }