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() &&
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;
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;
}
}
// 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;