From 54effdc2bae11f441a34465754e9e43c44b41df9 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 14 Jan 2016 20:58:43 +0100 Subject: More unique debug types. The typdef, enumerator and function_type types form the DebugTypes and DwarfTypes shared a some fields. This commits renames them in order to make them more unique and avoid potential name clashes. --- debug/DebugInformation.ml | 16 ++++++++-------- debug/DebugTypes.mli | 16 ++++++++-------- debug/Dwarfgen.ml | 20 ++++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) (limited to 'debug') diff --git a/debug/DebugInformation.ml b/debug/DebugInformation.ml index be322a55..105b6aad 100644 --- a/debug/DebugInformation.ml +++ b/debug/DebugInformation.ml @@ -116,9 +116,9 @@ let insert_type (ty: typ) = | TVoid _ -> None | _ -> Some (attr_aux t)) in let ftype = { - fun_return_type = ret; - fun_prototyped = prot; - fun_params = param; + fun_type_return_type = ret; + fun_type_prototyped = prot; + fun_type_params = param; } in FunctionType ftype | TNamed (id,_) -> @@ -128,8 +128,8 @@ let insert_type (ty: typ) = Some (attr_aux t) with Not_found -> None in let t = { - typedef_file_loc = None; - typedef_name = id.name; + td_file_loc = None; + td_name = id.name; typ = typ; } in Typedef t @@ -406,14 +406,14 @@ let insert_global_declaration env dec = | Gtypedef (id,t) -> let id = insert_type (TNamed (id,[])) in let tid = insert_type t in - replace_typedef id (fun typ -> {typ with typedef_file_loc = Some dec.gloc; typ = Some tid;}); + replace_typedef id (fun typ -> {typ with td_file_loc = Some dec.gloc; typ = Some tid;}); | Genumdef (n,at,e) -> ignore(insert_type (TEnum (n,at))); let id = find_type (TEnum (n,[])) in let enumerator = List.map (fun (i,c,_) -> { - enumerator_name = i.name; - enumerator_const = c; + e_name = i.name; + e_const = c; }) e in replace_enum id (fun en -> {en with enum_file_loc = Some dec.gloc; enum_enumerators = enumerator;}) diff --git a/debug/DebugTypes.mli b/debug/DebugTypes.mli index e885fc59..53a39665 100644 --- a/debug/DebugTypes.mli +++ b/debug/DebugTypes.mli @@ -54,14 +54,14 @@ type array_type = { } type typedef = { - typedef_file_loc: location option; - typedef_name: string; - typ: int option; + td_file_loc: location option; + td_name: string; + typ: int option; } type enumerator = { - enumerator_name: string; - enumerator_const: int64; + e_name: string; + e_const: int64; } type enum_type = { @@ -85,9 +85,9 @@ type parameter_type = { } type function_type = { - fun_return_type: int option; - fun_prototyped: bool; - fun_params: parameter_type list; + fun_type_return_type: int option; + fun_type_prototyped: bool; + fun_type_params: parameter_type list; } type debug_types = diff --git a/debug/Dwarfgen.ml b/debug/Dwarfgen.ml index 8714e653..d070e3a9 100644 --- a/debug/Dwarfgen.ml +++ b/debug/Dwarfgen.ml @@ -132,8 +132,8 @@ module Dwarfgenaux (Target: TARGET) = let typedef_to_entry id t = let i = get_opt_val t.typ in let td = { - typedef_file_loc = file_loc_opt t.typedef_file_loc; - typedef_name = string_entry t.typedef_name; + typedef_file_loc = file_loc_opt t.td_file_loc; + typedef_name = string_entry t.td_name; typedef_type = i; } in new_entry id (DW_TAG_typedef td) @@ -170,8 +170,8 @@ module Dwarfgenaux (Target: TARGET) = let enumerator_to_entry e = let tag = { - enumerator_value = Int64.to_int (e.enumerator_const); - enumerator_name = string_entry e.enumerator_name; + enumerator_value = Int64.to_int (e.e_const); + enumerator_name = string_entry e.e_name; } in new_entry (next_id ()) (DW_TAG_enumerator tag) in let bs = sizeof_ikind enum_ikind in @@ -186,7 +186,7 @@ module Dwarfgenaux (Target: TARGET) = add_children enum children let fun_type_to_entry id f = - let children = if not f.fun_prototyped then + let children = if not f.fun_type_prototyped then let u = { unspecified_parameter_artificial = None; } in @@ -200,11 +200,11 @@ module Dwarfgenaux (Target: TARGET) = formal_parameter_variable_parameter = None; formal_parameter_location = None; } in - new_entry (next_id ()) (DW_TAG_formal_parameter fp)) f.fun_params; + new_entry (next_id ()) (DW_TAG_formal_parameter fp)) f.fun_type_params; in let s = { - subroutine_type = f.fun_return_type; - subroutine_prototyped = f.fun_prototyped + subroutine_type = f.fun_type_return_type; + subroutine_prototyped = f.fun_type_prototyped } in let s = new_entry id (DW_TAG_subroutine_type s) in add_children s children @@ -287,12 +287,12 @@ module Dwarfgenaux (Target: TARGET) = | VolatileType v -> add_type v.vol_type d | FunctionType f -> - let d,c = match f.fun_return_type with + let d,c = match f.fun_type_return_type with | Some t -> add_type t d | None -> d,false in List.fold_left (fun (d,c) p -> let d,c' = add_type p.param_type d in - d,c||c') (d,c) f.fun_params + d,c||c') (d,c) f.fun_type_params | CompositeType c -> List.fold_left (fun (d,c) f -> let d,c' = add_type f.cfd_typ d in -- cgit