Changeset b726084 for src


Ignore:
Timestamp:
Nov 9, 2016, 2:51:42 PM (9 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:
30b65d8, d073e3c
Parents:
141b786 (diff), 84118d8 (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' into tuples

Conflicts:

src/ControlStruct/LabelTypeChecker.cc
src/InitTweak/FixInit.cc
src/ResolvExpr/Resolver.cc
src/Tuples/TupleAssignment.cc
src/Tuples/TupleAssignment.h

Location:
src
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/LabelFixer.h

    r141b786 rb726084  
    2626namespace ControlStruct {
    2727        /// normalizes label definitions and generates multi-level exit labels
    28         class LabelFixer : public Visitor {
     28        class LabelFixer final : public Visitor {
    2929                typedef Visitor Parent;
    3030          public:
     
    3333                std::map < Label, Statement * > *resolveJumps() throw ( SemanticError );
    3434
     35                using Visitor::visit;
     36
    3537                // Declarations
    36                 virtual void visit( FunctionDecl *functionDecl );
     38                virtual void visit( FunctionDecl *functionDecl ) override;
    3739
    3840                // Statements
    3941                void visit( Statement *stmt );
    4042
    41                 virtual void visit( CompoundStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    42                 virtual void visit( NullStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    43                 virtual void visit( ExprStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    44                 virtual void visit( IfStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    45                 virtual void visit( WhileStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    46                 virtual void visit( ForStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    47                 virtual void visit( SwitchStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    48                 virtual void visit( CaseStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    49                 virtual void visit( ReturnStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    50                 virtual void visit( TryStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    51                 virtual void visit( CatchStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    52                 virtual void visit( DeclStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
    53                 virtual void visit( BranchStmt *branchStmt );
    54                 virtual void visit( UntypedExpr *untyped );
     43                virtual void visit( CompoundStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     44                virtual void visit( NullStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     45                virtual void visit( ExprStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     46                virtual void visit( IfStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     47                virtual void visit( WhileStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     48                virtual void visit( ForStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     49                virtual void visit( SwitchStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     50                virtual void visit( CaseStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     51                virtual void visit( ReturnStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     52                virtual void visit( TryStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     53                virtual void visit( CatchStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     54                virtual void visit( DeclStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); }
     55                virtual void visit( BranchStmt *branchStmt ) override;
     56                virtual void visit( UntypedExpr *untyped ) override;
    5557
    5658                Label setLabelsDef( std::list< Label > &, Statement *definition );
  • src/GenPoly/Box.cc

    r141b786 rb726084  
    6464
    6565                /// Adds layout-generation functions to polymorphic types
    66                 class LayoutFunctionBuilder : public DeclMutator {
     66                class LayoutFunctionBuilder final : public DeclMutator {
    6767                        unsigned int functionNesting;  // current level of nested functions
    6868                public:
    6969                        LayoutFunctionBuilder() : functionNesting( 0 ) {}
    7070
    71                         virtual DeclarationWithType *mutate( FunctionDecl *functionDecl );
    72                         virtual Declaration *mutate( StructDecl *structDecl );
    73                         virtual Declaration *mutate( UnionDecl *unionDecl );
     71                        using DeclMutator::mutate;
     72                        virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
     73                        virtual Declaration *mutate( StructDecl *structDecl ) override;
     74                        virtual Declaration *mutate( UnionDecl *unionDecl ) override;
    7475                };
    7576
    7677                /// Replaces polymorphic return types with out-parameters, replaces calls to polymorphic functions with adapter calls as needed, and adds appropriate type variables to the function call
    77                 class Pass1 : public PolyMutator {
     78                class Pass1 final : public PolyMutator {
    7879                  public:
    7980                        Pass1();
    80                         virtual Expression *mutate( ApplicationExpr *appExpr );
    81                         virtual Expression *mutate( AddressExpr *addrExpr );
    82                         virtual Expression *mutate( UntypedExpr *expr );
    83                         virtual DeclarationWithType* mutate( FunctionDecl *functionDecl );
    84                         virtual TypeDecl *mutate( TypeDecl *typeDecl );
    85                         virtual Expression *mutate( CommaExpr *commaExpr );
    86                         virtual Expression *mutate( ConditionalExpr *condExpr );
    87                         virtual Statement * mutate( ReturnStmt *returnStmt );
    88                         virtual Type *mutate( PointerType *pointerType );
    89                         virtual Type * mutate( FunctionType *functionType );
    90 
    91                         virtual void doBeginScope();
    92                         virtual void doEndScope();
     81
     82                        using PolyMutator::mutate;
     83                        virtual Expression *mutate( ApplicationExpr *appExpr ) override;
     84                        virtual Expression *mutate( AddressExpr *addrExpr ) override;
     85                        virtual Expression *mutate( UntypedExpr *expr ) override;
     86                        virtual DeclarationWithType* mutate( FunctionDecl *functionDecl ) override;
     87                        virtual TypeDecl *mutate( TypeDecl *typeDecl ) override;
     88                        virtual Expression *mutate( CommaExpr *commaExpr ) override;
     89                        virtual Expression *mutate( ConditionalExpr *condExpr ) override;
     90                        virtual Statement * mutate( ReturnStmt *returnStmt ) override;
     91                        virtual Type *mutate( PointerType *pointerType ) override;
     92                        virtual Type * mutate( FunctionType *functionType ) override;
     93
     94                        virtual void doBeginScope() override;
     95                        virtual void doEndScope() override;
    9396                  private:
    9497                        /// Pass the extra type parameters from polymorphic generic arguments or return types into a function application
     
    135138                /// * Moves polymorphic returns in function types to pointer-type parameters
    136139                /// * adds type size and assertion parameters to parameter lists
    137                 class Pass2 : public PolyMutator {
     140                class Pass2 final : public PolyMutator {
    138141                  public:
    139142                        template< typename DeclClass >
    140143                        DeclClass *handleDecl( DeclClass *decl, Type *type );
    141                         virtual DeclarationWithType *mutate( FunctionDecl *functionDecl );
    142                         virtual ObjectDecl *mutate( ObjectDecl *objectDecl );
    143                         virtual TypeDecl *mutate( TypeDecl *typeDecl );
    144                         virtual TypedefDecl *mutate( TypedefDecl *typedefDecl );
    145                         virtual Type *mutate( PointerType *pointerType );
    146                         virtual Type *mutate( FunctionType *funcType );
     144
     145                        using PolyMutator::mutate;
     146                        virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
     147                        virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override;
     148                        virtual TypeDecl *mutate( TypeDecl *typeDecl ) override;
     149                        virtual TypedefDecl *mutate( TypedefDecl *typedefDecl ) override;
     150                        virtual Type *mutate( PointerType *pointerType ) override;
     151                        virtual Type *mutate( FunctionType *funcType ) override;
    147152
    148153                  private:
     
    156161                /// * Calculates polymorphic offsetof expressions from offset array
    157162                /// * Inserts dynamic calculation of polymorphic type layouts where needed
    158                 class PolyGenericCalculator : public PolyMutator {
     163                class PolyGenericCalculator final : public PolyMutator {
    159164                public:
    160165                        typedef PolyMutator Parent;
     
    163168                        template< typename DeclClass >
    164169                        DeclClass *handleDecl( DeclClass *decl, Type *type );
    165                         virtual DeclarationWithType *mutate( FunctionDecl *functionDecl );
    166                         virtual ObjectDecl *mutate( ObjectDecl *objectDecl );
    167                         virtual TypedefDecl *mutate( TypedefDecl *objectDecl );
    168                         virtual TypeDecl *mutate( TypeDecl *objectDecl );
    169                         virtual Statement *mutate( DeclStmt *declStmt );
    170                         virtual Type *mutate( PointerType *pointerType );
    171                         virtual Type *mutate( FunctionType *funcType );
    172                         virtual Expression *mutate( MemberExpr *memberExpr );
    173                         virtual Expression *mutate( SizeofExpr *sizeofExpr );
    174                         virtual Expression *mutate( AlignofExpr *alignofExpr );
    175                         virtual Expression *mutate( OffsetofExpr *offsetofExpr );
    176                         virtual Expression *mutate( OffsetPackExpr *offsetPackExpr );
    177 
    178                         virtual void doBeginScope();
    179                         virtual void doEndScope();
     170                        virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
     171                        virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override;
     172                        virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) override;
     173                        virtual TypeDecl *mutate( TypeDecl *objectDecl ) override;
     174                        virtual Statement *mutate( DeclStmt *declStmt ) override;
     175                        virtual Type *mutate( PointerType *pointerType ) override;
     176                        virtual Type *mutate( FunctionType *funcType ) override;
     177                        virtual Expression *mutate( MemberExpr *memberExpr ) override;
     178                        virtual Expression *mutate( SizeofExpr *sizeofExpr ) override;
     179                        virtual Expression *mutate( AlignofExpr *alignofExpr ) override;
     180                        virtual Expression *mutate( OffsetofExpr *offsetofExpr ) override;
     181                        virtual Expression *mutate( OffsetPackExpr *offsetPackExpr ) override;
     182
     183                        virtual void doBeginScope() override;
     184                        virtual void doEndScope() override;
    180185
    181186                private:
     
    197202
    198203                /// Replaces initialization of polymorphic values with alloca, declaration of dtype/ftype with appropriate void expression, and sizeof expressions of polymorphic types with the proper variable
    199                 class Pass3 : public PolyMutator {
     204                class Pass3 final : public PolyMutator {
    200205                  public:
    201206                        template< typename DeclClass >
    202207                        DeclClass *handleDecl( DeclClass *decl, Type *type );
    203                         virtual DeclarationWithType *mutate( FunctionDecl *functionDecl );
    204                         virtual ObjectDecl *mutate( ObjectDecl *objectDecl );
    205                         virtual TypedefDecl *mutate( TypedefDecl *objectDecl );
    206                         virtual TypeDecl *mutate( TypeDecl *objectDecl );
    207                         virtual Type *mutate( PointerType *pointerType );
    208                         virtual Type *mutate( FunctionType *funcType );
     208
     209                        using PolyMutator::mutate;
     210                        virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
     211                        virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override;
     212                        virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) override;
     213                        virtual TypeDecl *mutate( TypeDecl *objectDecl ) override;
     214                        virtual Type *mutate( PointerType *pointerType ) override;
     215                        virtual Type *mutate( FunctionType *funcType ) override;
    209216                  private:
    210217                };
  • src/GenPoly/InstantiateGeneric.cc

    r141b786 rb726084  
    147147
    148148        /// Mutator pass that replaces concrete instantiations of generic types with actual struct declarations, scoped appropriately
    149         class GenericInstantiator : public DeclMutator {
     149        class GenericInstantiator final : public DeclMutator {
    150150                /// Map of (generic type, parameter list) pairs to concrete type instantiations
    151151                InstantiationMap< AggregateDecl, AggregateDecl > instantiations;
     
    158158                GenericInstantiator() : DeclMutator(), instantiations(), dtypeStatics(), typeNamer("_conc_") {}
    159159
    160                 virtual Type* mutate( StructInstType *inst );
    161                 virtual Type* mutate( UnionInstType *inst );
    162 
    163                 virtual void doBeginScope();
    164                 virtual void doEndScope();
     160                using DeclMutator::mutate;
     161                virtual Type* mutate( StructInstType *inst ) override;
     162                virtual Type* mutate( UnionInstType *inst ) override;
     163
     164                virtual void doBeginScope() override;
     165                virtual void doEndScope() override;
    165166        private:
    166167                /// Wrap instantiation lookup for structs
  • src/GenPoly/Specialize.cc

    r141b786 rb726084  
    3636        const std::list<Label> noLabels;
    3737
    38         class Specialize : public PolyMutator {
     38        class Specialize final : public PolyMutator {
    3939          public:
    4040                Specialize( std::string paramPrefix = "_p" );
    4141
    42                 virtual Expression * mutate( ApplicationExpr *applicationExpr );
    43                 virtual Expression * mutate( AddressExpr *castExpr );
    44                 virtual Expression * mutate( CastExpr *castExpr );
     42                using PolyMutator::mutate;
     43                virtual Expression * mutate( ApplicationExpr *applicationExpr ) override;
     44                virtual Expression * mutate( AddressExpr *castExpr ) override;
     45                virtual Expression * mutate( CastExpr *castExpr ) override;
    4546                // virtual Expression * mutate( LogicalExpr *logicalExpr );
    4647                // virtual Expression * mutate( ConditionalExpr *conditionalExpr );
  • src/InitTweak/FixInit.cc

    r141b786 rb726084  
    4949namespace InitTweak {
    5050        namespace {
    51                 class InsertImplicitCalls : public GenPoly::PolyMutator {
     51                class InsertImplicitCalls final : public GenPoly::PolyMutator {
    5252                public:
    5353                        /// wrap function application expressions as ImplicitCopyCtorExpr nodes so that it is easy to identify which
     
    5555                        static void insert( std::list< Declaration * > & translationUnit );
    5656
    57                         virtual Expression * mutate( ApplicationExpr * appExpr );
     57                        using GenPoly::PolyMutator::mutate;
     58                        virtual Expression * mutate( ApplicationExpr * appExpr ) override;
    5859                };
    5960
    60                 class ResolveCopyCtors : public SymTab::Indexer {
     61                class ResolveCopyCtors final : public SymTab::Indexer {
    6162                public:
    6263                        /// generate temporary ObjectDecls for each argument and return value of each ImplicitCopyCtorExpr,
     
    6869                        using Parent::visit;
    6970
    70                         virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr );
     71                        virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ) override;
    7172                        virtual void visit( UniqueExpr * unqExpr );
    7273
     
    8889                        using Parent::visit;
    8990                        typedef std::set< ObjectDecl * > ObjectSet;
    90                         virtual void visit( CompoundStmt *compoundStmt );
    91                         virtual void visit( DeclStmt *stmt );
     91                        virtual void visit( CompoundStmt *compoundStmt ) override;
     92                        virtual void visit( DeclStmt *stmt ) override;
    9293                  protected:
    9394                        ObjectSet curVars;
     
    109110                }
    110111
    111                 class LabelFinder : public ObjDeclCollector {
     112                class LabelFinder final : public ObjDeclCollector {
    112113                  public:
    113114                        typedef ObjDeclCollector Parent;
     
    123124                        // subclasses are added, there is only one place that the code has to be updated, rather than ensure that
    124125                        // every specialized class knows about every new kind of statement that might be added.
    125                         virtual void visit( CompoundStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    126                         virtual void visit( ExprStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    127                         virtual void visit( AsmStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    128                         virtual void visit( IfStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    129                         virtual void visit( WhileStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    130                         virtual void visit( ForStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    131                         virtual void visit( SwitchStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    132                         virtual void visit( CaseStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    133                         virtual void visit( BranchStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    134                         virtual void visit( ReturnStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    135                         virtual void visit( TryStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    136                         virtual void visit( CatchStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    137                         virtual void visit( FinallyStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    138                         virtual void visit( NullStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    139                         virtual void visit( DeclStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
    140                         virtual void visit( ImplicitCtorDtorStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); }
     126                        using Parent::visit;
     127                        virtual void visit( CompoundStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     128                        virtual void visit( ExprStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     129                        virtual void visit( AsmStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     130                        virtual void visit( IfStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     131                        virtual void visit( WhileStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     132                        virtual void visit( ForStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     133                        virtual void visit( SwitchStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     134                        virtual void visit( CaseStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     135                        virtual void visit( BranchStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     136                        virtual void visit( ReturnStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     137                        virtual void visit( TryStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     138                        virtual void visit( CatchStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     139                        virtual void visit( FinallyStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     140                        virtual void visit( NullStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     141                        virtual void visit( DeclStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
     142                        virtual void visit( ImplicitCtorDtorStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); }
    141143                };
    142144
    143                 class InsertDtors : public ObjDeclCollector {
     145                class InsertDtors final : public ObjDeclCollector {
    144146                public:
    145147                        /// insert destructor calls at the appropriate places.  must happen before CtorInit nodes are removed
     
    153155                        InsertDtors( LabelFinder & finder ) : labelVars( finder.vars ) {}
    154156
    155                         virtual void visit( ObjectDecl * objDecl );
    156 
    157                         virtual void visit( CompoundStmt * compoundStmt );
    158                         virtual void visit( ReturnStmt * returnStmt );
    159                         virtual void visit( BranchStmt * stmt );
     157                        using Parent::visit;
     158
     159                        virtual void visit( ObjectDecl * objDecl ) override;
     160
     161                        virtual void visit( CompoundStmt * compoundStmt ) override;
     162                        virtual void visit( ReturnStmt * returnStmt ) override;
     163                        virtual void visit( BranchStmt * stmt ) override;
    160164                private:
    161165                        void handleGoto( BranchStmt * stmt );
     
    165169                };
    166170
    167                 class FixInit : public GenPoly::PolyMutator {
     171                class FixInit final : public GenPoly::PolyMutator {
    168172                  public:
    169173                        /// expand each object declaration to use its constructor after it is declared.
    170174                        static void fixInitializers( std::list< Declaration * > &translationUnit );
    171175
    172                         virtual DeclarationWithType * mutate( ObjectDecl *objDecl );
     176                        using GenPoly::PolyMutator::mutate;
     177                        virtual DeclarationWithType * mutate( ObjectDecl *objDecl ) override;
    173178
    174179                        std::list< Declaration * > staticDtorDecls;
    175180                };
    176181
    177                 class FixCopyCtors : public GenPoly::PolyMutator {
     182                class FixCopyCtors final : public GenPoly::PolyMutator {
    178183                  public:
    179184                        /// expand ImplicitCopyCtorExpr nodes into the temporary declarations, copy constructors, call expression,
     
    181186                        static void fixCopyCtors( std::list< Declaration * > &translationUnit );
    182187
    183                         virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr );
    184                         virtual Expression * mutate( UniqueExpr * unqExpr );
     188                        using GenPoly::PolyMutator::mutate;
     189                        virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) override;
     190                        virtual Expression * mutate( UniqueExpr * unqExpr ) override;
    185191                };
    186192
    187                 class GenStructMemberCalls : public SymTab::Indexer {
     193                class GenStructMemberCalls final : public SymTab::Indexer {
    188194                  public:
    189195                        typedef Indexer Parent;
     
    193199                        static void generate( std::list< Declaration * > & translationUnit );
    194200
    195                         virtual void visit( FunctionDecl * funcDecl );
    196 
    197                         virtual void visit( MemberExpr * memberExpr );
    198                         virtual void visit( ApplicationExpr * appExpr );
     201                        using Parent::visit;
     202
     203                        virtual void visit( FunctionDecl * funcDecl ) override;
     204
     205                        virtual void visit( MemberExpr * memberExpr ) override;
     206                        virtual void visit( ApplicationExpr * appExpr ) override;
    199207
    200208                        SemanticError errors;
     
    214222                // resolve UntypedExprs that are found within newly
    215223                // generated constructor/destructor calls
    216                 class MutatingResolver : public Mutator {
     224                class MutatingResolver final : public Mutator {
    217225                  public:
    218226                        MutatingResolver( SymTab::Indexer & indexer ) : indexer( indexer ) {}
    219227
    220                         virtual DeclarationWithType* mutate( ObjectDecl *objectDecl );
    221 
    222                         virtual Expression* mutate( UntypedExpr *untypedExpr );
    223                         private:
     228                        using Mutator::mutate;
     229                        virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ) override;
     230                        virtual Expression* mutate( UntypedExpr *untypedExpr ) override;
     231
     232                  private:
    224233                        SymTab::Indexer & indexer;
    225234                };
    226235
    227                 class FixCtorExprs : public GenPoly::DeclMutator {
     236                class FixCtorExprs final : public GenPoly::DeclMutator {
    228237                  public:
    229238                        /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument
    230239                        static void fix( std::list< Declaration * > & translationUnit );
    231240
    232                         virtual Expression * mutate( ConstructorExpr * ctorExpr );
     241                        using GenPoly::DeclMutator::mutate;
     242                        virtual Expression * mutate( ConstructorExpr * ctorExpr ) override;
    233243                };
    234244        } // namespace
  • src/InitTweak/GenInit.cc

    r141b786 rb726084  
    3737        }
    3838
    39         class ReturnFixer : public GenPoly::PolyMutator {
     39        class ReturnFixer final : public GenPoly::PolyMutator {
    4040          public:
    4141                /// consistently allocates a temporary variable for the return value
     
    4646                ReturnFixer();
    4747
    48                 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
    49 
    50                 virtual Statement * mutate( ReturnStmt * returnStmt );
     48                using GenPoly::PolyMutator::mutate;
     49                virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) override;
     50                virtual Statement * mutate( ReturnStmt * returnStmt ) override;
    5151
    5252          protected:
     
    5656        };
    5757
    58         class CtorDtor : public GenPoly::PolyMutator {
     58        class CtorDtor final : public GenPoly::PolyMutator {
    5959          public:
    6060                typedef GenPoly::PolyMutator Parent;
     
    6666                static void generateCtorDtor( std::list< Declaration * > &translationUnit );
    6767
    68                 virtual DeclarationWithType * mutate( ObjectDecl * );
    69                 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
     68                virtual DeclarationWithType * mutate( ObjectDecl * ) override;
     69                virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) override;
    7070                // should not traverse into any of these declarations to find objects
    7171                // that need to be constructed or destructed
    72                 virtual Declaration* mutate( StructDecl *aggregateDecl );
    73                 virtual Declaration* mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }
    74                 virtual Declaration* mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }
    75                 virtual Declaration* mutate( TraitDecl *aggregateDecl ) { return aggregateDecl; }
    76                 virtual TypeDecl* mutate( TypeDecl *typeDecl ) { return typeDecl; }
    77                 virtual Declaration* mutate( TypedefDecl *typeDecl ) { return typeDecl; }
    78 
    79                 virtual Type * mutate( FunctionType *funcType ) { return funcType; }
    80 
    81                 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt );
     72                virtual Declaration* mutate( StructDecl *aggregateDecl ) override;
     73                virtual Declaration* mutate( UnionDecl *aggregateDecl ) override { return aggregateDecl; }
     74                virtual Declaration* mutate( EnumDecl *aggregateDecl ) override { return aggregateDecl; }
     75                virtual Declaration* mutate( TraitDecl *aggregateDecl ) override { return aggregateDecl; }
     76                virtual TypeDecl* mutate( TypeDecl *typeDecl ) override { return typeDecl; }
     77                virtual Declaration* mutate( TypedefDecl *typeDecl ) override { return typeDecl; }
     78
     79                virtual Type * mutate( FunctionType *funcType ) override { return funcType; }
     80
     81                virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override;
    8282
    8383          private:
     
    9393        };
    9494
    95         class HoistArrayDimension : public GenPoly::DeclMutator {
     95        class HoistArrayDimension final : public GenPoly::DeclMutator {
    9696          public:
    9797                typedef GenPoly::DeclMutator Parent;
     
    103103
    104104          private:
    105                 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl );
    106                 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );
     105                using Parent::mutate;
     106
     107                virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) override;
     108                virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) override;
    107109                // should not traverse into any of these declarations to find objects
    108110                // that need to be constructed or destructed
    109                 virtual Declaration* mutate( StructDecl *aggregateDecl ) { return aggregateDecl; }
    110                 virtual Declaration* mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }
    111                 virtual Declaration* mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }
    112                 virtual Declaration* mutate( TraitDecl *aggregateDecl ) { return aggregateDecl; }
    113                 virtual TypeDecl* mutate( TypeDecl *typeDecl ) { return typeDecl; }
    114                 virtual Declaration* mutate( TypedefDecl *typeDecl ) { return typeDecl; }
    115 
    116                 virtual Type* mutate( FunctionType *funcType ) { return funcType; }
     111                virtual Declaration* mutate( StructDecl *aggregateDecl ) override { return aggregateDecl; }
     112                virtual Declaration* mutate( UnionDecl *aggregateDecl ) override { return aggregateDecl; }
     113                virtual Declaration* mutate( EnumDecl *aggregateDecl ) override { return aggregateDecl; }
     114                virtual Declaration* mutate( TraitDecl *aggregateDecl ) override { return aggregateDecl; }
     115                virtual TypeDecl* mutate( TypeDecl *typeDecl ) override { return typeDecl; }
     116                virtual Declaration* mutate( TypedefDecl *typeDecl ) override { return typeDecl; }
     117
     118                virtual Type* mutate( FunctionType *funcType ) override { return funcType; }
    117119
    118120                void hoist( Type * type );
  • src/InitTweak/InitTweak.h

    r141b786 rb726084  
    100100
    101101                class ExpanderImpl;
     102                typedef std::list< Expression * > IndexList;
    102103        private:
    103104                std::shared_ptr< ExpanderImpl > expander;
     
    105106
    106107                // invariant: list of size 2N (elements come in pairs [index, dimension])
    107                 typedef std::list< Expression * > IndexList;
    108108                IndexList indices;
    109109        };
  • src/Makefile.am

    r141b786 rb726084  
    66## file "LICENCE" distributed with Cforall.
    77##
    8 ## Makefile.am -- 
     8## Makefile.am --
    99##
    1010## Author           : Peter A. Buhr
    1111## Created On       : Sun May 31 08:51:46 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sat Sep 24 15:03:52 2016
    14 ## Update Count     : 73
     13## Last Modified On : Thu Oct 27 20:41:25 2016
     14## Update Count     : 75
    1515###############################################################################
    1616
     
    4141driver_cfa_cpp_SOURCES = ${SRC}
    4242driver_cfa_cpp_LDADD = ${LEXLIB} -ldl                   # yywrap
    43 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include
     43driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT
     44driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic
    4445
    4546MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}}
  • src/Makefile.in

    r141b786 rb726084  
    198198driver_cfa_cpp_DEPENDENCIES = $(am__DEPENDENCIES_1)
    199199driver_cfa_cpp_LINK = $(CXXLD) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) \
    200         $(AM_LDFLAGS) $(LDFLAGS) -o $@
     200        $(driver_cfa_cpp_LDFLAGS) $(LDFLAGS) -o $@
    201201DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
    202202depcomp = $(SHELL) $(top_srcdir)/automake/depcomp
     
    267267CFA_PREFIX = @CFA_PREFIX@
    268268CFLAGS = @CFLAGS@
    269 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@
    270269CPP = @CPP@
    271270CPPFLAGS = @CPPFLAGS@
     
    419418driver_cfa_cpp_SOURCES = ${SRC}
    420419driver_cfa_cpp_LDADD = ${LEXLIB} -ldl                   # yywrap
    421 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include
     420driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT
     421driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic
    422422all: $(BUILT_SOURCES)
    423423        $(MAKE) $(AM_MAKEFLAGS) all-am
  • src/Parser/ParseNode.h

    r141b786 rb726084  
    109109        ExpressionNode * set_extension( bool exten ) { extension = exten; return this; }
    110110
    111         void print( std::ostream &os, int indent = 0 ) const {}
     111        virtual void print( std::ostream &os, int indent = 0 ) const override {}
    112112        void printOneLine( std::ostream &os, int indent = 0 ) const {}
    113113
     
    191191//##############################################################################
    192192
    193 class TypeData;
     193struct TypeData;
    194194
    195195class DeclarationNode : public ParseNode {
     
    275275        }
    276276
    277         void print( std::ostream &os, int indent = 0 ) const;
    278         void printList( std::ostream &os, int indent = 0 ) const;
     277        virtual void print( std::ostream &os, int indent = 0 ) const override;
     278        virtual void printList( std::ostream &os, int indent = 0 ) const override;
    279279
    280280        Declaration * build() const;
     
    349349        virtual StatementNode * append_last_case( StatementNode * );
    350350
    351         virtual void print( std::ostream &os, int indent = 0 ) {}
    352         virtual void printList( std::ostream &os, int indent = 0 ) {}
     351        virtual void print( std::ostream &os, int indent = 0 ) const override {}
     352        virtual void printList( std::ostream &os, int indent = 0 ) const override {}
    353353  private:
    354354        std::unique_ptr<Statement> stmt;
  • src/ResolvExpr/AlternativeFinder.h

    r141b786 rb726084  
    9595        Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env );
    9696
    97         void resolveObject( const SymTab::Indexer & indexer, ObjectDecl * objectDecl );
    98 
    9997        template< typename InputIterator, typename OutputIterator >
    10098        void findMinCost( InputIterator begin, InputIterator end, OutputIterator out ) {
  • src/ResolvExpr/AlternativePrinter.h

    r141b786 rb726084  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // AlternativePrinter.h -- 
     7// AlternativePrinter.h --
    88//
    99// Author           : Richard C. Bilson
     
    2323
    2424namespace ResolvExpr {
    25         class AlternativePrinter : public SymTab::Indexer {
     25        class AlternativePrinter final : public SymTab::Indexer {
    2626          public:
    2727                AlternativePrinter( std::ostream &os );
    28                 virtual void visit( ExprStmt *exprStmt );
     28
     29                using SymTab::Indexer::visit;
     30                virtual void visit( ExprStmt *exprStmt ) override;
    2931          private:
    3032                std::ostream &os;
  • src/ResolvExpr/Resolver.cc

    r141b786 rb726084  
    3333
    3434namespace ResolvExpr {
    35         class Resolver : public SymTab::Indexer {
     35        class Resolver final : public SymTab::Indexer {
    3636          public:
    3737                Resolver() : SymTab::Indexer( false ) {}
    38                 Resolver( const SymTab::Indexer & indexer ) : SymTab::Indexer( indexer ) {}
    39 
    40                 virtual void visit( FunctionDecl *functionDecl );
    41                 virtual void visit( ObjectDecl *objectDecl );
    42                 virtual void visit( TypeDecl *typeDecl );
    43                 virtual void visit( EnumDecl * enumDecl );
    44 
    45                 virtual void visit( ArrayType * at );
    46                 virtual void visit( PointerType * at );
    47 
    48                 virtual void visit( ExprStmt *exprStmt );
    49                 virtual void visit( AsmExpr *asmExpr );
    50                 virtual void visit( AsmStmt *asmStmt );
    51                 virtual void visit( IfStmt *ifStmt );
    52                 virtual void visit( WhileStmt *whileStmt );
    53                 virtual void visit( ForStmt *forStmt );
    54                 virtual void visit( SwitchStmt *switchStmt );
    55                 virtual void visit( CaseStmt *caseStmt );
    56                 virtual void visit( BranchStmt *branchStmt );
    57                 virtual void visit( ReturnStmt *returnStmt );
    58 
    59                 virtual void visit( SingleInit *singleInit );
    60                 virtual void visit( ListInit *listInit );
    61                 virtual void visit( ConstructorInit *ctorInit );
     38
     39                using SymTab::Indexer::visit;
     40                virtual void visit( FunctionDecl *functionDecl ) override;
     41                virtual void visit( ObjectDecl *functionDecl ) override;
     42                virtual void visit( TypeDecl *typeDecl ) override;
     43                virtual void visit( EnumDecl * enumDecl ) override;
     44
     45                virtual void visit( ArrayType * at ) override;
     46                virtual void visit( PointerType * at ) override;
     47
     48                virtual void visit( ExprStmt *exprStmt ) override;
     49                virtual void visit( AsmExpr *asmExpr ) override;
     50                virtual void visit( AsmStmt *asmStmt ) override;
     51                virtual void visit( IfStmt *ifStmt ) override;
     52                virtual void visit( WhileStmt *whileStmt ) override;
     53                virtual void visit( ForStmt *forStmt ) override;
     54                virtual void visit( SwitchStmt *switchStmt ) override;
     55                virtual void visit( CaseStmt *caseStmt ) override;
     56                virtual void visit( BranchStmt *branchStmt ) override;
     57                virtual void visit( ReturnStmt *returnStmt ) override;
     58
     59                virtual void visit( SingleInit *singleInit ) override;
     60                virtual void visit( ListInit *listInit ) override;
     61                virtual void visit( ConstructorInit *ctorInit ) override;
    6262          private:
    6363        typedef std::list< Initializer * >::iterator InitIterator;
     
    6969          void resolveSingleAggrInit( Declaration *, InitIterator &, InitIterator & );
    7070          void fallbackInit( ConstructorInit * ctorInit );
     71
    7172                Type * functionReturn = nullptr;
    7273                Type *initContext = nullptr;
     
    533534        }
    534535
    535         void resolveObject( const SymTab::Indexer & indexer, ObjectDecl * objectDecl ) {
    536                 Resolver resolver( indexer );
    537                 objectDecl->accept( resolver );
    538         }
    539 
    540536        void Resolver::visit( ConstructorInit *ctorInit ) {
    541537                // xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit
  • src/ResolvExpr/TypeMap.h

    r141b786 rb726084  
    3838                typedef typename std::map< std::string, Value* > ValueMap;
    3939                typedef typename ValueMap::iterator ValueMapIterator;
    40                
     40
    4141                Value *voidValue;                                     ///< Value for void type
    4242                Value *basicValue[BasicType::NUMBER_OF_BASIC_TYPES];  ///< Values for basic types
     
    5454                        /// One scope of map rollbacks
    5555                        typedef std::vector< std::pair< ValueMapIterator, Value* > > MapScope;
    56                        
     56
    5757                        PointerScope pointers;  ///< Value pointers to roll back to their previous state
    5858                        MapScope mapNodes;      ///< Value map iterators to roll back to their previous state
     
    6868
    6969                std::vector< Rollback > scopes;  ///< Scope rollback information
    70                
     70
    7171                struct Lookup : public Visitor {
    7272                        Lookup( TypeMap<Value> &typeMap ) : typeMap( typeMap ), found( 0 ), toInsert( 0 ) {}
     
    8787                                return found;
    8888                        }
    89                        
     89
    9090                        void findAndReplace( Value *&loc ) {
    9191                                found = loc;
     
    109109                                }
    110110                        }
    111                        
     111
    112112                        virtual void visit( VoidType *voidType ) {
    113113                                findAndReplace( typeMap.voidValue );
    114114                        }
    115                        
     115
    116116                        virtual void visit( BasicType *basicType ) {
    117117                                findAndReplace( typeMap.basicValue[basicType->get_kind()] );
    118118                        }
    119                        
     119
    120120                        virtual void visit( PointerType *pointerType ) {
    121121                                // NOTE This is one of the places where the apporoximation of the resolver is (deliberately) poor;
     
    129129                                }
    130130                        }
    131                        
     131
    132132                        virtual void visit( ArrayType *arrayType ) {
    133133                                if ( dynamic_cast< FunctionType* >( arrayType->get_base() ) ) {
     
    137137                                }
    138138                        }
    139                        
     139
    140140                        virtual void visit( FunctionType *functionType ) {
    141141                                findAndReplace( typeMap.functionPointerValue );
    142142                        }
    143                        
     143
    144144                        virtual void visit( StructInstType *structType ) {
    145145                                findAndReplace( typeMap.structValue, structType->get_name() );
    146146                        }
    147                        
     147
    148148                        virtual void visit( UnionInstType *unionType ) {
    149149                                findAndReplace( typeMap.unionValue, unionType->get_name() );
    150150                        }
    151                        
     151
    152152                        virtual void visit( EnumInstType *enumType ) {
    153153                                findAndReplace( typeMap.enumValue, enumType->get_name() );
     
    157157                        Value *found;             ///< Value found (NULL if none yet)
    158158                        Value *toInsert;          ///< Value to insert (NULL if a lookup)
    159                 };  // class Lookup
    160                 friend class Lookup;
    161                
     159                };  // struct Lookup
     160                friend struct Lookup;
     161
    162162        public:
    163163                /// Starts a new scope
     
    180180                        scopes.pop_back();
    181181                }
    182                
     182
    183183                TypeMap() : voidValue( 0 ), pointerValue( 0 ), voidPointerValue( 0 ), functionPointerValue( 0 ), structValue(), unionValue(), enumValue(), scopes() {
    184184                        beginScope();
     
    199199                        return searcher.find( key );
    200200                }
    201                
     201
    202202        }; // class TypeMap
    203203
  • src/ResolvExpr/Unify.cc

    r141b786 rb726084  
    7373                const OpenVarSet &openVars;
    7474                WidenMode widenMode;
    75                 Type *commonType;
    7675                const SymTab::Indexer &indexer;
    7776        };
  • src/SymTab/Validate.cc

    r141b786 rb726084  
    9494
    9595        /// Associates forward declarations of aggregates with their definitions
    96         class Pass2 : public Indexer {
     96        class Pass2 final : public Indexer {
    9797                typedef Indexer Parent;
    9898          public:
    9999                Pass2( bool doDebug, const Indexer *indexer );
    100100          private:
    101                 virtual void visit( StructInstType *structInst );
    102                 virtual void visit( UnionInstType *unionInst );
    103                 virtual void visit( TraitInstType *contextInst );
    104                 virtual void visit( StructDecl *structDecl );
    105                 virtual void visit( UnionDecl *unionDecl );
    106                 virtual void visit( TypeInstType *typeInst );
     101                using Indexer::visit;
     102                void visit( StructInstType *structInst ) final;
     103                void visit( UnionInstType *unionInst ) final;
     104                void visit( TraitInstType *contextInst ) final;
     105                void visit( StructDecl *structDecl ) final;
     106                void visit( UnionDecl *unionDecl ) final;
     107                void visit( TypeInstType *typeInst ) final;
    107108
    108109                const Indexer *indexer;
     
    182183        };
    183184
    184         class CompoundLiteral : public GenPoly::DeclMutator {
     185        class CompoundLiteral final : public GenPoly::DeclMutator {
    185186                DeclarationNode::StorageClass storageclass = DeclarationNode::NoStorageClass;
    186187
    187                 virtual DeclarationWithType * mutate( ObjectDecl *objectDecl );
    188                 virtual Expression *mutate( CompoundLiteralExpr *compLitExpr );
     188                using GenPoly::DeclMutator::mutate;
     189                DeclarationWithType * mutate( ObjectDecl *objectDecl ) final;
     190                Expression *mutate( CompoundLiteralExpr *compLitExpr ) final;
    189191        };
    190192
     
    652654        void EliminateTypedef::addImplicitTypedef( AggDecl * aggDecl ) {
    653655                if ( typedefNames.count( aggDecl->get_name() ) == 0 ) {
    654                         Type *type;
     656                        Type *type = nullptr;
    655657                        if ( StructDecl * newDeclStructDecl = dynamic_cast< StructDecl * >( aggDecl ) ) {
    656658                                type = new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() );
  • src/driver/Makefile.am

    r141b786 rb726084  
    1111## Created On       : Sun May 31 08:49:31 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Thu Jan 28 09:04:40 2016
    14 ## Update Count     : 7
     13## Last Modified On : Fri Oct 28 13:46:06 2016
     14## Update Count     : 10
    1515###############################################################################
    1616
     
    2626cc1_SOURCES = cc1.cc
    2727
    28 cfa.cc : ${abs_top_srcdir}/version
    29         @true
    30 
    3128MAINTAINERCLEANFILES = @CFA_PREFIX@/bin/${bin_PROGRAMS} @CFA_PREFIX@/lib/${cc1lib_PROGRAMS}
  • src/driver/Makefile.in

    r141b786 rb726084  
    100100CFA_PREFIX = @CFA_PREFIX@
    101101CFLAGS = @CFLAGS@
    102 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@
    103102CPP = @CPP@
    104103CPPFLAGS = @CPPFLAGS@
     
    543542
    544543
    545 cfa.cc : ${abs_top_srcdir}/version
    546         @true
    547 
    548544# Tell versions [3.59,3.63) of GNU make to not export all variables.
    549545# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/driver/cfa.cc

    r141b786 rb726084  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 25 21:29:48 2016
    13 // Update Count     : 152
     12// Last Modified On : Thu Oct 27 22:19:37 2016
     13// Update Count     : 154
    1414//
    1515
     
    5050
    5151
     52#define str(s) #s
     53
    5254int main( int argc, char *argv[] ) {
    53         string Version( CFA_VERSION_LONG );                                                     // current version number from CONFIG
    54         string Major( to_string( CFA_VERSION_MAJOR ) ), Minor( to_string( CFA_VERSION_MINOR ) ), Patch( to_string( CFA_VERSION_PATCH ) );
     55        string Version( CFA_VERSION_LONG );                                     // current version number from CONFIG
     56        string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) );
    5557
    5658        string installincdir( CFA_INCDIR );                                     // fixed location of include files
  • src/examples/Makefile.in

    r141b786 rb726084  
    111111# applies to both programs
    112112CFLAGS = -g -Wall -Wno-unused-function # TEMPORARY: does not build with -O2
    113 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@
    114113CPP = @CPP@
    115114CPPFLAGS = @CPPFLAGS@
  • src/libcfa/Makefile.in

    r141b786 rb726084  
    137137CFA_PREFIX = @CFA_PREFIX@
    138138CFLAGS = -quiet -no-include-stdhdr -g -Wall -Wno-unused-function @CFA_FLAGS@ -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2
    139 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@
    140139CPP = @CPP@
    141140CPPFLAGS = @CPPFLAGS@
  • src/main.cc

    r141b786 rb726084  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Aug 29 17:34:39 2016
    13 // Update Count     : 426
     12// Last Modified On : Sun Oct 30 10:11:38 2016
     13// Update Count     : 435
    1414//
    1515
     
    1818#include <signal.h>                                                                             // signal
    1919#include <getopt.h>                                                                             // getopt
    20 #include <execinfo.h>                                                                   // backtrace, backtrace_symbols_fd
     20#include <execinfo.h>                                                                   // backtrace, backtrace_symbols
    2121#include <cxxabi.h>                                                                             // __cxa_demangle
     22#include <cstring>                                                                              // index
    2223
    2324using namespace std;
     
    7677static void dump( list< Declaration * > & translationUnit, ostream & out = cout );
    7778
    78 void backtrace( int start ) {                                                   // skip first N stack frames
     79static void backtrace( int start ) {                                    // skip first N stack frames
    7980        enum { Frames = 50 };
    8081        void * array[Frames];
    81         int size = backtrace( array, Frames );
    82         char ** messages = backtrace_symbols( array, size );
     82        int size = ::backtrace( array, Frames );
     83        char ** messages = ::backtrace_symbols( array, size ); // does not demangle names
     84
     85        *index( messages[0], '(' ) = '\0';                                      // find executable name
     86        cerr << "Stack back trace for: " << messages[0] << endl;
    8387
    8488        // skip last 2 stack frames after main
     
    8690                char * mangled_name = nullptr, * offset_begin = nullptr, * offset_end = nullptr;
    8791                for ( char *p = messages[i]; *p; ++p ) {        // find parantheses and +offset
    88                         if (*p == '(') {
     92                        if ( *p == '(' ) {
    8993                                mangled_name = p;
    90                         } else if (*p == '+') {
     94                        } else if ( *p == '+' ) {
    9195                                offset_begin = p;
    92                         } else if (*p == ')') {
     96                        } else if ( *p == ')' ) {
    9397                                offset_end = p;
    9498                                break;
     
    99103                int frameNo = i - start;
    100104                if ( mangled_name && offset_begin && offset_end && mangled_name < offset_begin ) {
    101                         *mangled_name++ = '\0';
     105                        *mangled_name++ = '\0';                                         // delimit strings
    102106                        *offset_begin++ = '\0';
    103107                        *offset_end++ = '\0';
    104108
    105                         int status, frameNo = i - start;
     109                        int status;
    106110                        char * real_name = __cxxabiv1::__cxa_demangle( mangled_name, 0, 0, &status );
     111                        // bug in __cxa_demangle for single-character lower-case non-mangled names
    107112                        if ( status == 0 ) {                                            // demangling successful ?
    108113                                cerr << "(" << frameNo << ") " << messages[i] << " : "
    109114                                         << real_name << "+" << offset_begin << offset_end << endl;
    110 
    111115                        } else {                                                                        // otherwise, output mangled name
    112116                                cerr << "(" << frameNo << ") " << messages[i] << " : "
    113                                          << mangled_name << "+" << offset_begin << offset_end << endl;
     117                                         << mangled_name << "(/*unknown*/)+" << offset_begin << offset_end << endl;
    114118                        } // if
     119
    115120                        free( real_name );
    116121                } else {                                                                                // otherwise, print the whole line
     
    125130        cerr << "*CFA runtime error* program cfa-cpp terminated with "
    126131                 <<     (sig_num == SIGSEGV ? "segment fault" : "bus error")
    127                  << " backtrace:" << endl;
     132                 << "." << endl;
    128133        backtrace( 2 );                                                                         // skip first 2 stack frames
    129134        exit( EXIT_FAILURE );
  • src/tests/Makefile.in

    r141b786 rb726084  
    121121# applies to both programs
    122122CFLAGS = -g -Wall -Wno-unused-function @CFA_FLAGS@ # TEMPORARY: does not build with -O2
    123 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@
    124123CPP = @CPP@
    125124CPPFLAGS = @CPPFLAGS@
Note: See TracChangeset for help on using the changeset viewer.