Ignore:
Timestamp:
Mar 1, 2018, 9:29:03 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
1f37ed02
Parents:
b002261 (diff), 446ffa3 (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:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Indexer.cc

    rb002261 rdcbb03b  
    443443                        // isomorphic to C type-compatibility, which it may not be.
    444444                        if ( hasIncompatibleCDecl( name, mangleName, scope ) ) {
    445                                 throw SemanticError( decl, "conflicting overload of C function " );
     445                                SemanticError( decl, "conflicting overload of C function " );
    446446                        }
    447447                } else {
    448448                        // Check that a Cforall declaration doesn't override any C declaration
    449449                        if ( hasCompatibleCDecl( name, mangleName, scope ) ) {
    450                                 throw SemanticError( decl, "Cforall declaration hides C function " );
     450                                SemanticError( decl, "Cforall declaration hides C function " );
    451451                        }
    452452                }
     
    463463        void Indexer::addId( DeclarationWithType * decl, Expression * baseExpr ) {
    464464                // default handling of conflicts is to raise an error
    465                 addId( decl, [decl](IdData &, const std::string & msg) { throw SemanticError( decl, msg ); return true; }, baseExpr );
     465                addId( decl, [decl](IdData &, const std::string & msg) { SemanticError( decl, msg ); return true; }, baseExpr );
    466466        }
    467467
    468468        void Indexer::addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt ) {
    469469                // default handling of conflicts is to raise an error
    470                 addId( decl, [decl](IdData &, const std::string & msg) { throw SemanticError( decl, msg ); return true; }, nullptr, deleteStmt );
     470                addId( decl, [decl](IdData &, const std::string & msg) { SemanticError( decl, msg ); return true; }, nullptr, deleteStmt );
    471471        }
    472472
     
    477477                        return true;
    478478                } else {
    479                         throw SemanticError( added, "redeclaration of " );
     479                        SemanticError( added, "redeclaration of " );
    480480                }
    481481        }
     
    504504                        return false;
    505505                } else if ( ! added->get_members().empty() ) {
    506                         throw SemanticError( added, "redeclaration of " );
     506                        SemanticError( added, "redeclaration of " );
    507507                } // if
    508508                return true;
     
    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.
Note: See TracChangeset for help on using the changeset viewer.