update clang plugin version

Summary: public
Update clang plugin version that has following changes:
1. Don't dump DeclContext as a part of BlockDecl
2. Add location information to C++ constructor initializers

This diff is making infer compatible with these changes by
1. Making infer compile
2. Reading location information from c++ constructor initializers so we don't miss update to line number

Reviewed By: dulmarod

Differential Revision: D2575066

fb-gh-sync-id: 6dc594a
master
Andrzej Kotulski 9 years ago committed by facebook-github-bot-1
parent be07cdda2a
commit 9c578406a1

@ -1 +1 @@
Subproject commit 18f5835c340db4a3ba64a652b0daa23c1981507e Subproject commit 0b1043f4cf5bb34282a3ebe53f3fea3426f45201

@ -665,7 +665,7 @@ let translate_block_enumerate block_name stmt_info stmt_list ei =
| _ -> assert false in | _ -> assert false in
let open Clang_ast_t in let open Clang_ast_t in
match stmt_list with match stmt_list with
| [s; BlockExpr (_, _, bei, BlockDecl (_, _, _, bdi)) as be] -> | [s; BlockExpr (_, _, bei, BlockDecl (_, bdi)) as be] ->
let block_decl, bv = make_block_decl be in let block_decl, bv = make_block_decl be in
let vars_to_register = get_name_pointers bdi.bdi_parameters in let vars_to_register = get_name_pointers bdi.bdi_parameters in
let translated_stmt, op = translate bdi.bdi_parameters s block_decl bei.ei_type_ptr in let translated_stmt, op = translate bdi.bdi_parameters s block_decl bei.ei_type_ptr in

@ -222,6 +222,10 @@ end = struct
end end
let ctor_initializer_process_locs loc_composer ctor_init =
let range' = LocComposer.compose loc_composer ctor_init.Clang_ast_t.xci_source_range in
{ ctor_init with Clang_ast_t.xci_source_range = range'}
(** Apply a location composer to the locations in a statement. *) (** Apply a location composer to the locations in a statement. *)
let rec stmt_process_locs loc_composer stmt = let rec stmt_process_locs loc_composer stmt =
let update (stmt_info, stmt_list) = let update (stmt_info, stmt_list) =
@ -265,7 +269,10 @@ and decl_process_locs loc_composer decl =
(decl_info', name, tp, fdecl_info') in (decl_info', name, tp, fdecl_info') in
let get_updated_method_decl (decl_info', name, tp, fdecl_info, method_info) = let get_updated_method_decl (decl_info', name, tp, fdecl_info, method_info) =
let di', n', tp', fdi' = get_updated_fun_decl (decl_info', name, tp, fdecl_info) in let di', n', tp', fdi' = get_updated_fun_decl (decl_info', name, tp, fdecl_info) in
(di', n', tp', fdi', method_info) in let ctor_init = method_info.xmdi_cxx_ctor_initializers in
let ctor_init' = IList.map (ctor_initializer_process_locs loc_composer) ctor_init in
let method_info' = { method_info with xmdi_cxx_ctor_initializers = ctor_init'} in
(di', n', tp', fdi', method_info') in
match decl' with match decl' with
| FunctionDecl fun_info -> FunctionDecl (get_updated_fun_decl fun_info) | FunctionDecl fun_info -> FunctionDecl (get_updated_fun_decl fun_info)
| CXXMethodDecl meth_info -> CXXMethodDecl (get_updated_method_decl meth_info) | CXXMethodDecl meth_info -> CXXMethodDecl (get_updated_method_decl meth_info)

@ -139,7 +139,7 @@ let method_signature_of_decl class_name_opt meth_decl block_data_opt =
let ms = build_method_signature decl_info procname method_decl false is_generated in let ms = build_method_signature decl_info procname method_decl false is_generated in
let extra_instrs = get_assume_not_null_calls ms mdi.omdi_parameters in let extra_instrs = get_assume_not_null_calls ms mdi.omdi_parameters in
ms, mdi.omdi_body, extra_instrs ms, mdi.omdi_body, extra_instrs
| BlockDecl (decl_info, decl_list, decl_context_info, bdi), | BlockDecl (decl_info, bdi),
Some (outer_context, tp, procname, _), _ -> Some (outer_context, tp, procname, _), _ ->
let func_decl = Block_decl_info (bdi, tp, outer_context) in let func_decl = Block_decl_info (bdi, tp, outer_context) in
let ms = build_method_signature decl_info procname func_decl true false in let ms = build_method_signature decl_info procname func_decl true false in

@ -1821,7 +1821,7 @@ struct
let instr = Sil.Letderef (id, Sil.Lvar (Sil.mk_pvar cvar procname), typ, loc) in let instr = Sil.Letderef (id, Sil.Lvar (Sil.mk_pvar cvar procname), typ, loc) in
(id, instr) in (id, instr) in
match decl with match decl with
| Clang_ast_t.BlockDecl (decl_info, decl_list, decl_context_info, block_decl_info) -> | Clang_ast_t.BlockDecl (decl_info, block_decl_info) ->
let open CContext in let open CContext in
let type_ptr = expr_info.Clang_ast_t.ei_type_ptr in let type_ptr = expr_info.Clang_ast_t.ei_type_ptr in
let block_pname = CFrontend_utils.General_utils.mk_fresh_block_procname procname in let block_pname = CFrontend_utils.General_utils.mk_fresh_block_procname procname in

Loading…
Cancel
Save