summaryrefslogtreecommitdiff
path: root/cparser/Bitfields.ml
diff options
context:
space:
mode:
Diffstat (limited to 'cparser/Bitfields.ml')
-rw-r--r--cparser/Bitfields.ml24
1 files changed, 2 insertions, 22 deletions
diff --git a/cparser/Bitfields.ml b/cparser/Bitfields.ml
index 5ab4eb4..ff4c0c6 100644
--- a/cparser/Bitfields.ml
+++ b/cparser/Bitfields.ml
@@ -15,8 +15,8 @@
(* Elimination of bit fields in structs *)
-(* Assumes: unblocked, simplified code.
- Preserves: unblocked, simplified code. *)
+(* Assumes: unblocked code.
+ Preserves: unblocked code. *)
open Printf
open Machine
@@ -201,26 +201,6 @@ let bitfield_assign bf carrier newval =
{edesc = EBinop(Oor, oldval_masked, newval_masked, TInt(IUInt,[]));
etyp = TInt(IUInt,[])}
-(* Detect invariant l-values *)
-
-let rec invariant_lvalue e =
- match e.edesc with
- | EVar _ -> true
- | EUnop(Oderef, {edesc = EVar _}) -> true (* to check *)
- | EUnop(Odot _, e1) -> invariant_lvalue e1
- | _ -> false
-
-(* Bind a l-value to a temporary variable if it is not invariant. *)
-
-let bind_lvalue e fn =
- if invariant_lvalue e then
- fn e
- else begin
- let tmp = new_temp (TPtr(e.etyp, [])) in
- ecomma (eassign tmp (eaddrof e))
- (fn {edesc = EUnop(Oderef, tmp); etyp = e.etyp})
- end
-
(* Transformation of operators *)
let op_for_incr_decr = function