[objc frontend] Log Skipped declaration inside a class directly instead of throwing an exception

Reviewed By: mbouaziz, jvillard

Differential Revision: D8041351

fbshipit-source-id: fec2f00
master
Dulma Churchill 7 years ago committed by Facebook Github Bot
parent dd22e187ef
commit 20de2f66ad

@ -8,9 +8,10 @@
*) *)
open! IStd open! IStd
let log_caught_exception (trans_unit_ctx: CFrontend_config.translation_unit_context) exception_type let log_frontend_exception (trans_unit_ctx: CFrontend_config.translation_unit_context)
exception_triggered_location (source_location_start, source_location_end) ast_node = exception_type exception_triggered_location (source_location_start, source_location_end)
let caught_exception = ast_node =
let frontend_exception =
EventLogger.FrontendException EventLogger.FrontendException
{ exception_type { exception_type
; source_location_start= ; source_location_start=
@ -21,7 +22,18 @@ let log_caught_exception (trans_unit_ctx: CFrontend_config.translation_unit_cont
; ast_node ; ast_node
; lang= CFrontend_config.string_of_clang_lang trans_unit_ctx.lang } ; lang= CFrontend_config.string_of_clang_lang trans_unit_ctx.lang }
in in
EventLogger.log caught_exception EventLogger.log frontend_exception
let log_caught_exception trans_unit_ctx exception_type exception_triggered_location source_range
ast_node =
log_frontend_exception trans_unit_ctx exception_type exception_triggered_location source_range
ast_node
let log_unexpected_decl trans_unit_ctx exception_triggered_location source_range ast_node =
log_frontend_exception trans_unit_ctx "Skipped declaration inside a class"
exception_triggered_location source_range ast_node
let log_broken_cfg ~broken_node procdesc exception_triggered_location ~lang = let log_broken_cfg ~broken_node procdesc exception_triggered_location ~lang =

@ -15,3 +15,7 @@ val log_caught_exception :
val log_broken_cfg : val log_broken_cfg :
broken_node:[`Join | `Other] -> Procdesc.t -> Logging.ocaml_pos -> lang:string -> unit broken_node:[`Join | `Other] -> Procdesc.t -> Logging.ocaml_pos -> lang:string -> unit
val log_unexpected_decl :
CFrontend_config.translation_unit_context -> Logging.ocaml_pos
-> Clang_ast_t.source_location * Clang_ast_t.source_location -> string option -> unit

@ -270,10 +270,9 @@ module CFrontend_decl_funct (T : CModule_type.CTranslation) : CModule_type.CFron
| StaticAssertDecl _ | StaticAssertDecl _
| TranslationUnitDecl _ -> | TranslationUnitDecl _ ->
let decl_info = Clang_ast_proj.get_decl_tuple dec in let decl_info = Clang_ast_proj.get_decl_tuple dec in
CFrontend_config.incorrect_assumption __POS__ decl_info.Clang_ast_t.di_source_range ClangLogging.log_unexpected_decl trans_unit_ctx __POS__
"Skipped declaration inside a class '%s'." decl_info.Clang_ast_t.di_source_range
(Clang_ast_proj.get_decl_kind_string dec) (Some (Clang_ast_proj.get_decl_kind_string dec))
dec
let process_methods trans_unit_ctx tenv cfg curr_class decl_list = let process_methods trans_unit_ctx tenv cfg curr_class decl_list =

Loading…
Cancel
Save