@@ -45,7 +45,9 @@ open CCHPreSumTypeSerializer
4545open CCHPreTypes
4646
4747module H = Hashtbl
48+ module TR = CHTraceResult
4849
50+ let (let* ) x f = CHTraceResult. tbind f x
4951
5052let cdecls = CCHDeclarations. cdeclarations
5153let cd = CCHDictionary. cdictionary
@@ -87,6 +89,8 @@ class podictionary_t
8789 (_fname :string ) (fdecls :cfundeclarations_int ):podictionary_int =
8890object (self )
8991
92+ val output_parameter_rejection_reason_table =
93+ mk_index_table " output-parameter-rejection-reason-table"
9094 val output_parameter_status_table = mk_index_table " output-parameter-status-table"
9195 val assumption_table = mk_index_table " assumption-table"
9296 val ppo_type_table = mk_index_table " ppo-type-table"
@@ -96,6 +100,7 @@ object (self)
96100
97101 initializer
98102 tables < - [
103+ output_parameter_rejection_reason_table;
99104 output_parameter_status_table;
100105 assumption_table;
101106 ppo_type_table;
@@ -104,11 +109,43 @@ object (self)
104109
105110 method fdecls = fdecls
106111
112+ method index_output_parameter_rejection_reason
113+ (r : output_parameter_rejection_reason_t ) =
114+ let tags = [output_parameter_rejection_reason_mcts#ts r] in
115+ let key = match r with
116+ | OpConstQualifier ty -> (tags, [cd#index_typ ty])
117+ | OpSystemStruct cinfo -> (tags, [cdecls#index_compinfo cinfo])
118+ | OpArrayStruct cinfo -> (tags, [cdecls#index_compinfo cinfo])
119+ | OpArrayType ty -> (tags, [cd#index_typ ty])
120+ | OpVoidPointer -> (tags, [] )
121+ | OpPointerPointer ty -> (tags, [cd#index_typ ty])
122+ | OpParameterRead linenumber -> (tags, [linenumber])
123+ | OpOtherReason reason -> (tags, [cd#index_string reason]) in
124+ output_parameter_rejection_reason_table#add key
125+
126+ method get_output_parameter_rejection_reason (index : int ):
127+ output_parameter_rejection_reason_t traceresult =
128+ let name = " output_parameter_rejection_reason" in
129+ let (tags, args) = output_parameter_rejection_reason_table#retrieve index in
130+ let t = t name tags in
131+ let a = a name args in
132+ match (t 0 ) with
133+ | "a" -> Ok (OpArrayStruct (cdecls#get_compinfo (a 0 )))
134+ | "at" -> Ok (OpArrayType (cd#get_typ (a 0 )))
135+ | "c" -> Ok (OpConstQualifier (cd#get_typ (a 0 )))
136+ | "o" -> Ok (OpOtherReason (cd#get_string (a 0 )))
137+ | "p" -> Ok (OpPointerPointer (cd#get_typ (a 0 )))
138+ | "r" -> Ok (OpParameterRead (a 0 ))
139+ | "s" -> Ok (OpSystemStruct (cdecls#get_compinfo (a 0 )))
140+ | "v" -> Ok OpVoidPointer
141+ | s -> Error [elocm __LINE__ name s output_parameter_rejection_reason_mcts#tags]
142+
107143 method index_output_parameter_status (s : output_parameter_status_t ) =
108144 let tags = [output_parameter_status_mcts#ts s] in
109145 let key = match s with
110146 | OpUnknown -> (tags, [] )
111- | OpRejected rs -> (tags, (List. map cd#index_string rs))
147+ | OpRejected rs ->
148+ (tags, (List. map self#index_output_parameter_rejection_reason rs))
112149 | OpViable -> (tags, [] )
113150 | OpWritten -> (tags, [] )
114151 | OpUnaltered -> (tags, [] ) in
@@ -124,7 +161,10 @@ object (self)
124161 | "v" -> Ok OpViable
125162 | "w" -> Ok OpWritten
126163 | "a" -> Ok OpUnaltered
127- | "r" -> Ok (OpRejected (List. map cd#get_string args))
164+ | "r" ->
165+ let * reasons =
166+ TR. tbind_map_list self#get_output_parameter_rejection_reason args in
167+ Ok (OpRejected reasons)
128168 | s -> Error [elocm __LINE__ name s output_parameter_status_mcts#tags]
129169
130170 method index_assumption (a :assumption_type_t ) =
0 commit comments