|
|
@ -126,25 +126,21 @@ let get_enum_constant_exp enum_constant_pointer =
|
|
|
|
ClangPointers.Map.find_exn !CFrontend_config.enum_map enum_constant_pointer
|
|
|
|
ClangPointers.Map.find_exn !CFrontend_config.enum_map enum_constant_pointer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let get_type ?source_range type_ptr =
|
|
|
|
let get_type type_ptr =
|
|
|
|
let source_range = match source_range with Some sr -> sr | None -> dummy_source_range () in
|
|
|
|
|
|
|
|
match type_ptr with
|
|
|
|
match type_ptr with
|
|
|
|
(* There is chance for success only if type_ptr is in fact clang pointer *)
|
|
|
|
(* There is chance for success only if type_ptr is in fact clang pointer *)
|
|
|
|
| Clang_ast_types.TypePtr.Ptr raw_ptr ->
|
|
|
|
| Clang_ast_types.TypePtr.Ptr raw_ptr ->
|
|
|
|
let typ = Int.Table.find ClangPointers.pointer_type_table raw_ptr in
|
|
|
|
Int.Table.find ClangPointers.pointer_type_table raw_ptr
|
|
|
|
if Option.is_none typ then
|
|
|
|
|
|
|
|
CFrontend_config.incorrect_assumption __POS__ source_range
|
|
|
|
|
|
|
|
"type with pointer %d not found@\n" raw_ptr ;
|
|
|
|
|
|
|
|
typ
|
|
|
|
|
|
|
|
| _ ->
|
|
|
|
| _ ->
|
|
|
|
|
|
|
|
(* TODO(T30739447): investigate why this happens *)
|
|
|
|
(* otherwise, function fails *)
|
|
|
|
(* otherwise, function fails *)
|
|
|
|
let type_str = Clang_ast_extend.type_ptr_to_string type_ptr in
|
|
|
|
let type_str = Clang_ast_extend.type_ptr_to_string type_ptr in
|
|
|
|
L.(debug Capture Medium) "type %s is not clang pointer@\n" type_str ;
|
|
|
|
L.(debug Capture Medium) "type %s is not clang pointer@\n" type_str ;
|
|
|
|
None
|
|
|
|
None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let get_desugared_type ?source_range type_ptr =
|
|
|
|
let get_desugared_type type_ptr =
|
|
|
|
let typ_opt = get_type ?source_range type_ptr in
|
|
|
|
let typ_opt = get_type type_ptr in
|
|
|
|
match typ_opt with
|
|
|
|
match typ_opt with
|
|
|
|
| Some typ
|
|
|
|
| Some typ
|
|
|
|
-> (
|
|
|
|
-> (
|
|
|
|