Changeset 8e4bc30 for src/SynTree


Ignore:
Timestamp:
Oct 8, 2020, 12:45:43 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8fc9a5f, baee756
Parents:
391c065 (diff), 6fbe9a5 (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/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/AggregateDecl.cc

    r391c065 r8e4bc30  
    2121#include "Common/utility.h"      // for printAll, cloneAll, deleteAll
    2222#include "Declaration.h"         // for AggregateDecl, TypeDecl, Declaration
     23#include "Expression.h"
    2324#include "Initializer.h"
    2425#include "LinkageSpec.h"         // for Spec, linkageName, Cforall
     
    8889const char * StructDecl::typeString() const { return aggrString( kind ); }
    8990
     91StructInstType * StructDecl::makeInst( std::list< Expression * > const & new_parameters ) {
     92        std::list< Expression * > copy_parameters;
     93        cloneAll( new_parameters, copy_parameters );
     94        return makeInst( move( copy( copy_parameters ) ) );
     95}
     96
     97StructInstType * StructDecl::makeInst( std::list< Expression * > && new_parameters ) {
     98        assert( parameters.size() == new_parameters.size() );
     99        StructInstType * type = new StructInstType( noQualifiers, this );
     100        type->parameters = std::move( new_parameters );
     101        return type;
     102}
     103
    90104const char * UnionDecl::typeString() const { return aggrString( Union ); }
    91105
  • src/SynTree/Declaration.h

    r391c065 r8e4bc30  
    306306        bool is_thread   () { return kind == Thread   ; }
    307307
     308        // Make a type instance of this declaration.
     309        StructInstType * makeInst( std::list< Expression * > const & parameters );
     310        StructInstType * makeInst( std::list< Expression * > && parameters );
     311
    308312        virtual StructDecl * clone() const override { return new StructDecl( *this ); }
    309313        virtual void accept( Visitor & v ) override { v.visit( this ); }
Note: See TracChangeset for help on using the changeset viewer.