Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Unified Diff: tools/clang/plugins/FindBadConstructsConsumer.h

Issue 1141793003: Update from https://crrev.com/329939 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/clang/plugins/FindBadConstructsConsumer.h
diff --git a/tools/clang/plugins/FindBadConstructsConsumer.h b/tools/clang/plugins/FindBadConstructsConsumer.h
index c52a8f33a78ca880ba3f42ec9d5738685c5b7856..2eac31ac3c324551795c05112fcd849c8df5c1f2 100644
--- a/tools/clang/plugins/FindBadConstructsConsumer.h
+++ b/tools/clang/plugins/FindBadConstructsConsumer.h
@@ -17,6 +17,9 @@
// - Enum types with a xxxx_LAST or xxxxLast const actually have that constant
// have the maximal value for that type.
+#ifndef TOOLS_CLANG_PLUGINS_FINDBADCONSTRUCTSCONSUMER_H_
+#define TOOLS_CLANG_PLUGINS_FINDBADCONSTRUCTSCONSUMER_H_
+
#include "clang/AST/AST.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/Attr.h"
@@ -24,9 +27,11 @@
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/SourceManager.h"
+#include "clang/Basic/SourceLocation.h"
#include "ChromeClassTester.h"
#include "Options.h"
+#include "SuppressibleDiagnosticBuilder.h"
namespace chrome_checker {
@@ -57,6 +62,15 @@ class FindBadConstructsConsumer
bool InTestingNamespace(const clang::Decl* record);
bool IsMethodInBannedOrTestingNamespace(const clang::CXXMethodDecl* method);
+ // Returns a diagnostic builder that only emits the diagnostic if the spelling
+ // location (the actual characters that make up the token) is not in an
+ // ignored file. This is useful for situations where the token might originate
+ // from a macro in a system header: warning isn't useful, since system headers
+ // generally can't be easily updated.
+ SuppressibleDiagnosticBuilder ReportIfSpellingLocNotIgnored(
+ clang::SourceLocation loc,
+ unsigned diagnostic_id);
+
void CheckVirtualMethods(clang::SourceLocation record_location,
clang::CXXRecordDecl* record,
bool warn_on_inline_bodies);
@@ -100,3 +114,5 @@ class FindBadConstructsConsumer
};
} // namespace chrome_checker
+
+#endif // TOOLS_CLANG_PLUGINS_FINDBADCONSTRUCTSCONSUMER_H_
« no previous file with comments | « tools/clang/blink_gc_plugin/tests/traceimpl_overloaded.txt ('k') | tools/clang/plugins/FindBadConstructsConsumer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698