Ignore:
Timestamp:
Jan 23, 2018, 5:46:43 PM (8 years ago)
Author:
Alan Kennedy <afakenne@…>
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:
258e6ad5
Parents:
b158d8f (diff), 15d248e (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:

add context switch for ARM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rb158d8f rb6838214  
    8383}
    8484
     85long long int ConstantExpr::intValue() const {
     86        if ( BasicType * basicType = dynamic_cast< BasicType * >( result ) ) {
     87                if ( basicType->isInteger() ) {
     88                        return get_constant()->get_ival();
     89                }
     90        } else if ( dynamic_cast< OneType * >( result ) ) {
     91                return 1;
     92        } else if ( dynamic_cast< ZeroType * >( result ) ) {
     93                return 0;
     94        }
     95        throw SemanticError( "Constant expression of non-integral type ", this );
     96}
     97
    8598VariableExpr::VariableExpr( DeclarationWithType *_var ) : Expression(), var( _var ) {
    8699        assert( var );
     
    95108        //      assert( inst->baseEnum );
    96109        //      EnumDecl * decl = inst->baseEnum;
    97         //      for ( Declaration * member : decl->members ) {
    98         //              if ( member == _var ) {
    99         //                      type->set_lvalue( false );
    100         //              }
     110        //      long long int value;
     111        //      if ( decl->valueOf( var, value ) ) {
     112        //              type->set_lvalue( false );
    101113        //      }
    102114        // }
     
    403415                } else {
    404416                        // references have been removed, in which case dereference returns an lvalue of the base type.
    405                         ret->get_result()->set_lvalue( true );
     417                        ret->result->set_lvalue( true );
    406418                }
    407419        }
     
    589601        if ( ! body.empty() ) {
    590602                if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( body.back() ) ) {
    591                         set_result( maybeClone( exprStmt->get_expr()->get_result() ) );
     603                        result = maybeClone( exprStmt->expr->result );
    592604                }
    593605        }
    594606        // ensure that StmtExpr has a result type
    595607        if ( ! result ) {
    596                 set_result( new VoidType( Type::Qualifiers() ) );
     608                result = new VoidType( Type::Qualifiers() );
    597609        }
    598610}
Note: See TracChangeset for help on using the changeset viewer.