Changeset 665f432 for src/AST


Ignore:
Timestamp:
Nov 20, 2019, 6:55:39 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
1a69a90, 9802f4c
Parents:
57c764c
Message:

Fixed trac #149 where operand names in asm statements where incorrectly resolved (i.e., should not have been resolved)

Location:
src/AST
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r57c764c r665f432  
    887887                auto expr = visitBaseExpr( node,
    888888                        new AsmExpr(
    889                                 get<Expression>().accept1(node->inout),
     889                                new std::string(node->inout),
    890890                                get<Expression>().accept1(node->constraint),
    891891                                get<Expression>().accept1(node->operand)
     
    22582258                        new ast::AsmExpr(
    22592259                                old->location,
    2260                                 GET_ACCEPT_1(inout, Expr),
     2260                                old->inout,
    22612261                                GET_ACCEPT_1(constraint, Expr),
    22622262                                GET_ACCEPT_1(operand, Expr)
  • src/AST/Expr.hpp

    r57c764c r665f432  
    556556class AsmExpr final : public Expr {
    557557public:
    558         ptr<Expr> inout;
     558        std::string inout;
    559559        ptr<Expr> constraint;
    560560        ptr<Expr> operand;
    561561
    562         AsmExpr( const CodeLocation & loc, const Expr * io, const Expr * con, const Expr * op )
     562        AsmExpr( const CodeLocation & loc, const std::string & io, const Expr * con, const Expr * op )
    563563        : Expr( loc ), inout( io ), constraint( con ), operand( op ) {}
    564564
  • src/AST/Pass.impl.hpp

    r57c764c r665f432  
    13001300                        maybe_accept( node, &AsmExpr::result );
    13011301                }
    1302                 maybe_accept( node, &AsmExpr::inout      );
    13031302                maybe_accept( node, &AsmExpr::constraint );
    13041303                maybe_accept( node, &AsmExpr::operand    );
  • src/AST/Print.cpp

    r57c764c r665f432  
    10111011                os << "Asm Expression:" << endl;
    10121012                ++indent;
    1013                 if ( node->inout ) node->inout->accept( *this );
     1013                if ( !node->inout.empty() ) os << "[" << node->inout << "] ";
    10141014                if ( node->constraint ) node->constraint->accept( *this );
    10151015                if ( node->operand ) node->operand->accept( *this );
Note: See TracChangeset for help on using the changeset viewer.