Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rea6332d r4d4e5de  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 25 14:15:47 2017
    13 // Update Count     : 54
     12// Last Modified On : Thu Mar 30 16:41:13 2017
     13// Update Count     : 52
    1414//
    1515
    16 #include "SynTree/Expression.h"
    17 
    18 #include <cassert>                   // for assert, assertf
    19 #include <iostream>                  // for ostream, operator<<, basic_ostream
    20 #include <list>                      // for list, _List_iterator, list<>::co...
    21 
    22 #include "Common/utility.h"          // for maybeClone, cloneAll, deleteAll
    23 #include "Declaration.h"             // for ObjectDecl, DeclarationWithType
    24 #include "Expression.h"              // for Expression, ImplicitCopyCtorExpr
    25 #include "InitTweak/InitTweak.h"     // for getCallArg, getPointerBase
    26 #include "Initializer.h"             // for Designation, Initializer
    27 #include "Statement.h"               // for CompoundStmt, ExprStmt, Statement
    28 #include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
    29 #include "SynTree/Constant.h"        // for Constant
    30 #include "Type.h"                    // for Type, BasicType, Type::Qualifiers
    31 #include "TypeSubstitution.h"        // for TypeSubstitution
     16#include <iostream>
     17#include <cassert>
     18#include <list>
     19#include <algorithm>
     20
     21#include <iterator>
     22
     23#include "Declaration.h"
     24#include "Expression.h"
     25#include "Initializer.h"
     26#include "Statement.h"
     27#include "Type.h"
     28#include "TypeSubstitution.h"
     29#include "VarExprReplacer.h"
     30
     31#include "Common/utility.h"
     32#include "Common/PassVisitor.h"
     33
     34#include "InitTweak/InitTweak.h"
    3235
    3336
     
    295298        if ( result->isVoid() ) {
    296299                os << "nothing";
    297         } else {
    298                 result->print( os, indent+2 );
    299         } // if
    300         os << std::endl;
    301         Expression::print( os, indent );
    302 }
    303 
    304 VirtualCastExpr::VirtualCastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) {
    305         set_result(toType);
    306 }
    307 
    308 VirtualCastExpr::VirtualCastExpr( const VirtualCastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) {
    309 }
    310 
    311 VirtualCastExpr::~VirtualCastExpr() {
    312         delete arg;
    313 }
    314 
    315 void VirtualCastExpr::print( std::ostream &os, int indent ) const {
    316         os << "Virtual Cast of:" << std::endl << std::string( indent+2, ' ' );
    317         arg->print(os, indent+2);
    318         os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
    319         os << std::string( indent+2, ' ' );
    320         if ( ! result ) {
    321                 os << "unknown";
    322300        } else {
    323301                result->print( os, indent+2 );
Note: See TracChangeset for help on using the changeset viewer.