Fix naming style. NFC.
authorAlexander Kornienko <alexfh@google.com>
Fri, 6 Dec 2019 14:38:39 +0000 (15:38 +0100)
committerAlexander Kornienko <alexfh@google.com>
Thu, 12 Dec 2019 16:00:57 +0000 (17:00 +0100)
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h
clang-tools-extra/clangd/ParsedAST.cpp

index 12e5fed..a349789 100644 (file)
@@ -355,7 +355,7 @@ static bool LineIsMarkedWithNOLINTinMacro(const SourceManager &SM,
 namespace clang {
 namespace tidy {
 
-bool ShouldSuppressDiagnostic(DiagnosticsEngine::Level DiagLevel,
+bool shouldSuppressDiagnostic(DiagnosticsEngine::Level DiagLevel,
                               const Diagnostic &Info, ClangTidyContext &Context,
                               bool CheckMacroExpansion) {
   return Info.getLocation().isValid() &&
@@ -375,7 +375,7 @@ void ClangTidyDiagnosticConsumer::HandleDiagnostic(
   if (LastErrorWasIgnored && DiagLevel == DiagnosticsEngine::Note)
     return;
 
-  if (ShouldSuppressDiagnostic(DiagLevel, Info, Context)) {
+  if (shouldSuppressDiagnostic(DiagLevel, Info, Context)) {
     ++Context.Stats.ErrorsIgnoredNOLINT;
     // Ignored a warning, should ignore related notes as well
     LastErrorWasIgnored = true;
@@ -471,55 +471,55 @@ void ClangTidyDiagnosticConsumer::forwardDiagnostic(const Diagnostic &Info) {
       DiagLevelAndFormatString.first, DiagLevelAndFormatString.second);
 
   // Forward the details.
-  auto builder = ExternalDiagEngine->Report(Info.getLocation(), ExternalID);
+  auto Builder = ExternalDiagEngine->Report(Info.getLocation(), ExternalID);
   for (auto Hint : Info.getFixItHints())
-    builder << Hint;
+    Builder << Hint;
   for (auto Range : Info.getRanges())
-    builder << Range;
+    Builder << Range;
   for (unsigned Index = 0; Index < Info.getNumArgs(); ++Index) {
-    DiagnosticsEngine::ArgumentKind kind = Info.getArgKind(Index);
-    switch (kind) {
+    DiagnosticsEngine::ArgumentKind Kind = Info.getArgKind(Index);
+    switch (Kind) {
     case clang::DiagnosticsEngine::ak_std_string:
-      builder << Info.getArgStdStr(Index);
+      Builder << Info.getArgStdStr(Index);
       break;
     case clang::DiagnosticsEngine::ak_c_string:
-      builder << Info.getArgCStr(Index);
+      Builder << Info.getArgCStr(Index);
       break;
     case clang::DiagnosticsEngine::ak_sint:
-      builder << Info.getArgSInt(Index);
+      Builder << Info.getArgSInt(Index);
       break;
     case clang::DiagnosticsEngine::ak_uint:
-      builder << Info.getArgUInt(Index);
+      Builder << Info.getArgUInt(Index);
       break;
     case clang::DiagnosticsEngine::ak_tokenkind:
-      builder << static_cast<tok::TokenKind>(Info.getRawArg(Index));
+      Builder << static_cast<tok::TokenKind>(Info.getRawArg(Index));
       break;
     case clang::DiagnosticsEngine::ak_identifierinfo:
-      builder << Info.getArgIdentifier(Index);
+      Builder << Info.getArgIdentifier(Index);
       break;
     case clang::DiagnosticsEngine::ak_qual:
-      builder << Qualifiers::fromOpaqueValue(Info.getRawArg(Index));
+      Builder << Qualifiers::fromOpaqueValue(Info.getRawArg(Index));
       break;
     case clang::DiagnosticsEngine::ak_qualtype:
-      builder << QualType::getFromOpaquePtr((void *)Info.getRawArg(Index));
+      Builder << QualType::getFromOpaquePtr((void *)Info.getRawArg(Index));
       break;
     case clang::DiagnosticsEngine::ak_declarationname:
-      builder << DeclarationName::getFromOpaqueInteger(Info.getRawArg(Index));
+      Builder << DeclarationName::getFromOpaqueInteger(Info.getRawArg(Index));
       break;
     case clang::DiagnosticsEngine::ak_nameddecl:
-      builder << reinterpret_cast<const NamedDecl *>(Info.getRawArg(Index));
+      Builder << reinterpret_cast<const NamedDecl *>(Info.getRawArg(Index));
       break;
     case clang::DiagnosticsEngine::ak_nestednamespec:
-      builder << reinterpret_cast<NestedNameSpecifier *>(Info.getRawArg(Index));
+      Builder << reinterpret_cast<NestedNameSpecifier *>(Info.getRawArg(Index));
       break;
     case clang::DiagnosticsEngine::ak_declcontext:
-      builder << reinterpret_cast<DeclContext *>(Info.getRawArg(Index));
+      Builder << reinterpret_cast<DeclContext *>(Info.getRawArg(Index));
       break;
     case clang::DiagnosticsEngine::ak_qualtype_pair:
       assert(false); // This one is not passed around.
       break;
     case clang::DiagnosticsEngine::ak_attr:
-      builder << reinterpret_cast<Attr *>(Info.getRawArg(Index));
+      Builder << reinterpret_cast<Attr *>(Info.getRawArg(Index));
       break;
     }
   }
index 10e3cca..0d39296 100644 (file)
@@ -217,7 +217,7 @@ private:
 /// examining source files other than the one in which the diagnostic is
 /// located, and in some use cases we cannot rely on such other files being
 /// mapped in the SourceMapper.
-bool ShouldSuppressDiagnostic(DiagnosticsEngine::Level DiagLevel,
+bool shouldSuppressDiagnostic(DiagnosticsEngine::Level DiagLevel,
                               const Diagnostic &Info, ClangTidyContext &Context,
                               bool CheckMacroExpansion = true);
 
index 7c39750..4236a97 100644 (file)
@@ -284,12 +284,12 @@ ParsedAST::build(std::unique_ptr<clang::CompilerInvocation> CI,
           // Check for suppression comment. Skip the check for diagnostics not
           // in the main file, because we don't want that function to query the
           // source buffer for preamble files. For the same reason, we ask
-          // ShouldSuppressDiagnostic not to follow macro expansions, since
+          // shouldSuppressDiagnostic not to follow macro expansions, since
           // those might take us into a preamble file as well.
           bool IsInsideMainFile =
               Info.hasSourceManager() &&
               isInsideMainFile(Info.getLocation(), Info.getSourceManager());
-          if (IsInsideMainFile && tidy::ShouldSuppressDiagnostic(
+          if (IsInsideMainFile && tidy::shouldSuppressDiagnostic(
                                       DiagLevel, Info, *CTContext,
                                       /* CheckMacroExpansion = */ false)) {
             return DiagnosticsEngine::Ignored;