From cb0380eb4ece276dc5d3db7563ead1efc7134427 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Thu, 8 Oct 2015 10:09:48 -0700 Subject: [PATCH] Update version of fcp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: @​public Update version of clang plugin, it changes type of CXXMethodDecl, all of the changes are to make frontend compile. Reviewed By: @jvillard Differential Revision: D2522117 fb-gh-sync-id: 970bdc8 --- facebook-clang-plugins | 2 +- infer/src/clang/cAstProcessor.ml | 5 ++++- infer/src/clang/cFrontend.ml | 2 +- infer/src/clang/cFrontend_utils.ml | 2 -- infer/src/clang/cMethod_trans.ml | 2 +- infer/src/clang/cTypes_decl.ml | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/facebook-clang-plugins b/facebook-clang-plugins index 5d5acdda7..be9b670f7 160000 --- a/facebook-clang-plugins +++ b/facebook-clang-plugins @@ -1 +1 @@ -Subproject commit 5d5acdda78200b32175d3c9814a9be9b70a02d96 +Subproject commit be9b670f703b93ec851bd25d45bafc79abe0a1ff diff --git a/infer/src/clang/cAstProcessor.ml b/infer/src/clang/cAstProcessor.ml index 40fb57dcc..e6bf1e11d 100644 --- a/infer/src/clang/cAstProcessor.ml +++ b/infer/src/clang/cAstProcessor.ml @@ -263,9 +263,12 @@ and decl_process_locs loc_composer decl = fdi_parameters = fdi_parameters'; fdi_decls_in_prototype_scope = fdi_decls_in_prototype_scope'; } in (decl_info', name, tp, fdecl_info') in + 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 + (di', n', tp', fdi', method_info) in match decl' with | FunctionDecl fun_info -> FunctionDecl (get_updated_fun_decl fun_info) - | CXXMethodDecl fun_info -> CXXMethodDecl (get_updated_fun_decl fun_info) + | CXXMethodDecl meth_info -> CXXMethodDecl (get_updated_method_decl meth_info) | ObjCMethodDecl (decl_info', name, obj_c_method_decl_info) -> let body' = Option.map (stmt_process_locs loc_composer) obj_c_method_decl_info.omdi_body in diff --git a/infer/src/clang/cFrontend.ml b/infer/src/clang/cFrontend.ml index f42deb767..a4b632871 100644 --- a/infer/src/clang/cFrontend.ml +++ b/infer/src/clang/cFrontend.ml @@ -76,7 +76,7 @@ let rec translate_one_declaration tenv cg cfg namespace parent_dec dec = let curr_class = ObjcInterface_decl.interface_impl_declaration tenv name decl_list idi in CMethod_declImpl.process_methods tenv cg cfg curr_class namespace decl_list - | CXXMethodDecl(decl_info, name_info, type_ptr, function_decl_info) -> + | CXXMethodDecl(decl_info, name_info, type_ptr, function_decl_info, _) -> (* di_parent_pointer has pointer to lexical context such as class.*) (* If it's not defined, then it's the same as parent in AST *) let class_decl = match decl_info.Clang_ast_t.di_parent_pointer with diff --git a/infer/src/clang/cFrontend_utils.ml b/infer/src/clang/cFrontend_utils.ml index 4354b9db6..5ad33def3 100644 --- a/infer/src/clang/cFrontend_utils.ml +++ b/infer/src/clang/cFrontend_utils.ml @@ -426,13 +426,11 @@ struct { Clang_ast_t.fdi_storage_class = None; Clang_ast_t.fdi_is_inline = true; (* This value should not matter as we don't use it*) - Clang_ast_t.fdi_is_virtual = false; (* This value should not matter as we don't use it*) Clang_ast_t.fdi_is_module_private = true; (* This value should not matter as we don't use it*) Clang_ast_t.fdi_is_pure = false; (* This value should not matter as we don't use it*) Clang_ast_t.fdi_is_delete_as_written = false; (* This value should not matter as we don't use it*) Clang_ast_t.fdi_decls_in_prototype_scope =[]; Clang_ast_t.fdi_parameters = block_decl_info.Clang_ast_t.bdi_parameters; - Clang_ast_t.fdi_cxx_ctor_initializers = []; Clang_ast_t.fdi_body = block_decl_info.Clang_ast_t.bdi_body; } diff --git a/infer/src/clang/cMethod_trans.ml b/infer/src/clang/cMethod_trans.ml index 024f6e8d1..bed00cd49 100644 --- a/infer/src/clang/cMethod_trans.ml +++ b/infer/src/clang/cMethod_trans.ml @@ -106,7 +106,7 @@ let method_signature_of_decl class_name_opt meth_decl block_data_opt = let procname = General_utils.mk_procname_from_function name function_info tp language in let ms = build_method_signature decl_info procname func_decl false false in ms, fdi.Clang_ast_t.fdi_body, fdi.Clang_ast_t.fdi_parameters - | CXXMethodDecl (decl_info, name_info, tp, fdi), _, Some class_name -> + | CXXMethodDecl (decl_info, name_info, tp, fdi, _), _, Some class_name -> let method_name = name_info.Clang_ast_t.ni_name in let procname = General_utils.mk_procname_from_cpp_method class_name method_name tp in let method_decl = Cpp_Meth_decl_info (fdi, class_name, tp) in diff --git a/infer/src/clang/cTypes_decl.ml b/infer/src/clang/cTypes_decl.ml index 56bed9ecb..277941fcd 100644 --- a/infer/src/clang/cTypes_decl.ml +++ b/infer/src/clang/cTypes_decl.ml @@ -109,7 +109,7 @@ let get_method_decls parent decl_list = let get_class_methods tenv class_name namespace decl_list = let process_method_decl = function - | Clang_ast_t.CXXMethodDecl (decl_info, name_info, tp, function_decl_info) -> + | Clang_ast_t.CXXMethodDecl (decl_info, name_info, tp, function_decl_info, _) -> let method_name = name_info.Clang_ast_t.ni_name in Printing.log_out " ...Declaring method '%s'.\n" method_name; let method_proc = General_utils.mk_procname_from_cpp_method class_name method_name tp in