Ignore:
Timestamp:
Jul 26, 2017, 4:26:08 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
2afec66
Parents:
d335627
Message:

Fix various reference features.

  • Eliminate multiple address-ofs resulting from &(T&) [address-of reference-cast].
  • Keep rvalue cast if reference base type is incompatible with rvalue type.
  • Keep pointer qualifiers when eliminating reference types.
  • Add VariableExpr::functionPointer helper function to create variable expressions with function pointer type.
  • Change ConstructorExpr? translation so that it temporarily generates a 'fake' assignment operator rather than use UntypedExpr?, so that the correct transformations occur in the Lvalue pass. This is a hack that can be fixed once PassVisitor? properly supports Indexer.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rd335627 r8a6cf7e  
    9292}
    9393
     94VariableExpr * VariableExpr::functionPointer( FunctionDecl * func ) {
     95        VariableExpr * funcExpr = new VariableExpr( func );
     96        funcExpr->set_result( new PointerType( Type::Qualifiers(), funcExpr->get_result() ) );
     97        return funcExpr;
     98}
     99
    94100void VariableExpr::print( std::ostream &os, int indent ) const {
    95101        os << "Variable Expression: ";
Note: See TracChangeset for help on using the changeset viewer.