Changes in / [ce31925:25793da]


Ignore:
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • driver/Makefile.am

    rce31925 r25793da  
    1919
    2020# applies to both programs
    21 AM_CXXFLAGS = @HOST_FLAGS@ -Wall -Wextra -Werror=return-type -O2 -g -std=c++14 -I${abs_top_srcdir}/src -I${abs_top_srcdir}/src/include
     21AM_CXXFLAGS = @HOST_FLAGS@ -Wall -Wextra -Werror=return-type -O2 -g -std=c++17 -I${abs_top_srcdir}/src -I${abs_top_srcdir}/src/include
    2222
    2323# don't install cfa directly
  • libcfa/prelude/Makefile.am

    rce31925 r25793da  
    5050
    5151prelude.cfa : prelude-gen.cc
    52         ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o prelude-gen -Wall -Wextra -O2 -g -std=c++14
     52        ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o prelude-gen -Wall -Wextra -O2 -g -std=c++17
    5353        @./prelude-gen > ${@}
    5454        @rm ./prelude-gen
  • src/AST/Pass.hpp

    rce31925 r25793da  
    327327struct PureVisitor {};
    328328
     329struct WithCodeLocation {
     330        const CodeLocation * location = nullptr;
     331};
     332
    329333/// Keep track of the polymorphic const TypeSubstitution * typeSubs for the current expression.
    330334struct WithConstTypeSubstitution {
  • src/AST/Pass.impl.hpp

    rce31925 r25793da  
    2525#define VISIT_START( node ) \
    2626        using namespace ast; \
     27        /* back-up the last known code location */ \
     28        __attribute__((unused)) auto loc_guard = ast::__pass::make_location_guard( core, node ); \
    2729        /* back-up the visit children */ \
    2830        __attribute__((unused)) ast::__pass::visit_children_guard guard1( ast::__pass::visit_children(core, 0) ); \
  • src/AST/Pass.proto.hpp

    rce31925 r25793da  
    295295        FIELD_PTR( at_cleanup, __pass::at_cleanup_t )
    296296        FIELD_PTR( visitor, ast::Pass<core_t> * const )
     297        FIELD_PTR( location, const CodeLocation * )
    297298
    298299        // Remove the macro to make sure we don't clash
     
    324325        static auto on_error (core_t & core, ptr<Decl> & decl, int) -> decltype(core.on_error(decl)) {
    325326                return core.on_error(decl);
     327        }
     328
     329        template< typename core_t, typename node_t >
     330        static auto make_location_guard(core_t & core, node_t * node) -> ValueGuardPtr<const CodeLocation *> {
     331                if constexpr (std::is_base_of<ParseNode, node_t>::value) {
     332                        const CodeLocation ** p = location(core, 0);
     333                        if(p) {
     334                                ValueGuardPtr<const CodeLocation *> g = { p };
     335                                *p = &node->location;
     336                                return g;
     337                        }
     338                }
     339                (void)node;
     340                return { nullptr };
    326341        }
    327342
  • src/Common/utility.h

    rce31925 r25793da  
    322322
    323323        ValueGuardPtr(T * inRef) : old( inRef ? *inRef : T() ), ref(inRef) {}
     324        ValueGuardPtr(const ValueGuardPtr& other) = delete;
     325        ValueGuardPtr(ValueGuardPtr&& other) : old(other.old), ref(other.ref) { other.ref = nullptr; }
    324326        ~ValueGuardPtr() { if( ref ) *ref = old; }
    325327};
  • src/ControlStruct/LabelFixer.cc

    rce31925 r25793da  
    119119
    120120// Builds a table that maps a label to its defining statement.
    121 std::map<Label, Statement * > * LabelFixer::resolveJumps() throw ( SemanticErrorException ) {
     121std::map<Label, Statement * > * LabelFixer::resolveJumps() {
    122122        std::map< Label, Statement * > *ret = new std::map< Label, Statement * >();
    123123        for ( std::map< Label, Entry * >::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) {
  • src/ControlStruct/LabelFixer.h

    rce31925 r25793da  
    3333        LabelFixer( LabelGenerator *gen = 0 );
    3434
    35         std::map < Label, Statement * > *resolveJumps() throw ( SemanticErrorException );
     35        std::map < Label, Statement * > *resolveJumps();
    3636
    3737        // Declarations
  • src/ControlStruct/MLEMutator.cc

    rce31925 r25793da  
    141141
    142142
    143         Statement *MultiLevelExitMutator::postmutate( BranchStmt *branchStmt )
    144                         throw ( SemanticErrorException ) {
     143        Statement *MultiLevelExitMutator::postmutate( BranchStmt *branchStmt ) {
    145144                std::string originalTarget = branchStmt->originalTarget;
    146145
  • src/ControlStruct/MLEMutator.h

    rce31925 r25793da  
    4141
    4242                void premutate( CompoundStmt *cmpndStmt );
    43                 Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException );
     43                Statement * postmutate( BranchStmt *branchStmt );
    4444                void premutate( WhileDoStmt *whileDoStmt );
    4545                Statement * postmutate( WhileDoStmt *whileDoStmt );
  • src/GenPoly/InstantiateGenericNew.cpp

    rce31925 r25793da  
    417417
    418418struct GenericInstantiator final :
     419                public ast::WithCodeLocation,
     420                public ast::WithConstTypeSubstitution,
     421                public ast::WithDeclsToAdd<>,
    419422                public ast::WithGuards,
    420                 public ast::WithVisitorRef<GenericInstantiator>,
    421                 public ast::WithConstTypeSubstitution,
    422                 public ast::WithDeclsToAdd<> {
     423                public ast::WithVisitorRef<GenericInstantiator>
     424{
    423425        /// Map of (generic type, parameter list) pairs
    424426        /// to concrete type instantiations.
     
    435437        /// member from an instantiation.
    436438        int memberIndex = -1;
    437         /// Keep track of the nearest location to fill in locations.
    438         CodeLocation const * location = nullptr;
    439439
    440440        GenericInstantiator() :
  • src/Makefile.am

    rce31925 r25793da  
    7171EXTRA_DIST = include/cassert include/optional BasicTypes-gen.cc
    7272
    73 AM_CXXFLAGS = @HOST_FLAGS@ -Wno-deprecated -Wall -Wextra -Werror=return-type -DDEBUG_ALL -I./Parser -I$(srcdir)/Parser -I$(srcdir)/include -DYY_NO_INPUT -O3 -g -std=c++14 $(TCMALLOCFLAG)
     73AM_CXXFLAGS = @HOST_FLAGS@ -Wno-deprecated -Wall -Wextra -Werror=return-type -DDEBUG_ALL -I./Parser -I$(srcdir)/Parser -I$(srcdir)/include -DYY_NO_INPUT -O3 -g -std=c++17 $(TCMALLOCFLAG)
    7474AM_LDFLAGS  = @HOST_FLAGS@ -Xlinker -export-dynamic
    7575ARFLAGS     = cr
  • src/SynTree/Statement.cc

    rce31925 r25793da  
    105105};
    106106
    107 BranchStmt::BranchStmt( Label target, Type type ) throw ( SemanticErrorException ) :
     107BranchStmt::BranchStmt( Label target, Type type ) :
    108108        Statement(), originalTarget( target ), target( target ), computedTarget( nullptr ), type( type ) {
    109109        //actually this is a syntactic error signaled by the parser
     
    113113}
    114114
    115 BranchStmt::BranchStmt( Expression * computedTarget, Type type ) throw ( SemanticErrorException ) :
     115BranchStmt::BranchStmt( Expression * computedTarget, Type type ) :
    116116        Statement(), computedTarget( computedTarget ), type( type ) {
    117117        if ( type != BranchStmt::Goto || computedTarget == nullptr ) {
     
    211211}
    212212
    213 CaseStmt::CaseStmt( Expression * condition, const list<Statement *> & statements, bool deflt ) throw ( SemanticErrorException ) :
     213CaseStmt::CaseStmt( Expression * condition, const list<Statement *> & statements, bool deflt ) :
    214214                Statement(), condition( condition ), stmts( statements ), _isDefault( deflt ) {
    215215        if ( isDefault() && condition != nullptr ) SemanticError( condition, "default case with condition: " );
     
    575575}
    576576
    577 MutexStmt::MutexStmt( Statement * stmt, const list<Expression *> mutexObjs ) 
     577MutexStmt::MutexStmt( Statement * stmt, const list<Expression *> mutexObjs )
    578578        : Statement(), stmt( stmt ), mutexObjs( mutexObjs ) { }
    579579
  • src/SynTree/Statement.h

    rce31925 r25793da  
    200200        std::list<Statement *> stmts;
    201201
    202         CaseStmt( Expression * conditions, const std::list<Statement *> & stmts, bool isdef = false ) throw (SemanticErrorException);
     202        CaseStmt( Expression * conditions, const std::list<Statement *> & stmts, bool isdef = false );
    203203        CaseStmt( const CaseStmt & other );
    204204        virtual ~CaseStmt();
     
    289289        Type type;
    290290
    291         BranchStmt( Label target, Type ) throw (SemanticErrorException);
    292         BranchStmt( Expression * computedTarget, Type ) throw (SemanticErrorException);
     291        BranchStmt( Label target, Type );
     292        BranchStmt( Expression * computedTarget, Type );
    293293
    294294        Label get_originalTarget() { return originalTarget; }
Note: See TracChangeset for help on using the changeset viewer.