[clangplugin] Updating infer to work with the latest clang plugin version

Summary:
In the most recent version of clang plugin, lambda captures were moved from `LambdaExpr` to `CXXRecordDecl`. Updating infer to reflect this change.

update-submodule: facebook-clang-plugins

Reviewed By: jvillard

Differential Revision: D5823034

fbshipit-source-id: dd5fc45
master
Daiva Naudziuniene 7 years ago committed by Facebook Github Bot
parent d8765d1d44
commit 81c0fe6754

@ -1 +1 @@
Subproject commit 63db8d4a883c5ae356c23eec85e520a0d2c9660d
Subproject commit ea5e6c489aff5924f0fdeeb1270ee4a878492c8f

@ -656,11 +656,17 @@ let get_procname_from_cpp_lambda context dec =
-> let name_info, decl_ptr, _ = CAst_utils.get_info_from_decl_ref dr in
create_procdesc_with_pointer context decl_ptr None name_info.ni_name
| _
-> assert false (* We should not get here *) )
-> (* We should not get here *) assert false )
| _
-> assert false
-> (* We should not get here *) assert false
let get_captures_from_cpp_lambda dec =
match dec with
| Clang_ast_t.CXXRecordDecl (_, _, _, _, _, _, _, cxx_rdi)
-> cxx_rdi.xrdi_lambda_captures
| _
-> (* We should not get here *) assert false
(* We should not get here *)
(*
let instance_to_method_call_type instance =
if instance then MCVirtual

@ -59,3 +59,5 @@ val add_default_method_for_class :
CFrontend_config.translation_unit_context -> Typ.Name.t -> Clang_ast_t.decl_info -> unit
val get_procname_from_cpp_lambda : CContext.t -> Clang_ast_t.decl -> Typ.Procname.t
val get_captures_from_cpp_lambda : Clang_ast_t.decl -> Clang_ast_t.lambda_capture_info list

@ -2572,7 +2572,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| _
-> assert false
and lambdaExpr_trans trans_state stmt_info expr_info {Clang_ast_t.lei_lambda_decl; lei_captures} =
and lambdaExpr_trans trans_state stmt_info expr_info {Clang_ast_t.lei_lambda_decl} =
let open CContext in
let qual_type = expr_info.Clang_ast_t.ei_qual_type in
let context = trans_state.context in
@ -2611,6 +2611,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| None, Some _
-> L.die InternalError "Capture-init with init, but no capture"
in
let lei_captures = CMethod_trans.get_captures_from_cpp_lambda lei_lambda_decl in
let trans_results, captured_vars =
List.fold_right ~f:translate_captured ~init:([], []) lei_captures
in

Loading…
Cancel
Save