@@ -20,21 +20,6 @@ let pfailwith s =
2020 stderr.WriteLine ("*** error: "+s);
2121 raise Parsing.RecoverableParseError
2222
23- /// vararg sentinels
24- type SigArg = SigArg of (string option * ILType) | Sentinel
25-
26- let decodeVarargs args =
27- let rec normals = function
28- | [] -> ([],None)
29- | Sentinel :: t -> ([],Some (varargs t))
30- | SigArg (_,p) :: t -> let (n,r) = normals t in (p :: n, r)
31- and varargs = function
32- | [] -> []
33- | SigArg (_,ty) :: t -> let l = varargs t in ty :: l
34- | Sentinel :: t -> pfailwith "two sentinels in vararg call"
35- normals args
36-
37-
3823type ResolvedAtMethodSpecScope<'T> =
3924 ResolvedAtMethodSpecScope of (ILGenericParameterDefs -> 'T)
4025
@@ -43,11 +28,6 @@ let resolveMethodSpecScope (ResolvedAtMethodSpecScope f) x = f x
4328let resolveMethodSpecScopeThen (ResolvedAtMethodSpecScope f) g =
4429 ResolvedAtMethodSpecScope (fun x -> resolveMethodSpecScope (g(f x)) x)
4530
46- let resolveFormalMethodSpecScope tspeco obj =
47- match tspeco with
48- None -> resolveMethodSpecScope obj mkILEmptyGenericParams
49- | Some (tspec:ILTypeSpec) -> resolveMethodSpecScope obj (mkILFormalTypars tspec.GenericArgs)
50-
5131let resolveCurrentMethodSpecScope obj =
5232 resolveMethodSpecScope obj mkILEmptyGenericParams
5333
@@ -75,7 +55,6 @@ let findAssemblyRef nm =
7555%token <Int32Int32Instr> INSTR_I32_I32
7656%token <Int64Instr> INSTR_I8
7757%token <DoubleInstr> INSTR_R
78- %token <MethodSpecInstr> INSTR_METHOD
7958%token <NoArgInstr> INSTR_NONE
8059%token <StringInstr> INSTR_STRING
8160%token <TokenInstr> INSTR_TOK
@@ -163,18 +142,6 @@ instrs2:
163142 { $1 :: $2 }
164143 | { [] }
165144
166-
167-
168- methodSpecMaybeArrayMethod:
169- callConv typ typSpec DCOLON methodName opt_actual_tyargs LPAREN sigArgs0 RPAREN
170- { let callee_class_typ : ILType = resolveCurrentMethodSpecScope $3
171- let gscope = (if isILArrTy callee_class_typ then None else Some callee_class_typ.TypeSpec)
172- let argtys_n_varargs = resolveFormalMethodSpecScope gscope $8
173- let (argtys,varargs) = decodeVarargs argtys_n_varargs
174- let minst = resolveCurrentMethodSpecScope $6
175- let callee_retty = resolveFormalMethodSpecScope gscope $2
176- (callee_class_typ, $1, $5, argtys, callee_retty, minst), varargs }
177-
178145instr:
179146 INSTR_NONE
180147 { ($1 ()) }
@@ -188,19 +155,6 @@ instr:
188155 { ($1 (ILConst.R8 $2)) }
189156 | INSTR_R int64
190157 { ($1 (ILConst.R8 (float $2))) }
191- | INSTR_METHOD methodSpecMaybeArrayMethod
192- {
193- let ((encl_typ, _cc, nm, _argtys, _retty, _minst) as data),varargs = $2
194- if isILArrTy encl_typ then
195- let (shape,ty) = destILArrTy encl_typ
196- match nm with
197- | "Get" -> I_ldelem_any(shape,ty)
198- | "Set" -> I_stelem_any(shape,ty)
199- | "Address" -> I_ldelema(NormalAddress,false,shape,ty)
200- | ".ctor" -> I_newarr(shape,ty)
201- | _ -> failwith "bad method on array type"
202- else
203- $1 (mkILMethSpecInTy data, varargs) }
204158 | INSTR_TYPE typSpec
205159 { $1 (resolveCurrentMethodSpecScope $2) }
206160 | INSTR_INT_TYPE int32 typSpec
@@ -209,34 +163,6 @@ instr:
209163 { $1 (resolveCurrentMethodSpecScope $2) }
210164 | INSTR_TOK typSpec
211165 { ($1 (ILToken.ILType (resolveCurrentMethodSpecScope $2))) }
212-
213- /*-----------------------------------------------
214- * Formal signatures of methods etc.
215- *---------------------------------------------*/
216-
217- sigArgs0:
218- { noMethodSpecScope [] }
219- | sigArgs1 { $1 }
220-
221- sigArgs1:
222- sigArgs1a
223- { ResolvedAtMethodSpecScope (fun c -> List.map (fun obj -> resolveMethodSpecScope obj c) (List.rev $1)) }
224-
225- sigArgs1a:
226- sigArg
227- { [$1] }
228- | sigArgs1a COMMA sigArg
229- { $3 :: $1 }
230-
231- sigArg:
232- | typ opt_id
233- { resolveMethodSpecScopeThen $1 (fun ty ->
234- noMethodSpecScope (SigArg($2, ty))) }
235-
236-
237-
238- opt_id: { None } | id { Some $1 }
239-
240166
241167/*-----------------------------------------------
242168 * Type names
0 commit comments