Преглед на файлове

Do a sweep of symbol internalization. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369803 91177308-0d34-0410-b5e6-96231b3b80d8
Benjamin Kramer преди 6 години
родител
ревизия
e63380d34e
променени са 4 файла, в които са добавени 10 реда и са изтрити 7 реда
  1. 1 1
      lib/CodeGen/CGNonTrivialStruct.cpp
  2. 2 0
      lib/Frontend/InterfaceStubFunctionsConsumer.cpp
  3. 2 2
      lib/Parse/ParseDecl.cpp
  4. 5 4
      lib/StaticAnalyzer/Core/BugReporter.cpp

+ 1 - 1
lib/CodeGen/CGNonTrivialStruct.cpp

@@ -823,7 +823,7 @@ static void callSpecialFunction(G &&Gen, StringRef FuncName, QualType QT,
   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())}});

+ 2 - 0
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<ASTConsumer>
 GenerateInterfaceIfsExpV1Action::CreateASTConsumer(CompilerInstance &CI,

+ 2 - 2
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;
 

+ 5 - 4
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<FilesToLineNumsMap>