Ignore:
Timestamp:
Jun 15, 2015, 12:45:26 PM (11 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
94b4364
Parents:
ea9b9d3 (diff), a1d5d2a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into resolver

Conflicts:

src/CodeGen/CodeGenerator.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tests/Attributes.c

    rea9b9d3 rb5b0907  
     1// I Compile-time resolution
     2// =========================
     3//
     4// 1. an isolated name, where the argument is implicitly determined by the result context
     5//
     6//    @max
     7//
     8// 2. a direct application to a manifest type
     9//
     10//    @max( int )
     11//
     12// 3. constraining a type variable; the application is implicitly performed at the call site as in (2)
     13//
     14//    forall( type T | { T @max( T ); } ) T x( T t );
     15//
     16//
     17// II Run-time resolution
     18// ======================
     19//
     20// 1. an indirect reference, where the argument is implicitly determined by the result context
     21//
     22//    attr_var = &@max;
     23//    x = (*attr_var);
     24//
     25// 2. an indirect application to a manifest type
     26//
     27//    (*attr_var)( int )
     28//
     29// 3. a direct application to a type variable
     30//
     31//    @max( T )
     32//
     33// Under what circumstances can this be done at compile/link time?
     34//
     35//
     36// III Declaration forms
     37// =====================
     38//
     39// 1. monomorphic with implicit argument
     40//
     41//    int @max;
     42//
     43// 2. monomorphic with explicit argument
     44//
     45//    int @max( int );
     46//
     47// 3. polymorphic
     48//
     49//    forall( type T | constraint( T ) ) int @attr( T );
     50
    151int @max = 3;
    252
    353int main() {
    454    int x;
    5     type @type(type t);         // compiler intrinsic
     55    type @type(type t);                                                                 // compiler intrinsic
    656    type @widest(type t);
    7     @type(x) *y;                // gcc: typeof(x) *y;
    8     const @widest(double) *w;   // gcc: const typeof(x) *w;
    9     * @type(3 + 4) z;           // cfa declaration syntax
     57    @type(x) *y;                                                                                // gcc: typeof(x) *y;
     58    const @widest(double) *w;                                                   // gcc: const typeof(x) *w;
     59    * @type(3 + 4) z;                                                                   // cfa declaration syntax
    1060    y = @max;           
    1161    z = @max(x) + @size(int);
Note: See TracChangeset for help on using the changeset viewer.