Summary: ClassTemplateSpecializationDecl now contains structures information about the specialization

Reviewed By: jvillard

Differential Revision: D3586446

fbshipit-source-id: d567a0b
master
Andrzej Kotulski 8 years ago committed by Facebook Github Bot
parent 62da495510
commit f40033fc5f

@ -1 +1 @@
Subproject commit eb8d2109d769822ee1915a54e6be1cfb7e3fe99b Subproject commit e402a68e82b39bede0d5f591a3a08e49ee7d2456

@ -226,7 +226,7 @@ struct
| _ -> ()); | _ -> ());
match dec with match dec with
(* Currently C/C++ record decl treated in the same way *) (* Currently C/C++ record decl treated in the same way *)
| ClassTemplateSpecializationDecl (_, _, _, _, decl_list, _, _, _) | ClassTemplateSpecializationDecl (_, _, _, _, decl_list, _, _, _, _)
| CXXRecordDecl (_, _, _, _, decl_list, _, _, _) | CXXRecordDecl (_, _, _, _, decl_list, _, _, _)
| RecordDecl (_, _, _, _, decl_list, _, _) -> | RecordDecl (_, _, _, _, decl_list, _, _) ->
let is_method_decl decl = match decl with let is_method_decl decl = match decl with

@ -600,7 +600,7 @@ struct
let open Clang_ast_t in let open Clang_ast_t in
let destruct_decl_ref_opt = match Ast_utils.get_decl_from_typ_ptr class_type_ptr with let destruct_decl_ref_opt = match Ast_utils.get_decl_from_typ_ptr class_type_ptr with
| Some CXXRecordDecl (_, _, _ , _, _, _, _, cxx_record_info) | Some CXXRecordDecl (_, _, _ , _, _, _, _, cxx_record_info)
| Some ClassTemplateSpecializationDecl (_, _, _, _, _, _, _, cxx_record_info) -> | Some ClassTemplateSpecializationDecl (_, _, _, _, _, _, _, cxx_record_info, _) ->
cxx_record_info.xrdi_destructor cxx_record_info.xrdi_destructor
| _ -> None in | _ -> None in
match destruct_decl_ref_opt with match destruct_decl_ref_opt with

@ -92,7 +92,7 @@ let get_record_name_csu decl =
| RecordDecl (_, name_info, opt_type, _, _, _, _) -> | RecordDecl (_, name_info, opt_type, _, _, _, _) ->
name_info, create_csu opt_type name_info, create_csu opt_type
| CXXRecordDecl (_, name_info, _, _, _, _, _, _) | CXXRecordDecl (_, name_info, _, _, _, _, _, _)
| ClassTemplateSpecializationDecl (_, name_info, _, _, _, _, _, _) -> | ClassTemplateSpecializationDecl (_, name_info, _, _, _, _, _, _, _) ->
(* we use Csu.Class for C++ because we expect Csu.Class csu from *) (* we use Csu.Class for C++ because we expect Csu.Class csu from *)
(* types that have methods. And in C++ struct/class/union can have methods *) (* types that have methods. And in C++ struct/class/union can have methods *)
name_info, Csu.Class Csu.CPP name_info, Csu.Class Csu.CPP
@ -121,7 +121,7 @@ let get_superclass_decls decl =
let open Clang_ast_t in let open Clang_ast_t in
match decl with match decl with
| CXXRecordDecl (_, _, _, _, _, _, _, cxx_rec_info) | CXXRecordDecl (_, _, _, _, _, _, _, cxx_rec_info)
| ClassTemplateSpecializationDecl (_, _, _, _, _, _, _, cxx_rec_info) -> | ClassTemplateSpecializationDecl (_, _, _, _, _, _, _, cxx_rec_info, _) ->
(* there is no concept of virtual inheritance in the backend right now *) (* there is no concept of virtual inheritance in the backend right now *)
let base_ptr = cxx_rec_info.Clang_ast_t.xrdi_bases @ cxx_rec_info.Clang_ast_t.xrdi_vbases in let base_ptr = cxx_rec_info.Clang_ast_t.xrdi_bases @ cxx_rec_info.Clang_ast_t.xrdi_vbases in
let get_decl_or_fail typ_ptr = match Ast_utils.get_decl_from_typ_ptr typ_ptr with let get_decl_or_fail typ_ptr = match Ast_utils.get_decl_from_typ_ptr typ_ptr with
@ -149,7 +149,7 @@ let add_struct_to_tenv tenv typ =
let rec get_struct_fields tenv decl = let rec get_struct_fields tenv decl =
let open Clang_ast_t in let open Clang_ast_t in
let decl_list = match decl with let decl_list = match decl with
| ClassTemplateSpecializationDecl (_, _, _, _, decl_list, _, _, _) | ClassTemplateSpecializationDecl (_, _, _, _, decl_list, _, _, _, _)
| CXXRecordDecl (_, _, _, _, decl_list, _, _, _) | CXXRecordDecl (_, _, _, _, decl_list, _, _, _)
| RecordDecl (_, _, _, _, decl_list, _, _) -> decl_list | RecordDecl (_, _, _, _, decl_list, _, _) -> decl_list
| _ -> [] in | _ -> [] in
@ -168,7 +168,7 @@ let rec get_struct_fields tenv decl =
and get_struct_cpp_class_declaration_type tenv decl = and get_struct_cpp_class_declaration_type tenv decl =
let open Clang_ast_t in let open Clang_ast_t in
match decl with match decl with
| ClassTemplateSpecializationDecl (_, _, _, type_ptr, decl_list, _, record_decl_info, _) | ClassTemplateSpecializationDecl (_, _, _, type_ptr, decl_list, _, record_decl_info, _, _)
| CXXRecordDecl (_, _, _, type_ptr, decl_list, _, record_decl_info, _) | CXXRecordDecl (_, _, _, type_ptr, decl_list, _, record_decl_info, _)
| RecordDecl (_, _, _, type_ptr, decl_list, _, record_decl_info) -> | RecordDecl (_, _, _, type_ptr, decl_list, _, record_decl_info) ->
let csu, name = get_record_name_csu decl in let csu, name = get_record_name_csu decl in

Loading…
Cancel
Save