From 1256dc5518f9a5f2108933b9bb6cc4b55687ef79 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 10 Sep 2024 09:49:51 -0700 Subject: [PATCH] [clang][wibble] remove wrong hdvi_ AST record prefix Summary: the "hdvi" acronym is not accurate anymore, just remove the prefix altogether since there are no clashes Reviewed By: ngorogiannis Differential Revision: D62442963 fbshipit-source-id: 4ac9604bd65decea8e15a513d96d518866187ddd --- facebook-clang-plugins/libtooling/ASTExporter.h | 2 +- infer/src/clang/cTrans.ml | 4 ++-- infer/src/clang/cVar_decl.ml | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/facebook-clang-plugins/libtooling/ASTExporter.h b/facebook-clang-plugins/libtooling/ASTExporter.h index 5843c751f5b..a844365b03a 100644 --- a/facebook-clang-plugins/libtooling/ASTExporter.h +++ b/facebook-clang-plugins/libtooling/ASTExporter.h @@ -2154,7 +2154,7 @@ int ASTExporter::BindingDeclTupleSize() { //@atd type binding_decl_info = { //@atd ?binding_var: var_decl_info option; //@atd ?bound_decl_type: qual_type option; -//@atd } +//@atd } template void ASTExporter::VisitBindingDecl(const BindingDecl *D) { VisitValueDecl(D); diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index 4007f03565a..8bd7806370b 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -880,7 +880,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s in let typ = match CAst_utils.get_decl decl_ptr with - | Some (BindingDecl (_, _, _, {hvdi_bound_decl_type= Some qt})) -> ( + | Some (BindingDecl (_, _, _, {bound_decl_type= Some qt})) -> ( (* clang gives us the wrong type for bindings in the AST, with missing references, we have to go back to the BindingDecl that defines the binding to get the correct type *) match CAst_utils.get_desugared_type qt.qt_type_ptr with @@ -3265,7 +3265,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s | [] -> None | ( ( VarDecl (_, _, qt, vdi) - | BindingDecl (_, _, qt, Clang_ast_t.{hvdi_binding_var= Some vdi}) + | BindingDecl (_, _, qt, {binding_var= Some vdi}) | VarTemplateSpecializationDecl (_, _, _, qt, vdi) ) as var_decl ) :: var_decls' -> let res_trans_tl = aux var_decls' in diff --git a/infer/src/clang/cVar_decl.ml b/infer/src/clang/cVar_decl.ml index f441784b88e..a7f12bb9025 100644 --- a/infer/src/clang/cVar_decl.ml +++ b/infer/src/clang/cVar_decl.ml @@ -118,7 +118,7 @@ let sil_var_of_decl context var_decl procname = let outer_procname = CContext.get_outer_procname context in let open Clang_ast_t in match var_decl with - | BindingDecl (_, name_info, _, Clang_ast_t.{hvdi_binding_var= None}) -> + | BindingDecl (_, name_info, _, {binding_var= None}) -> mk_sil_var ~is_decomposition:false context name_info None procname outer_procname | _ -> let should_be_mangled = @@ -136,8 +136,7 @@ let sil_var_of_decl context var_decl procname = let name_info, decl_info, qual_type, var_decl_info = match var_decl with | VarDecl (decl_info, name_info, qual_type, var_decl_info) - | BindingDecl - (decl_info, name_info, qual_type, Clang_ast_t.{hvdi_binding_var= Some var_decl_info}) + | BindingDecl (decl_info, name_info, qual_type, {binding_var= Some var_decl_info}) | DecompositionDecl (decl_info, name_info, qual_type, var_decl_info, _) | ParmVarDecl (decl_info, name_info, qual_type, var_decl_info) | VarTemplateSpecializationDecl (_, decl_info, name_info, qual_type, var_decl_info) -> @@ -204,7 +203,7 @@ let add_var_to_locals procdesc var_decl typ pvar = let open Clang_ast_t in match var_decl with | VarDecl (decl_info, _, _, vdi) - | BindingDecl (decl_info, _, _, Clang_ast_t.{hvdi_binding_var= Some vdi}) + | BindingDecl (decl_info, _, _, {binding_var= Some vdi}) | DecompositionDecl (decl_info, _, _, vdi, _) | VarTemplateSpecializationDecl (_, decl_info, _, _, vdi) -> if not vdi.Clang_ast_t.vdi_is_global then @@ -229,7 +228,7 @@ let add_var_to_locals procdesc var_decl typ pvar = ; has_cleanup_attribute } in Procdesc.append_locals procdesc [var_data] - | BindingDecl (_, _, _, Clang_ast_t.{hvdi_binding_var= None}) -> + | BindingDecl (_, _, _, {binding_var= None}) -> () | _ -> assert false