Changeset 204358b for src/AST/porting.md


Ignore:
Timestamp:
May 16, 2019, 2:57:41 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b336af9
Parents:
10248ae0 (diff), f3cc5b6 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/porting.md

    r10248ae0 r204358b  
    66  * specialization: strong pointer `ast::ptr<T>` is used for an ownership relationship
    77  * specialization: weak pointer `ast::readonly<T>` is used for an observation relationship
    8   * added `ast::ptr_base<T,R>::as<S>()` with same semantics as `dynamic_cast<S*>(p)`
     8* added `ast::ptr_base<T,R>::as<S>()` with same semantics as `dynamic_cast<S*>(p)`
     9* added `N * ast::ptr_base<N,R>::set_and_mutate( const N * n )`
     10  * takes ownership of `n`, then returns a mutable version owned by this pointer
     11  * Some debate on whether this is a good approach:
     12    * makes an easy path to cloning, which we were trying to eliminate
     13      * counter-point: these are all mutating clones rather than lifetime-preserving clones, and thus "necessary" (for some definition)
     14    * existing uses:
     15      * `VariableExpr::VariableExpr`, `UntypedExpr::createDeref`
     16        * both involve grabbing a type from elsewhere and making an `lvalue` copy of it
     17        * could potentially be replaced by a view class something like this:
     18          ```
     19          template<unsigned Quals>
     20          class AddQualifiersType final : public Type {
     21            readonly<Type> base;
     22            // ...
     23          };
     24          ```
     25          * requires all `qualifiers` use (and related helpers) to be virtual, non-zero overhead
     26          * also subtle semantic change, where mutations to the source decl now change the viewing expression
    927
    1028## Visitors ##
     
    106124  * allows `newObject` as just default settings
    107125
     126`NamedTypeDecl`
     127* `parameters` => `params`
     128
    108129`TypeDecl`
    109130* moved `TypeDecl::Kind` to `ast::TypeVar::Kind`
     131
     132`AggregateDecl`
     133* `parameters` => `params`
    110134
    111135`EnumDecl`
     
    115139* Merged `inferParams`/`resnSlots` into union, as suggested by comment in old version
    116140  * does imply get_/set_ API, and some care about moving backward
     141* added constructor that sets result, for benefit of types that set it directly
     142
     143`ApplicationExpr`
     144* `function` => `func`
     145
     146`UntypedExpr`
     147* `function` => `func`
     148* removed `begin_args()` in favour of `args.begin()`
     149
     150`MemberExpr`
     151* **TODO** port setup of `result` in constructor
     152
     153`ConstantExpr`
     154* inlined features of `Constant`, never used elsewhere, so removed `Constant`
     155  * `Constant Constant::from_int(int)` etc. => `ConstantExpr * ConstantExpr::from_int(CodeLocation, int)`
     156    * allocates new `ConstantExpr`, consistent with all existing uses
     157
     158`SizeofExpr`, `AlignofExpr`
     159* `isType` deprecated in favour of boolean check on `type`
     160  * all existing uses assume `type` set if true and don't use `expr`
     161
     162`AttrExpr`
     163* did not port due to feature deprecation (e.g. `expr@attribute`)
     164
     165`LogicalExpr`
     166* un-defaulted constructor parameter determining `&&` or `||`
    117167
    118168`Init`
     
    148198`Type`
    149199* `CV::Qualifiers` moved to end of constructor parameter list, defaulted to `{}`
     200  * removed getter, setter in favour of public `qualifiers` field
    150201  * `ReferenceToType` puts a defaulted list of attributes after qualifiers
    151202* `forall` field split off into `ParameterizedType` subclass
     
    160211  * `getAggr()` => `aggr()`
    161212    * also now returns `const AggregateDecl *`
    162 * `genericSubstitution()` moved to own visitor **TODO** write
     213* `genericSubstitution()` moved to own visitor in `AST/GenericSubstitution.hpp` **TODO** write
    163214
    164215`BasicType`
     
    167218`ReferenceToType`
    168219* deleted `get_baseParameters()` from children
    169   * replace with `aggr() ? aggr()->parameters : nullptr`
     220  * replace with `aggr() ? aggr()->params : nullptr`
     221* `parameters` => `params`
    170222* hoisted `lookup` implementation into parent, made non-virtual
    171223  * also changed to return vector rather than filling; change back if any great win for reuse
     
    178230
    179231`FunctionType`
     232* `returnVals` => `returns`
     233* `parameters` => `params`
    180234* `bool isVarArgs;` => `enum ArgumentFlag { FixedArgs, VariableArgs }; ArgumentFlag isVarArgs;`
    181235
Note: See TracChangeset for help on using the changeset viewer.