Ignore:
Timestamp:
Jul 30, 2015, 3:56:18 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, string, with_gc
Children:
093f1a0
Parents:
51b986f
Message:

asm statement, memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ExpressionNode.cc

    r51b986f r7f5566b  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:17:07 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Jun 24 16:20:00 2015
    13 // Update Count     : 158
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul 30 14:53:23 2015
     13// Update Count     : 188
    1414//
    1515
     
    4242}
    4343
    44 ExpressionNode * ExpressionNode::set_asArgName( const std::string *aName ) {
     44ExpressionNode * ExpressionNode::set_argName( const std::string *aName ) {
    4545        argName = new VarRefNode( aName );
    4646        return this;
    4747}
    4848
    49 ExpressionNode * ExpressionNode::set_asArgName( ExpressionNode *aDesignator ) {
     49ExpressionNode * ExpressionNode::set_argName( ExpressionNode *aDesignator ) {
    5050        argName = aDesignator;
    5151        return this;
     
    210210        assert( type == String );
    211211
    212         // "abc" "def" "ghi" => "abcdefghi", so remove new text from quotes and insert before last quote in old string.
     212        // "abc" "def" "ghi" => "abcdefghi", remove new text from quotes and insert before last quote in old string.
    213213        value.insert( value.length() - 1, newValue->substr( 1, newValue->length() - 2 ) );
    214214       
     
    330330//##############################################################################
    331331
    332 CompositeExprNode::CompositeExprNode( void ) : ExpressionNode(), function( 0 ), arguments( 0 ) {
     332CompositeExprNode::CompositeExprNode() : ExpressionNode(), function( 0 ), arguments( 0 ) {
    333333}
    334334
     
    541541                {
    542542                        assert( args.size() == 3);
    543                         std::list< Expression* >::const_iterator i = args.begin();
     543                        std::list< Expression * >::const_iterator i = args.begin();
    544544                        Expression *arg1 = notZeroExpr( *i++ );
    545545                        Expression *arg2 = *i++;
     
    552552                {
    553553                        assert( args.size() == 2);
    554                         std::list< Expression* >::const_iterator i = args.begin();
     554                        std::list< Expression * >::const_iterator i = args.begin();
    555555                        Expression *ret = *i++;
    556556                        while ( i != args.end() ) {
     
    617617                set_args( arg );
    618618}
     619
     620//##############################################################################
     621
     622Expression *AsmExprNode::build() const {
     623        return new AsmExpr( maybeBuild< Expression >( inout ), (ConstantExpr *)constraint->build(), operand->build() );
     624}
     625
     626void AsmExprNode::print( std::ostream &os, int indent ) const {
     627        os << string( indent, ' ' ) << "Assembler Expression:" << endl;
     628        if ( inout ) {
     629                os << string( indent, ' ' ) << "inout: " << std::endl;
     630                inout->print( os, indent + 2 );
     631        } // if
     632        if ( constraint ) {
     633                os << string( indent, ' ' ) << "constraint: " << std::endl;
     634                constraint->print( os, indent + 2 );
     635        } // if
     636        if ( operand ) {
     637                os << string( indent, ' ' ) << "operand: " << std::endl;
     638                operand->print( os, indent + 2 );
     639        } // if
     640}
     641
     642void AsmExprNode::printOneLine( std::ostream &os, int indent ) const {
     643        printDesignation( os );
     644        os << "( ";
     645        if ( inout ) inout->printOneLine( os, indent + 2 );
     646        os << ", ";
     647        if ( constraint ) constraint->printOneLine( os, indent + 2 );
     648        os << ", ";
     649        if ( operand ) operand->printOneLine( os, indent + 2 );
     650        os << ") ";
     651}
     652
     653//##############################################################################
     654
     655void LabelNode::print( std::ostream &os, int indent ) const {}
     656
     657void LabelNode::printOneLine( std::ostream &os, int indent ) const {}
    619658
    620659//##############################################################################
Note: See TracChangeset for help on using the changeset viewer.