Ignore:
Timestamp:
Jul 26, 2017, 2:44:09 PM (7 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
2edd80ae
Parents:
b947fb2
Message:

Virtual casts have been added. They still require a lot of hand coded support to work but for simple cases it should be enough.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rb947fb2 ra5f0529  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 30 16:41:13 2017
    13 // Update Count     : 52
     12// Last Modified On : Tue Jul 25 14:15:47 2017
     13// Update Count     : 54
    1414//
    1515
     
    298298        if ( result->isVoid() ) {
    299299                os << "nothing";
     300        } else {
     301                result->print( os, indent+2 );
     302        } // if
     303        os << std::endl;
     304        Expression::print( os, indent );
     305}
     306
     307VirtualCastExpr::VirtualCastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) {
     308        set_result(toType);
     309}
     310
     311VirtualCastExpr::VirtualCastExpr( const VirtualCastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) {
     312}
     313
     314VirtualCastExpr::~VirtualCastExpr() {
     315        delete arg;
     316}
     317
     318void VirtualCastExpr::print( std::ostream &os, int indent ) const {
     319        os << "Virtual Cast of:" << std::endl << std::string( indent+2, ' ' );
     320        arg->print(os, indent+2);
     321        os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
     322        os << std::string( indent+2, ' ' );
     323        if ( ! result ) {
     324                os << "unknown";
    300325        } else {
    301326                result->print( os, indent+2 );
     
    503528}
    504529
    505 AsmExpr::AsmExpr( const AsmExpr & other ) : inout( maybeClone( other.inout ) ), constraint( maybeClone( other.constraint ) ), operand( maybeClone( other.operand ) ) {}
     530AsmExpr::AsmExpr( const AsmExpr & other ) : Expression( other ), inout( maybeClone( other.inout ) ), constraint( maybeClone( other.constraint ) ), operand( maybeClone( other.operand ) ) {}
    506531
    507532
Note: See TracChangeset for help on using the changeset viewer.