Changeset be567e9 for src/AST


Ignore:
Timestamp:
May 15, 2019, 10:15:52 AM (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:
54db6ba, 69bafd2
Parents:
6d51bd7 (diff), 62315a0 (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

Location:
src/AST
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Node.hpp

    r6d51bd7 rbe567e9  
    139139        operator const node_t * const() const { return node; }
    140140
     141        template<typename o_node_t>
     142        const o_node_t * as() const { return dynamic_cast<o_node_t *>(node); }
     143
    141144        using ptr = const node_t *;
    142145
  • src/AST/porting.md

    r6d51bd7 rbe567e9  
    33## Pointer Types ##
    44* raw pointer `T*` is used for construction, but not storage
    5 * strong pointer `ast::ptr<T>` is used for an ownership relationship
    6 * weak pointer `ast::readonly<T>` is used for an observation relationship
     5* `ast::ptr_base<T,R>` is a pointer to AST node `T` with reference type `R`
     6  * specialization: strong pointer `ast::ptr<T>` is used for an ownership relationship
     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)`
    79
    810## Visitors ##
     
    6062* Strong justification required for private fields
    6163  * No `get_` prefix on getters (including for generated fields)
     64    * exception is `DeclWithType::get_type()`
    6265* Notable changes:
    6366  * for concision and consistency with subclasses:
     
    112115* Still a `std::list` for children, rather than `std::vector`
    113116  * allows more-efficient splicing for purposes of later code generation
     117
     118`Type`
     119* `forall` field split off into `ParameterizedType` subclass
     120  * any type that needs it can inherit from `ParameterizedType`
     121* `get_qualifiers()` replaced with accessor `qualifiers()` and mutator `set_qualifiers()`
     122  * `get_CV()` replaced with `is_CV()` variants
     123* A number of features only supported on aggregates pushed down to `ReferenceToType`:
     124  * `attributes`: per docs [1] GCC only supports type attributes on aggregates and typedefs
     125    * suggest adding a `TypeWithAttributes` wrapper type if this proves insufficient
     126  * `getAggr()`
     127  * `genericSubstitution()`
     128
     129`BasicType`
     130* does not inherit from `Type` to allow pointer inlining
     131* moved `Kind` before qualifiers in constructor to allow for default
     132* **TODO** move `kind`, `typeNames` into code generator
     133
     134[1] https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc/Type-Attributes.html#Type-Attributes
     135
Note: See TracChangeset for help on using the changeset viewer.