From 6e6a7a8e5a8dcd1699cfce4b32df6d9c97673aa7 Mon Sep 17 00:00:00 2001 From: Ryan Rhee Date: Wed, 10 Aug 2016 10:18:32 -0700 Subject: [PATCH] Add is_ck_translation_unit to context Reviewed By: martinoluca Differential Revision: D3693906 fbshipit-source-id: 2e1df34 --- infer/src/clang/CLintersContext.ml | 11 ++++++++++- infer/src/clang/cFrontend_errors.ml | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/infer/src/clang/CLintersContext.ml b/infer/src/clang/CLintersContext.ml index a8dea40f0..6b53032e8 100644 --- a/infer/src/clang/CLintersContext.ml +++ b/infer/src/clang/CLintersContext.ml @@ -9,6 +9,15 @@ type context = { in_synchronized_block: bool; + + (* + * True if the translation unit contains an ObjC class impl that's a subclass + * of CKComponent or CKComponentController. + *) + is_ck_translation_unit: bool; } -let empty = { in_synchronized_block = false } +let empty = { + in_synchronized_block = false; + is_ck_translation_unit = false; +} diff --git a/infer/src/clang/cFrontend_errors.ml b/infer/src/clang/cFrontend_errors.ml index 075f7d18d..2bec5ec25 100644 --- a/infer/src/clang/cFrontend_errors.ml +++ b/infer/src/clang/cFrontend_errors.ml @@ -162,7 +162,7 @@ let run_frontend_checkers_on_stmt context cfg cg method_decl instr = invoke_set_of_checkers call_checker context cfg cg decl_opt key while_stmt_checker_list; context | ObjCAtSynchronizedStmt _ -> - { (* context with *) CLintersContext.in_synchronized_block = true } + { context with CLintersContext.in_synchronized_block = true } | _ -> context let run_frontend_checkers_on_decl context cfg cg dec =