Skip to content

Commit

Permalink
Merge pull request #19 from bamboo/unbox_any
Browse files Browse the repository at this point in the history
introduce unbox_any
  • Loading branch information
tomlokhorst committed Aug 3, 2015
2 parents 02917b6 + 18d55c7 commit 6cd8e1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Language/Cil/Build.hs
Expand Up @@ -129,6 +129,7 @@ module Language.Cil.Build (
, unaligned
, unalignedPtr
, unbox
, unbox_any
, volatile
, volatilePtr
, xor
Expand Down Expand Up @@ -205,6 +206,9 @@ box = OpCode . Box
unbox :: PrimitiveType -> MethodDecl
unbox = OpCode . Unbox

unbox_any :: PrimitiveType -> MethodDecl
unbox_any = OpCode . Unbox_any

br :: Label -> MethodDecl
br = OpCode . Br

Expand Down
1 change: 1 addition & 0 deletions src/Language/Cil/Pretty.hs
Expand Up @@ -294,6 +294,7 @@ instance Pretty OpCode where
pr (Unaligned a) = ("unaligned. " ++) . pr a
pr (UnalignedPtr a opcode) = ("unaligned. " ++) . pr a . sp . pr opcode
pr (Unbox t) = ("unbox " ++) . pr t
pr (Unbox_any t) = ("unbox.any " ++) . pr t
pr (Volatile) = ("volatile." ++)
pr (VolatilePtr opcode) = ("volatile. " ++) . pr opcode
pr (Xor) = ("xor" ++)
Expand Down
1 change: 1 addition & 0 deletions src/Language/Cil/Syntax.hs
Expand Up @@ -397,6 +397,7 @@ data OpCode
| Unaligned Alignment -- ^ Performs subsequent load or store operation under a weaker-than-usual alignment precondition.
| UnalignedPtr Alignment OpCode -- ^ Performs provided load or store operation under a weaker-than-usual alignment precondition.
| Unbox PrimitiveType -- ^ Pops 1 value, unboxes object reference, pushes value type.
| Unbox_any PrimitiveType -- ^ Pops 1 value, unboxes and loads value, equivalent to unbox followed by ldobj
| Volatile -- ^ Marks subsequent pointer reference as volatile, i.e. the value it points at can be modified from another thread.
| VolatilePtr OpCode -- ^ Marks provided pointer reference as volatile, i.e. the value it points at can be modified from another thread.
| Xor -- ^ Pops 2 values, do bitwise XOR between the values, pushes result.
Expand Down

0 comments on commit 6cd8e1c

Please sign in to comment.