Changeset a181494 for src/SymTab


Ignore:
Timestamp:
Feb 21, 2018, 4:07:10 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
5a806be4
Parents:
599fbb6
git-author:
Rob Schluntz <rschlunt@…> (02/21/18 15:52:43)
git-committer:
Rob Schluntz <rschlunt@…> (02/21/18 16:07:10)
Message:

Adding cost for reference-to-rvalue conversions

Location:
src/SymTab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Indexer.cc

    r599fbb6 ra181494  
    603603                                        if ( dynamic_cast< StructInstType * >( t ) || dynamic_cast< UnionInstType * >( t ) ) {
    604604                                                Expression * base = expr->clone();
    605                                                 ResolvExpr::referenceToRvalueConversion( base );
     605                                                ResolvExpr::Cost cost = ResolvExpr::Cost::zero; // xxx - carry this cost into the indexer as a base cost?
     606                                                ResolvExpr::referenceToRvalueConversion( base, cost );
    606607                                                addMembers( t->getAggr(), new MemberExpr( dwt, base ), handleConflicts );
    607608                                        }
     
    705706        }
    706707
    707         Expression * Indexer::IdData::combine() const {
     708        Expression * Indexer::IdData::combine( ResolvExpr::Cost & cost ) const {
    708709                Expression * ret = nullptr;
    709710                if ( baseExpr ) {
    710711                        Expression * base = baseExpr->clone();
    711                         ResolvExpr::referenceToRvalueConversion( base );
     712                        ResolvExpr::referenceToRvalueConversion( base, cost );
    712713                        ret = new MemberExpr( id, base );
    713714                        // xxx - this introduces hidden environments, for now remove them.
  • src/SymTab/Indexer.h

    r599fbb6 ra181494  
    2323#include "SynTree/Visitor.h"  // for Visitor
    2424#include "SynTree/SynTree.h"  // for AST nodes
     25
     26namespace ResolvExpr {
     27class Cost;
     28}
    2529
    2630namespace SymTab {
     
    5155                        IdData( DeclarationWithType * id, Expression * baseExpr, BaseSyntaxNode * deleteStmt ) : id( id ), baseExpr( baseExpr ), deleteStmt( deleteStmt ) {}
    5256
    53                         Expression * combine() const;
     57                        Expression * combine( ResolvExpr::Cost & cost ) const;
    5458                };
    5559
Note: See TracChangeset for help on using the changeset viewer.