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

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

Issue 1665363002: Clang plugin to check that unstable types are not used in IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blacklist types instead Created 4 years, 10 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.cpp
diff --git a/tools/clang/plugins/FindBadConstructsConsumer.cpp b/tools/clang/plugins/FindBadConstructsConsumer.cpp
index c79a764eb953be319cb5e83fe766cee2bbaa8a3c..ba8883c7ee810378a039e32a5629a57a4829846d 100644
--- a/tools/clang/plugins/FindBadConstructsConsumer.cpp
+++ b/tools/clang/plugins/FindBadConstructsConsumer.cpp
@@ -134,6 +134,10 @@ FindBadConstructsConsumer::FindBadConstructsConsumer(CompilerInstance& instance,
diagnostic().getCustomDiagID(DiagnosticsEngine::Note, kNotePublicDtor);
diag_note_protected_non_virtual_dtor_ = diagnostic().getCustomDiagID(
DiagnosticsEngine::Note, kNoteProtectedNonVirtualDtor);
+
+ if (options.check_ipc) {
+ ipc_checker_.reset(new CheckIPCVisitor(instance));
+ }
}
bool FindBadConstructsConsumer::VisitDecl(clang::Decl* decl) {
@@ -218,6 +222,13 @@ void FindBadConstructsConsumer::CheckChromeEnum(SourceLocation enum_location,
}
}
+void FindBadConstructsConsumer::HandleTranslationUnit(ASTContext& context) {
+ ChromeClassTester::HandleTranslationUnit(context);
+ if (auto checker = ipc_checker()) {
+ checker->Visit(context);
+ }
+}
+
void FindBadConstructsConsumer::CheckCtorDtorWeight(
SourceLocation record_location,
CXXRecordDecl* record) {

Powered by Google App Engine
This is Rietveld 408576698