Author: Alexander Kornienko Date: 2019-12-12T17:00:57+01:00 New Revision: 2b09390c136247b42c1b54f42ce925e31d51062a
URL: https://github.com/llvm/llvm-project/commit/2b09390c136247b42c1b54f42ce925e31d51062a DIFF: https://github.com/llvm/llvm-project/commit/2b09390c136247b42c1b54f42ce925e31d51062a.diff LOG: Fix naming style. NFC. Added: Modified: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h clang-tools-extra/clangd/ParsedAST.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp index 12e5fed4d631..a349789a64d1 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp @@ -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; } } diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h index 10e3ccad3d02..0d39296433e6 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h +++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h @@ -217,7 +217,7 @@ class ClangTidyContext { /// 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); diff --git a/clang-tools-extra/clangd/ParsedAST.cpp b/clang-tools-extra/clangd/ParsedAST.cpp index 7c397504a00b..4236a972b396 100644 --- a/clang-tools-extra/clangd/ParsedAST.cpp +++ b/clang-tools-extra/clangd/ParsedAST.cpp @@ -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; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits