Changes between Version 113 and Version 114 of IR
- Timestamp:
- 12/02/15 11:20:55 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR
v113 v114 39 39 varopts: '[' varopt+ ']' ; 40 40 varopt: 'input' | 'output' ; 41 fundef: 'fun' funopts? ID '(' paramlist ')' ':' typeNameconclause* block ;41 fundef: 'fun' funopts? ID '(' paramlist ')' (':' typeName)? conclause* block ; 42 42 funopts: '[' funopt+ ']' ; 43 43 conclause : 'assigns' expr ';' … … 128 128 * `Array[T]` : arrays of any length whose elements belong to T 129 129 * Note: there is also a dynamic type `Array[T,n]`, signifying arrays of length n. That is a subtype of the dynamic type of `Array[T]`. 130 * `Function[<T0,T1,...>,T]` : functions consuming `T0`,`T1`,... and returning `T`. `T` can be `void` to indicate nothing is returned. 130 * `Function[<T0,T1,...>,T]` : functions consuming `T0`,`T1`,... and returning `T`. 131 * `T` can be absent. `Function[<T0,T1,...>]` means the function returns nothing. 131 132 * `Mem` : type representing a memory set. May be thought of as a set of pointers. 132 133 * `Pointer` : all pointers, a subtype of `Mem` … … 332 333 * `PARSPAWN p, d, f;` : spawn a sequence of procs 333 334 * `p` has type `Pointer[Proc]`, `d` has `Domain` type and `f` has `Function` type. 335 336 The CIVL-C code `$parfor(int i,j: dom) S;` is translated into the following: 337 {{{ 338 var i:Integer; 339 var j:Integer; 340 var p:Array[Proc]; 341 342 fun f() 343 { 344 S; 345 } 346 347 PARSPAWN addr(asub(p,0)), dom, f; 348 WAITALL addr(asub(p,0)), domsize(dom); 349 }}} 350 334 351 * `NEXT <i,j,...>, dom, flag;` : move to next element in domain 335 352 * `i`,`j`,... have integral types … … 389 406 } 390 407 }}} 408 409 To specify a function returning nothing, simply leave out the return type part. For example: `fun foo(x:Intger, ...) {...}`. 391 410 392 411
