Changes between Version 112 and Version 113 of IR2
- Timestamp:
- 05/29/21 00:06:02 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR2
v112 v113 265 265 expr-pair-list: expr-pair (',' expr-pair)* ; 266 266 expr-pair: '{' expr ',' expr '}' ; 267 267 268 }}} 268 269 … … 299 300 For a complete type T, the "undef-initializer" for T is defined as follows: if T is not an array type, the undef-initializer is defined exactly as above: either the symbolic constant `UNDEF` or a concrete struct of `UNDEF`s. If T is the complete array type S[n], the undef-initializer is the array-lambda expression with length n and defining expression the undef-initializer for S. 300 301 301 `$new _array(n,T)` returns the undef-initializer for T[n].302 `$new(T[n])` returns the undef-initializer for `T[n]`. 302 303 303 304 Evaluation of `$defined(expr)` returns `!FORALL UNDEF:T . expr == UNDEF`, where `T` is the type of `expr`. … … 341 342 could be modeled as 342 343 {{{ 343 $int * p = $undef;344 $int (*p1)[] = $undef; // pointer to array of $int345 p1 = $alloc(&heap, $new _array(10, $int));346 p = ($int*)p1; // equivalently, p =&(*p1)[0];344 $int * p; 345 $int (*p1)[]; // pointer to array of $int 346 p1 = $alloc(&heap, $new($int[10])); 347 p = &(*p1)[0]; 347 348 }}} 348 349
