Changes in / [4817662:8bc67cf]


Ignore:
Location:
src
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r4817662 r8bc67cf  
    11571157
    11581158        void CodeGenerator::postvisit( WithStmt * with ) {
    1159                 assertf( ! options.genC, "WithStmts should not reach code generation." );
    1160 
    1161                 output << "with ( ";
    1162                 genCommaList( with->exprs.begin(), with->exprs.end() );
    1163                 output << " ) ";
     1159                if ( ! options.genC ) {
     1160                        output << "with ( ";
     1161                        genCommaList( with->exprs.begin(), with->exprs.end() );
     1162                        output << " ) ";
     1163                }
    11641164                with->stmt->accept( *visitor );
    11651165        }
  • src/GenPoly/BoxNew.cpp

    r4817662 r8bc67cf  
    17261726
    17271727// --------------------------------------------------------------------------
     1728// TODO: This is kind of a blind test. I believe all withExprs are handled
     1729// in the resolver and we could clear them out after that.
     1730struct RemoveWithExprs final {
     1731        ast::FunctionDecl const * postvisit( ast::FunctionDecl const * decl ) {
     1732                if ( decl->withExprs.empty() ) return decl;
     1733                auto mutDecl = mutate( decl );
     1734                mutDecl->withExprs.clear();
     1735                return mutDecl;
     1736        }
     1737};
     1738
     1739// --------------------------------------------------------------------------
    17281740/// Inserts code to access polymorphic layout inforation.
    17291741/// * Replaces member and size/alignment/offsetof expressions on polymorphic
     
    24992511        ast::Pass<DeclAdapter>::run( translationUnit );
    25002512        ast::Pass<RewireAdapters>::run( translationUnit );
     2513        ast::Pass<RemoveWithExprs>::run( translationUnit );
    25012514        ast::Pass<PolyGenericCalculator>::run( translationUnit );
    25022515        ast::Pass<Eraser>::run( translationUnit );
  • src/ResolvExpr/module.mk

    r4817662 r8bc67cf  
    7272        ResolvExpr/AlternativePrinter.h \
    7373        ResolvExpr/CandidatePrinter.cpp \
    74         ResolvExpr/CandidatePrinter.hpp \
    75         ResolvExpr/EraseWith.cpp \
    76         ResolvExpr/EraseWith.hpp
     74        ResolvExpr/CandidatePrinter.hpp
    7775
    7876SRCDEMANGLE += $(SRC_RESOLVEXPR)
  • src/main.cc

    r4817662 r8bc67cf  
    6262#include "Parser/RunParser.hpp"             // for buildList, dumpParseTree,...
    6363#include "ResolvExpr/CandidatePrinter.hpp"  // for printCandidates
    64 #include "ResolvExpr/EraseWith.hpp"         // for eraseWith
    6564#include "ResolvExpr/Resolver.h"            // for resolve
    6665#include "SynTree/LinkageSpec.h"            // for Spec, Cforall, Intrinsic
     
    397396
    398397                PASS( "Fix Init", InitTweak::fix, transUnit, buildingLibrary() );
    399                 PASS( "Erase With", ResolvExpr::eraseWith, transUnit );
    400398
    401399                // fix ObjectDecl - replaces ConstructorInit nodes
Note: See TracChangeset for help on using the changeset viewer.