r353705 - Make some helper functions static. NFC.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 11 06:52:15 PST 2019


Author: d0k
Date: Mon Feb 11 06:52:15 2019
New Revision: 353705

URL: http://llvm.org/viewvc/llvm-project?rev=353705&view=rev
Log:
Make some helper functions static. NFC.

Modified:
    cfe/trunk/lib/Sema/SemaCodeComplete.cpp
    cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp

Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=353705&r1=353704&r2=353705&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Mon Feb 11 06:52:15 2019
@@ -968,8 +968,8 @@ void ResultBuilder::AdjustResultPriority
   }
 }
 
-DeclContext::lookup_result getConstructors(ASTContext &Context,
-                                           const CXXRecordDecl *Record) {
+static DeclContext::lookup_result getConstructors(ASTContext &Context,
+                                                  const CXXRecordDecl *Record) {
   QualType RecordTy = Context.getTypeDeclType(Record);
   DeclarationName ConstructorName =
       Context.DeclarationNames.getCXXConstructorName(

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp?rev=353705&r1=353704&r2=353705&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp Mon Feb 11 06:52:15 2019
@@ -182,7 +182,7 @@ static Optional<unsigned> findArgIdxOfSy
   return None;
 }
 
-Optional<std::string> findMetaClassAlloc(const Expr *Callee) {
+static Optional<std::string> findMetaClassAlloc(const Expr *Callee) {
   if (const auto *ME = dyn_cast<MemberExpr>(Callee)) {
     if (ME->getMemberDecl()->getNameAsString() != "alloc")
       return None;
@@ -200,8 +200,7 @@ Optional<std::string> findMetaClassAlloc
   return None;
 }
 
-std::string findAllocatedObjectName(const Stmt *S,
-                                    QualType QT) {
+static std::string findAllocatedObjectName(const Stmt *S, QualType QT) {
   if (const auto *CE = dyn_cast<CallExpr>(S))
     if (auto Out = findMetaClassAlloc(CE->getCallee()))
       return *Out;




More information about the cfe-commits mailing list