Ignore:
Timestamp:
Apr 15, 2016, 12:03:11 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
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, with_gc
Children:
29ad0ac
Parents:
c5833e8 (diff), 37f0da8 (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 gc_noraii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rc5833e8 r0f9e4403  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Expression.cc -- 
     7// Expression.cc --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Dec 09 14:10:29 2015
    13 // Update Count     : 34
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Apr  8 17:16:23 2016
     13// Update Count     : 40
    1414//
    1515
     
    2222
    2323#include "Type.h"
     24#include "Initializer.h"
    2425#include "Expression.h"
    2526#include "Declaration.h"
     
    211212
    212213        os << " of ";
     214
     215        if ( type ) {
     216                type->print(os, indent + 2);
     217        } else {
     218                os << "<NULL>";
     219        }
     220
     221        os << std::endl;
     222        Expression::print( os, indent );
     223}
     224
     225OffsetPackExpr::OffsetPackExpr( StructInstType *type_, Expression *aname_ ) : Expression( aname_ ), type( type_ ) {
     226        add_result( new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0, false, false ) );
     227}
     228
     229OffsetPackExpr::OffsetPackExpr( const OffsetPackExpr &other ) : Expression( other ), type( maybeClone( other.type ) ) {}
     230
     231OffsetPackExpr::~OffsetPackExpr() { delete type; }
     232
     233void OffsetPackExpr::print( std::ostream &os, int indent ) const {
     234        os << std::string( indent, ' ' ) << "Offset pack expression on ";
    213235
    214236        if ( type ) {
     
    422444}
    423445
     446AsmExpr::AsmExpr( const AsmExpr & other ) : inout( maybeClone( other.inout ) ), constraint( maybeClone( other.constraint ) ), operand( maybeClone( other.operand ) ) {}
     447
     448
    424449void AsmExpr::print( std::ostream &os, int indent ) const {
    425450        os << "Asm Expression: " << std::endl;
     
    429454}
    430455
     456UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}
     457
     458UntypedValofExpr::~UntypedValofExpr() { delete body; }
     459
    431460void UntypedValofExpr::print( std::ostream &os, int indent ) const {
    432461        os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl;
     
    434463                get_body()->print( os, indent + 2 );
    435464}
     465
     466
     467CompoundLiteralExpr::CompoundLiteralExpr( Type * type, Initializer * initializer ) : type( type ), initializer( initializer ) {
     468        add_result( type->clone() );
     469}
     470
     471CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), type( maybeClone( other.type ) ), initializer( maybeClone( other.initializer ) ) {}
     472
     473CompoundLiteralExpr::~CompoundLiteralExpr() {
     474        delete initializer;
     475        delete type;
     476}
     477
     478void CompoundLiteralExpr::print( std::ostream &os, int indent ) const {
     479        os << "Compound Literal Expression: " << std::endl;
     480        if ( type ) type->print( os, indent + 2 );
     481        if ( initializer ) initializer->print( os, indent + 2 );
     482}
     483
    436484
    437485std::ostream & operator<<( std::ostream & out, Expression * expr ) {
Note: See TracChangeset for help on using the changeset viewer.