Skip to content

Commit

Permalink
Merge pull request #25 from bamboo/ldftn-instance
Browse files Browse the repository at this point in the history
Introduce ldftn_instance
  • Loading branch information
tomlokhorst committed Oct 8, 2015
2 parents 33ac982 + d99424f commit ce34c32
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/Language/Cil/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module Language.Cil.Build (
, ldfld
, ldflda
, ldftn
, ldftn_instance
, ldind_i
, ldind_i1
, ldind_i2
Expand Down Expand Up @@ -339,8 +340,14 @@ ldfld p a t f = OpCode $ Ldfld p a t f
ldflda :: PrimitiveType -> AssemblyName -> TypeName -> FieldName -> MethodDecl
ldflda p a t f = OpCode $ Ldflda p a t f

ldftn_ :: [CallConv] -> PrimitiveType -> AssemblyName -> TypeName -> MethodName -> [PrimitiveType] -> MethodDecl
ldftn_ cc p a t m ps = OpCode $ Ldftn cc p a t m ps

ldftn :: PrimitiveType -> AssemblyName -> TypeName -> MethodName -> [PrimitiveType] -> MethodDecl
ldftn p a t m ps = OpCode $ Ldftn p a t m ps
ldftn = ldftn_ []

ldftn_instance :: PrimitiveType -> AssemblyName -> TypeName -> MethodName -> [PrimitiveType] -> MethodDecl
ldftn_instance = ldftn_ [CcInstance]

ldind_i :: MethodDecl
ldind_i = OpCode $ Ldind_i
Expand Down
2 changes: 1 addition & 1 deletion src/Language/Cil/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ instance Pretty OpCode where
pr (Ldelem_ref) = ("ldelem.ref " ++)
pr (Ldfld t a c f) = ("ldfld " ++) . pr t . sp . prFld a c f
pr (Ldflda t a c f) = ("ldflda " ++) . pr t . sp . prFld a c f
pr (Ldftn t a c m ps) = ("ldftn " ++) . pr t . sp . prCall a c m ps
pr (Ldftn cc t a c m ps) = ("ldftn " ++) . prList cc . pr t . sp . prCall a c m ps
pr (Ldind_i) = ("ldind.i " ++)
pr (Ldind_i1) = ("ldind.i1 " ++)
pr (Ldind_i2) = ("ldind.i2 " ++)
Expand Down
3 changes: 2 additions & 1 deletion src/Language/Cil/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ data OpCode
, fieldName :: FieldName -- ^ Name of the field.
} -- ^ Pops object reference, find address of specified field on the object, pushes address to the stack.
| Ldftn
{ returnType :: PrimitiveType -- ^ Return type of the method.
{ callConv :: [CallConv] -- ^ Method is associated with class or instance.
, returnType :: PrimitiveType -- ^ Return type of the method.
, assemblyName :: AssemblyName -- ^ Name of the assembly where the method resides.
, typeName :: TypeName -- ^ Name of the type of which the method is a member.
, methodName :: MethodName -- ^ Name of the method.
Expand Down

0 comments on commit ce34c32

Please sign in to comment.