From: Benjamin Kramer Date: Fri, 23 Aug 2019 19:59:23 +0000 (+0000) Subject: Do a sweep of symbol internalization. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e63380d34e2564ffc84b2ab936b7e3bd7d0c8923;p=clang Do a sweep of symbol internalization. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369803 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGNonTrivialStruct.cpp b/lib/CodeGen/CGNonTrivialStruct.cpp index caf62d2ac9..05615aa128 100644 --- a/lib/CodeGen/CGNonTrivialStruct.cpp +++ b/lib/CodeGen/CGNonTrivialStruct.cpp @@ -823,7 +823,7 @@ static void callSpecialFunction(G &&Gen, StringRef FuncName, QualType QT, Gen.callFunc(FuncName, QT, Addrs, CGF); } -template std::array createNullAddressArray(); +template static std::array createNullAddressArray(); template <> std::array createNullAddressArray() { return std::array({{Address(nullptr, CharUnits::Zero())}}); diff --git a/lib/Frontend/InterfaceStubFunctionsConsumer.cpp b/lib/Frontend/InterfaceStubFunctionsConsumer.cpp index cdf4e6b33b..73584eb98d 100644 --- a/lib/Frontend/InterfaceStubFunctionsConsumer.cpp +++ b/lib/Frontend/InterfaceStubFunctionsConsumer.cpp @@ -15,6 +15,7 @@ using namespace clang; +namespace { class InterfaceStubFunctionsConsumer : public ASTConsumer { CompilerInstance &Instance; StringRef InFile; @@ -293,6 +294,7 @@ public: writeIfsV1(Instance.getTarget().getTriple(), Symbols, context, Format, *OS); } }; +} // namespace std::unique_ptr GenerateInterfaceIfsExpV1Action::CreateASTConsumer(CompilerInstance &CI, diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 71d1c3b8f4..3de52ce875 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -86,8 +86,8 @@ static bool isAttributeLateParsed(const IdentifierInfo &II) { } /// Check if the a start and end source location expand to the same macro. -bool FindLocsWithCommonFileID(Preprocessor &PP, SourceLocation StartLoc, - SourceLocation EndLoc) { +static bool FindLocsWithCommonFileID(Preprocessor &PP, SourceLocation StartLoc, + SourceLocation EndLoc) { if (!StartLoc.isMacroID() || !EndLoc.isMacroID()) return false; diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index 2c49beef4a..3ce998fdb4 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1060,10 +1060,11 @@ static const Stmt *getTerminatorCondition(const CFGBlock *B) { return S; } -llvm::StringLiteral StrEnteringLoop = "Entering loop body"; -llvm::StringLiteral StrLoopBodyZero = "Loop body executed 0 times"; -llvm::StringLiteral StrLoopRangeEmpty = "Loop body skipped when range is empty"; -llvm::StringLiteral StrLoopCollectionEmpty = +constexpr llvm::StringLiteral StrEnteringLoop = "Entering loop body"; +constexpr llvm::StringLiteral StrLoopBodyZero = "Loop body executed 0 times"; +constexpr llvm::StringLiteral StrLoopRangeEmpty = + "Loop body skipped when range is empty"; +constexpr llvm::StringLiteral StrLoopCollectionEmpty = "Loop body skipped when collection is empty"; static std::unique_ptr