r369803 - Do a sweep of symbol internalization. NFC.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 12:59:24 PDT 2019


Author: d0k
Date: Fri Aug 23 12:59:23 2019
New Revision: 369803

URL: http://llvm.org/viewvc/llvm-project?rev=369803&view=rev
Log:
Do a sweep of symbol internalization. NFC.

Modified:
    cfe/trunk/lib/CodeGen/CGNonTrivialStruct.cpp
    cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
    cfe/trunk/lib/Parse/ParseDecl.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp

Modified: cfe/trunk/lib/CodeGen/CGNonTrivialStruct.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGNonTrivialStruct.cpp?rev=369803&r1=369802&r2=369803&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGNonTrivialStruct.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGNonTrivialStruct.cpp Fri Aug 23 12:59:23 2019
@@ -823,7 +823,7 @@ static void callSpecialFunction(G &&Gen,
   Gen.callFunc(FuncName, QT, Addrs, CGF);
 }
 
-template <size_t N> std::array<Address, N> createNullAddressArray();
+template <size_t N> static std::array<Address, N> createNullAddressArray();
 
 template <> std::array<Address, 1> createNullAddressArray() {
   return std::array<Address, 1>({{Address(nullptr, CharUnits::Zero())}});

Modified: cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp?rev=369803&r1=369802&r2=369803&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp (original)
+++ cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp Fri Aug 23 12:59:23 2019
@@ -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<ASTConsumer>
 GenerateInterfaceIfsExpV1Action::CreateASTConsumer(CompilerInstance &CI,

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=369803&r1=369802&r2=369803&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Fri Aug 23 12:59:23 2019
@@ -86,8 +86,8 @@ static bool isAttributeLateParsed(const
 }
 
 /// 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;
 

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=369803&r1=369802&r2=369803&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Fri Aug 23 12:59:23 2019
@@ -1060,10 +1060,11 @@ static const Stmt *getTerminatorConditio
   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<FilesToLineNumsMap>




More information about the cfe-commits mailing list