[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
let log_caught_exception (trans_unit_ctx: CFrontend_config.translation_unit_context) exception_type
exception_triggered_location (source_location_start, source_location_end) ast_node =
let caught_exception =
let log_frontend_exception (trans_unit_ctx: CFrontend_config.translation_unit_context)
exception_type exception_triggered_location (source_location_start, source_location_end)
ast_node =
let frontend_exception =
EventLogger.FrontendException
{ exception_type
; source_location_start=
@ -21,7 +22,18 @@ let log_caught_exception (trans_unit_ctx: CFrontend_config.translation_unit_cont
; ast_node
; lang= CFrontend_config.string_of_clang_lang trans_unit_ctx.lang }
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 =

@ -15,3 +15,7 @@ val log_caught_exception :
val log_broken_cfg :
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 _
| TranslationUnitDecl _ ->
let decl_info = Clang_ast_proj.get_decl_tuple dec in
CFrontend_config.incorrect_assumption __POS__ decl_info.Clang_ast_t.di_source_range
"Skipped declaration inside a class '%s'."
(Clang_ast_proj.get_decl_kind_string dec)
dec
ClangLogging.log_unexpected_decl trans_unit_ctx __POS__
decl_info.Clang_ast_t.di_source_range
(Some (Clang_ast_proj.get_decl_kind_string dec))
let process_methods trans_unit_ctx tenv cfg curr_class decl_list =

Loading…
Cancel
Save