 Timestamp:
 Jan 19, 2011, 6:23:27 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Deliverables/D2.3/8051memoryspacesbranch/cparser/SimplExpr.ml
r453 r460 93 93 let eboolvalof e = 94 94 { edesc = EBinop(One, e, intconst 0L IInt, TInt(IInt, [])); 95 etyp = TInt(IInt, []) } in 95 etyp = TInt(IInt, []); 96 espace = Any } in 96 97 97 98 let sseq s1 s2 = Cutil.sseq loc s1 s2 in 98 99 99 100 let sassign e1 e2 = 100 { sdesc = Sdo {edesc = EBinop(Oassign, e1, e2, e1.etyp); etyp = e1.etyp };101 { sdesc = Sdo {edesc = EBinop(Oassign, e1, e2, e1.etyp); etyp = e1.etyp; espace = e1.espace}; 101 102 sloc = loc } in 102 103 … … 150 151  Ominus  Oplus  Olognot  Onot  Oderef  Oarrow _ > 151 152 let (s1, e1') = simpl e1 RHS in 152 finish act s1 {edesc = EUnop(op, e1'); etyp = e.etyp }153 finish act s1 {edesc = EUnop(op, e1'); etyp = e.etyp; espace = e.espace} 153 154 154 155  Oaddrof > 155 156 let (s1, e1') = simpl e1 LHS in 156 finish act s1 {edesc = EUnop(op, e1'); etyp = e.etyp }157 finish act s1 {edesc = EUnop(op, e1'); etyp = e.etyp; espace = e.espace} 157 158 158 159  Odot _ > 159 160 let (s1, e1') = simpl e1 (if act = LHS then LHS else RHS) in 160 finish act s1 {edesc = EUnop(op, e1'); etyp = e.etyp }161 finish act s1 {edesc = EUnop(op, e1'); etyp = e.etyp; espace = e.espace} 161 162 162 163  Opreincr  Opredecr > … … 166 167 let ty = unary_conversion env e.etyp in 167 168 let e3 = 168 {edesc = EBinop(op', e2', intconst 1L IInt, ty); etyp = ty } in169 {edesc = EBinop(op', e2', intconst 1L IInt, ty); etyp = ty; espace = Any} in 169 170 begin match act with 170 171  Drop > … … 185 186 let (s2, e2') = lhs_to_rhs e1' in 186 187 let e3 = 187 {edesc = EBinop(op', e2', intconst 1L IInt, ty); etyp = ty } in188 {edesc = EBinop(op', e2', intconst 1L IInt, ty); etyp = ty; espace = Any} in 188 189 (sseq s1 (sseq s2 (sassign e1' e3)), voidconst) 189 190  _ > 190 191 let tmp = new_temp e.etyp in 191 192 let e3 = 192 {edesc = EBinop(op', tmp, intconst 1L IInt, ty); etyp = ty } in193 {edesc = EBinop(op', tmp, intconst 1L IInt, ty); etyp = ty; espace = Any} in 193 194 finish act (sseq s1 (sseq (sassign tmp e1') (sassign e1' e3))) 194 195 tmp … … 206 207 let (s2, e2') = simpl e2 RHS in 207 208 finish act (sseq s1 s2) 208 {edesc = EBinop(op, e1', e2', ty); etyp = e.etyp }209 {edesc = EBinop(op, e1', e2', ty); etyp = e.etyp; espace = Any} 209 210 210 211  Oassign > … … 240 241  _ > assert false in 241 242 let e3 = 242 { edesc = EBinop(op', e11', e2', ty); etyp = ty } in243 { edesc = EBinop(op', e11', e2', ty); etyp = ty; espace = Any } in 243 244 begin match act with 244 245  Drop > … … 260 261 if is_simpl_expr e2 then begin 261 262 finish act s1 262 {edesc = EBinop(Ologand, e1', e2, ty); etyp = e.etyp }263 {edesc = EBinop(Ologand, e1', e2, ty); etyp = e.etyp; espace = e.espace} 263 264 end else begin 264 265 match act with … … 285 286 if is_simpl_expr e2 then begin 286 287 finish act s1 287 {edesc = EBinop(Ologor, e1', e2, ty); etyp = e.etyp }288 {edesc = EBinop(Ologor, e1', e2, ty); etyp = e.etyp; espace = e.espace} 288 289 end else begin 289 290 match act with … … 311 312 let (s1, e1') = simpl e1 RHS in 312 313 if is_simpl_expr e2 && is_simpl_expr e3 then begin 313 finish act s1 {edesc = EConditional(e1', e2, e3); etyp = e.etyp }314 finish act s1 {edesc = EConditional(e1', e2, e3); etyp = e.etyp; espace = e.espace} 314 315 end else begin 315 316 match act with … … 337 338 end else begin 338 339 let (s1, e1') = simpl e1 RHS in 339 finish act s1 {edesc = ECast(ty, e1'); etyp = e.etyp }340 finish act s1 {edesc = ECast(ty, e1'); etyp = e.etyp; espace = e.espace} 340 341 end 341 342 … … 343 344 let (s1, e1') = simpl e1 RHS in 344 345 let (s2, el') = simpl_list el in 345 let e2 = { edesc = ECall(e1', el'); etyp = e.etyp } in346 let e2 = { edesc = ECall(e1', el'); etyp = e.etyp; espace = e.espace } in 346 347 begin match act with 347 348  Drop > … … 482 483 let s_init = 483 484 {sdesc = Sdo {edesc = EBinop(Oassign, tmp, intconst 1L IInt, tmp.etyp); 484 etyp = tmp.etyp };485 etyp = tmp.etyp; espace = tmp.espace}; 485 486 sloc = s.sloc} in 486 487 {sdesc = Sfor(s_init, tmp, s', simpl_stmt s1); sloc = s.sloc}
Note: See TracChangeset
for help on using the changeset viewer.