Changeset 204358b for src/AST/porting.md
- Timestamp:
- May 16, 2019, 2:57:41 PM (5 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/porting.md
r10248ae0 r204358b 6 6 * specialization: strong pointer `ast::ptr<T>` is used for an ownership relationship 7 7 * 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 9 27 10 28 ## Visitors ## … … 106 124 * allows `newObject` as just default settings 107 125 126 `NamedTypeDecl` 127 * `parameters` => `params` 128 108 129 `TypeDecl` 109 130 * moved `TypeDecl::Kind` to `ast::TypeVar::Kind` 131 132 `AggregateDecl` 133 * `parameters` => `params` 110 134 111 135 `EnumDecl` … … 115 139 * Merged `inferParams`/`resnSlots` into union, as suggested by comment in old version 116 140 * 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 `||` 117 167 118 168 `Init` … … 148 198 `Type` 149 199 * `CV::Qualifiers` moved to end of constructor parameter list, defaulted to `{}` 200 * removed getter, setter in favour of public `qualifiers` field 150 201 * `ReferenceToType` puts a defaulted list of attributes after qualifiers 151 202 * `forall` field split off into `ParameterizedType` subclass … … 160 211 * `getAggr()` => `aggr()` 161 212 * also now returns `const AggregateDecl *` 162 * `genericSubstitution()` moved to own visitor **TODO** write213 * `genericSubstitution()` moved to own visitor in `AST/GenericSubstitution.hpp` **TODO** write 163 214 164 215 `BasicType` … … 167 218 `ReferenceToType` 168 219 * deleted `get_baseParameters()` from children 169 * replace with `aggr() ? aggr()->parameters : nullptr` 220 * replace with `aggr() ? aggr()->params : nullptr` 221 * `parameters` => `params` 170 222 * hoisted `lookup` implementation into parent, made non-virtual 171 223 * also changed to return vector rather than filling; change back if any great win for reuse … … 178 230 179 231 `FunctionType` 232 * `returnVals` => `returns` 233 * `parameters` => `params` 180 234 * `bool isVarArgs;` => `enum ArgumentFlag { FixedArgs, VariableArgs }; ArgumentFlag isVarArgs;` 181 235
Note: See TracChangeset
for help on using the changeset viewer.