Changeset 596fc4ad


Ignore:
Timestamp:
Dec 29, 2019, 4:27:09 PM (2 years ago)
Author:
Dmitry Kobets <dkobets@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
0b3cdad
Parents:
1712f542 (diff), 3c67255 (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 vector-generic

Files:
1 added
2 deleted
58 edited
1 moved

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/signal.hfa

    r1712f542 r596fc4ad  
    3737
    3838        act.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler;
     39        sigemptyset( &act.sa_mask );
     40        sigaddset( &act.sa_mask, SIGALRM );             // disabled during signal handler
     41        sigaddset( &act.sa_mask, SIGUSR1 );
    3942        act.sa_flags = flags;
    4043
  • src/AST/Convert.cpp

    r1712f542 r596fc4ad  
    1010// Created On       : Thu May 09 15::37::05 2019
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 10 22:20:10 2019
    13 // Update Count     : 32
     12// Last Modified On : Wed Dec 11 21:39:32 2019
     13// Update Count     : 33
    1414//
    1515
     
    12231223                                cv( node ),
    12241224                                node->name,
    1225                                 node->kind == ast::TypeVar::Ftype,
     1225                                node->kind == ast::TypeDecl::Ftype,
    12261226                                get<Attribute>().acceptL( node->attributes )
    12271227                        };
     
    15781578                        { old->storageClasses.val },
    15791579                        GET_ACCEPT_1(base, Type),
    1580                         (ast::TypeVar::Kind)(unsigned)old->kind,
     1580                        (ast::TypeDecl::Kind)(unsigned)old->kind,
    15811581                        old->sized,
    15821582                        GET_ACCEPT_1(init, Type)
     
    25612561                        ty = new ast::TypeInstType{
    25622562                                old->name,
    2563                                 old->isFtype ? ast::TypeVar::Ftype : ast::TypeVar::Dtype,
     2563                                old->isFtype ? ast::TypeDecl::Ftype : ast::TypeDecl::Dtype,
    25642564                                cv( old ),
    25652565                                GET_ACCEPT_V( attributes, Attribute )
  • src/AST/Decl.cpp

    r1712f542 r596fc4ad  
    1010// Created On       : Thu May 9 10:00:00 2019
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 16:41:39 2019
    13 // Update Count     : 18
     12// Last Modified On : Fri Dec 13 16:23:15 2019
     13// Update Count     : 20
    1414//
    1515
     
    2626#include "Node.hpp"            // for readonly
    2727#include "Type.hpp"            // for readonly
    28 #include "Parser/ParseNode.h"  // for DeclarationNode
    2928
    3029namespace ast {
     
    5655
    5756const char * TypeDecl::typeString() const {
    58         static const char * kindNames[] = { "sized object type", "sized function type", "sized tuple type" };
    59         assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1,
    60                 "typeString: kindNames is out of sync." );
    61         assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
     57        static const char * kindNames[] = { "sized data type", "sized object type", "sized function type", "sized tuple type" };
     58        static_assert( sizeof(kindNames)/sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "typeString: kindNames is out of sync." );
     59        assertf( kind < TypeDecl::NUMBER_OF_KINDS, "TypeDecl kind is out of bounds." );
    6260        return sized ? kindNames[ kind ] : &kindNames[ kind ][ sizeof("sized") ]; // sizeof includes '\0'
    6361}
    6462
    6563const char * TypeDecl::genTypeString() const {
    66         static const char * kindNames[] = { "dtype", "ftype", "ttype" };
    67         assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "genTypeString: kindNames is out of sync." );
    68         assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
     64        static const char * kindNames[] = { "dtype", "otype", "ftype", "ttype" };
     65        static_assert( sizeof(kindNames)/sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "genTypeString: kindNames is out of sync." );
     66        assertf( kind < TypeDecl::NUMBER_OF_KINDS, "TypeDecl kind is out of bounds." );
    6967        return kindNames[ kind ];
    7068}
  • src/AST/Decl.hpp

    r1712f542 r596fc4ad  
    1010// Created On       : Thu May 9 10:00:00 2019
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 08:20:20 2019
    13 // Update Count     : 16
     12// Last Modified On : Fri Dec 13 17:38:33 2019
     13// Update Count     : 29
    1414//
    1515
     
    2020#include <unordered_map>
    2121#include <vector>
     22#include <algorithm>
    2223
    2324#include "FunctionSpec.hpp"
     
    2728#include "ParseNode.hpp"
    2829#include "StorageClasses.hpp"
    29 #include "TypeVar.hpp"
    3030#include "Visitor.hpp"
    31 #include "Parser/ParseNode.h"  // for DeclarationNode::Aggregate
     31#include "Common/utility.h"
     32#include "Common/SemanticError.h"                                               // error_str
    3233
    3334// Must be included in *all* AST classes; should be #undef'd at the end of the file
     
    125126        std::vector< ptr<Expr> > withExprs;
    126127
    127         FunctionDecl( const CodeLocation & loc, const std::string &name, FunctionType * type,
     128        FunctionDecl( const CodeLocation & loc, const std::string & name, FunctionType * type,
    128129                CompoundStmt * stmts, Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::C,
    129130                std::vector<ptr<Attribute>>&& attrs = {}, Function::Specs fs = {})
     
    136137        bool has_body() const { return stmts; }
    137138
    138         const DeclWithType * accept( Visitor &v ) const override { return v.visit( this ); }
     139        const DeclWithType * accept( Visitor & v ) const override { return v.visit( this ); }
    139140private:
    140141        FunctionDecl * clone() const override { return new FunctionDecl( *this ); }
     
    163164/// Cforall type variable: `dtype T`
    164165class TypeDecl final : public NamedTypeDecl {
    165 public:
    166         TypeVar::Kind kind;
     166  public:
     167        enum Kind { Dtype, Otype, Ftype, Ttype, NUMBER_OF_KINDS };
     168
     169        Kind kind;
    167170        bool sized;
    168171        ptr<Type> init;
     
    170173        /// Data extracted from a type decl
    171174        struct Data {
    172                 TypeVar::Kind kind;
     175                Kind kind;
    173176                bool isComplete;
    174177
    175                 Data() : kind( (TypeVar::Kind)-1 ), isComplete( false ) {}
     178                Data() : kind( NUMBER_OF_KINDS ), isComplete( false ) {}
    176179                Data( const TypeDecl * d ) : kind( d->kind ), isComplete( d->sized ) {}
    177                 Data( TypeVar::Kind k, bool c ) : kind( k ), isComplete( c ) {}
     180                Data( Kind k, bool c ) : kind( k ), isComplete( c ) {}
    178181                Data( const Data & d1, const Data & d2 )
    179                 : kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {}
    180 
    181                 bool operator== ( const Data & o ) const {
    182                         return kind == o.kind && isComplete == o.isComplete;
    183                 }
    184                 bool operator!= ( const Data & o ) const { return !(*this == o); }
     182                        : kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {}
     183
     184                bool operator==( const Data & o ) const { return kind == o.kind && isComplete == o.isComplete; }
     185                bool operator!=( const Data & o ) const { return !(*this == o); }
    185186        };
    186187
    187         TypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, Type* b,
    188                 TypeVar::Kind k, bool s, Type* i = nullptr )
    189         : NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == TypeVar::Ttype || s ),
    190           init( i ) {}
     188        TypeDecl( const CodeLocation & loc, const std::string & name, Storage::Classes storage, Type * b,
     189                          Kind k, bool s, Type * i = nullptr )
     190                : NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == Ttype || s ),
     191                init( i ) {}
    191192
    192193        const char * typeString() const override;
     
    198199
    199200        const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
    200 private:
     201  private:
    201202        TypeDecl * clone() const override { return new TypeDecl{ *this }; }
    202203        MUTATE_FRIEND
     
    343344        ptr<AsmStmt> stmt;
    344345
    345         AsmDecl( const CodeLocation & loc, AsmStmt *stmt )
     346        AsmDecl( const CodeLocation & loc, AsmStmt * stmt )
    346347        : Decl( loc, "", {}, {} ), stmt(stmt) {}
    347348
    348         const AsmDecl * accept( Visitor &v ) const override { return v.visit( this ); }
    349 private:
    350         AsmDecl *clone() const override { return new AsmDecl( *this ); }
     349        const AsmDecl * accept( Visitor & v ) const override { return v.visit( this ); }
     350private:
     351        AsmDecl * clone() const override { return new AsmDecl( *this ); }
    351352        MUTATE_FRIEND
    352353};
     
    360361        : Decl( loc, "", {}, {} ), cond( condition ), msg( msg ) {}
    361362
    362         const StaticAssertDecl * accept( Visitor &v ) const override { return v.visit( this ); }
     363        const StaticAssertDecl * accept( Visitor & v ) const override { return v.visit( this ); }
    363364private:
    364365        StaticAssertDecl * clone() const override { return new StaticAssertDecl( *this ); }
  • src/AST/Print.cpp

    r1712f542 r596fc4ad  
    13591359                preprint( node );
    13601360                os << "instance of type " << node->name
    1361                    << " (" << (node->kind == ast::TypeVar::Ftype ? "" : "not ") << "function type)";
     1361                   << " (" << (node->kind == ast::TypeDecl::Ftype ? "" : "not ") << "function type)";
    13621362                print( node->params );
    13631363
  • src/AST/Type.hpp

    r1712f542 r596fc4ad  
    99// Author           : Aaron B. Moss
    1010// Created On       : Thu May 9 10:00:00 2019
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Thu May 9 10:00:00 2019
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Dec 11 21:56:46 2019
     13// Update Count     : 5
    1414//
    1515
     
    2626#include "Fwd.hpp"
    2727#include "Node.hpp"          // for Node, ptr, ptr_base
    28 #include "TypeVar.hpp"
    2928#include "Visitor.hpp"
    3029
     
    423422public:
    424423        readonly<TypeDecl> base;
    425         TypeVar::Kind kind;
     424        TypeDecl::Kind kind;
    426425
    427426        TypeInstType( const std::string& n, const TypeDecl * b, CV::Qualifiers q = {},
    428427                std::vector<ptr<Attribute>> && as = {} )
    429428        : ReferenceToType( n, q, std::move(as) ), base( b ), kind( b->kind ) {}
    430         TypeInstType( const std::string& n, TypeVar::Kind k, CV::Qualifiers q = {},
     429        TypeInstType( const std::string& n, TypeDecl::Kind k, CV::Qualifiers q = {},
    431430                std::vector<ptr<Attribute>> && as = {} )
    432431        : ReferenceToType( n, q, std::move(as) ), base(), kind( k ) {}
  • src/AST/TypeEnvironment.cpp

    r1712f542 r596fc4ad  
    99// Author           : Aaron B. Moss
    1010// Created On       : Wed May 29 11:00:00 2019
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Wed May 29 11:00:00 2019
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Dec 11 21:49:13 2019
     13// Update Count     : 4
    1414//
    1515
     
    240240                return true;
    241241        } else if ( auto typeInst = dynamic_cast< const TypeInstType * >( type ) ) {
    242                 return typeInst->kind == TypeVar::Ftype;
     242                return typeInst->kind == TypeDecl::Ftype;
    243243        } else return false;
    244244}
     
    248248        bool tyVarCompatible( const TypeDecl::Data & data, const Type * type ) {
    249249                switch ( data.kind ) {
    250                   case TypeVar::Dtype:
     250                  case TypeDecl::Dtype:
    251251                        // to bind to an object type variable, the type must not be a function type.
    252252                        // if the type variable is specified to be a complete type then the incoming
     
    254254                        // xxx - should this also check that type is not a tuple type and that it's not a ttype?
    255255                        return ! isFtype( type ) && ( ! data.isComplete || type->isComplete() );
    256                   case TypeVar::Ftype:
     256                  case TypeDecl::Ftype:
    257257                        return isFtype( type );
    258                   case TypeVar::Ttype:
     258                  case TypeDecl::Ttype:
    259259                        // ttype unifies with any tuple type
    260260                        return dynamic_cast< const TupleType * >( type ) || Tuples::isTtype( type );
  • src/AST/TypeEnvironment.hpp

    r1712f542 r596fc4ad  
    99// Author           : Aaron B. Moss
    1010// Created On       : Wed May 29 11:00:00 2019
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Wed May 29 11:00:00 2019
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Dec 11 21:55:54 2019
     13// Update Count     : 3
    1414//
    1515
     
    2828#include "Type.hpp"
    2929#include "TypeSubstitution.hpp"
    30 #include "TypeVar.hpp"
    3130#include "Common/Indenter.h"
    3231#include "ResolvExpr/WidenMode.h"
     
    107106        /// Singleton class constructor from substitution
    108107        EqvClass( const std::string & v, const Type * b )
    109         : vars{ v }, bound( b ), allowWidening( false ), data( TypeVar::Dtype, false ) {}
     108        : vars{ v }, bound( b ), allowWidening( false ), data( TypeDecl::Dtype, false ) {}
    110109
    111110        /// Single-var constructor (strips qualifiers from bound type)
  • src/AST/module.mk

    r1712f542 r596fc4ad  
    1010## Author           : Thierry Delisle
    1111## Created On       : Thu May 09 16:05:36 2019
    12 ## Last Modified By :
    13 ## Last Modified On :
    14 ## Update Count     :
     12## Last Modified By : Peter A. Buhr
     13## Last Modified On : Sat Dec 14 07:29:10 2019
     14## Update Count     : 3
    1515###############################################################################
    1616
     
    3434        AST/TypeSubstitution.cpp
    3535
    36 
    37 
    3836SRC += $(SRC_AST)
    3937SRCDEMANGLE += $(SRC_AST)
  • src/CodeGen/CodeGenerator.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Oct 19 19:30:38 2019
    13 // Update Count     : 506
     12// Last Modified On : Fri Dec 13 23:13:28 2019
     13// Update Count     : 508
    1414//
    1515#include "CodeGenerator.h"
     
    2323#include "InitTweak/InitTweak.h"     // for getPointerBase
    2424#include "OperatorTable.h"           // for OperatorInfo, operatorLookup
    25 #include "Parser/LinkageSpec.h"      // for Spec, Intrinsic
     25#include "SynTree/LinkageSpec.h"     // for Spec, Intrinsic
    2626#include "SynTree/Attribute.h"       // for Attribute
    2727#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
  • src/CodeGen/FixMain.h

    r1712f542 r596fc4ad  
    1010// Created On       : Thr Jan 12 14:11:09 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 21 22:16:59 2017
    13 // Update Count     : 1
     12// Last Modified On : Fri Dec 13 23:12:21 2019
     13// Update Count     : 3
    1414//
    1515
     
    1919#include <memory>
    2020
    21 #include "Parser/LinkageSpec.h"
     21#include "SynTree/LinkageSpec.h"
    2222
    2323class FunctionDecl;
  • src/CodeGen/FixNames.cc

    r1712f542 r596fc4ad  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jun 28 15:26:00 2017
    13 // Update Count     : 20
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Dec 13 23:39:14 2019
     13// Update Count     : 21
    1414//
    1515
     
    2222#include "Common/SemanticError.h"  // for SemanticError
    2323#include "FixMain.h"               // for FixMain
    24 #include "Parser/LinkageSpec.h"    // for Cforall, isMangled
    2524#include "SymTab/Mangler.h"        // for Mangler
     25#include "SynTree/LinkageSpec.h"   // for Cforall, isMangled
    2626#include "SynTree/Constant.h"      // for Constant
    2727#include "SynTree/Declaration.h"   // for FunctionDecl, ObjectDecl, Declarat...
  • src/CodeGen/Generate.cc

    r1712f542 r596fc4ad  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Aug 18 15:39:00 2017
    13 // Update Count     : 7
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Dec 13 23:38:56 2019
     13// Update Count     : 8
    1414//
    1515#include "Generate.h"
     
    2222#include "GenType.h"                 // for genPrettyType
    2323#include "Common/PassVisitor.h"      // for PassVisitor
    24 #include "Parser/LinkageSpec.h"      // for isBuiltin, isGeneratable
     24#include "SynTree/LinkageSpec.h"     // for isBuiltin, isGeneratable
    2525#include "SynTree/BaseSyntaxNode.h"  // for BaseSyntaxNode
    2626#include "SynTree/Declaration.h"     // for Declaration
  • src/CodeGen/module.mk

    r1712f542 r596fc4ad  
    1111## Created On       : Mon Jun  1 17:49:17 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Tue Jun  2 11:17:02 2015
    14 ## Update Count     : 3
     13## Last Modified On : Sat Dec 14 07:29:42 2019
     14## Update Count     : 4
    1515###############################################################################
    1616
     
    2424        CodeGen/OperatorTable.cc
    2525
    26 
    2726SRC += $(SRC_CODEGEN) CodeGen/Generate.cc CodeGen/FixNames.cc
    2827SRCDEMANGLE += $(SRC_CODEGEN)
  • src/CodeTools/DeclStats.cc

    r1712f542 r596fc4ad  
    99// Author           : Aaron Moss
    1010// Created On       : Wed Jan 31 16:40:00 2016
    11 // Last Modified By : Aaron Moss
    12 // Last Modified On : Wed Jan 31 16:40:00 2016
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Dec 13 23:39:33 2019
     13// Update Count     : 2
    1414//
    1515
     
    2626#include "Common/VectorMap.h"      // for VectorMap
    2727#include "GenPoly/GenPoly.h"       // for hasPolyBase
    28 #include "Parser/LinkageSpec.h"    // for ::NoOfSpecs, Spec
     28#include "SynTree/LinkageSpec.h"   // for ::NoOfSpecs, Spec
    2929#include "SynTree/Declaration.h"   // for FunctionDecl, TypeDecl, Declaration
    3030#include "SynTree/Expression.h"    // for UntypedExpr, Expression
  • src/Common/Debug.h

    r1712f542 r596fc4ad  
    99// Author           : Rob Schluntz
    1010// Created On       : Fri Sep 1 11:09:14 2017
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri Sep 1 11:09:36 2017
    13 // Update Count     : 2
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Dec 13 23:39:42 2019
     13// Update Count     : 3
    1414//
    1515
     
    2121
    2222#include "CodeGen/Generate.h"
    23 #include "Parser/LinkageSpec.h"
     23#include "SynTree/LinkageSpec.h"
    2424#include "SynTree/Declaration.h"
    2525
  • src/Concurrency/Keywords.cc

    r1712f542 r596fc4ad  
    1111// Last Modified By :
    1212// Last Modified On :
    13 // Update Count     : 9
     13// Update Count     : 10
    1414//
    1515
     
    2424#include "CodeGen/OperatorTable.h" // for isConstructor
    2525#include "InitTweak/InitTweak.h"   // for getPointerBase
    26 #include "Parser/LinkageSpec.h"    // for Cforall
     26#include "SynTree/LinkageSpec.h"   // for Cforall
    2727#include "SynTree/Constant.h"      // for Constant
    2828#include "SynTree/Declaration.h"   // for StructDecl, FunctionDecl, ObjectDecl
  • src/Concurrency/Waitfor.cc

    r1712f542 r596fc4ad  
    1111// Last Modified By :
    1212// Last Modified On :
    13 // Update Count     : 10
     13// Update Count     : 11
    1414//
    1515
     
    2727#include "CodeGen/OperatorTable.h" // for isConstructor
    2828#include "InitTweak/InitTweak.h"   // for getPointerBase
    29 #include "Parser/LinkageSpec.h"    // for Cforall
    3029#include "ResolvExpr/Resolver.h"   // for findVoidExpression
     30#include "SynTree/LinkageSpec.h"   // for Cforall
    3131#include "SynTree/Constant.h"      // for Constant
    3232#include "SynTree/Declaration.h"   // for StructDecl, FunctionDecl, ObjectDecl
  • src/ControlStruct/ExceptTranslate.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Wed Jun 14 16:49:00 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 13 18:15:29 2019
    13 // Update Count     : 11
     12// Last Modified On : Fri Dec 13 23:40:15 2019
     13// Update Count     : 12
    1414//
    1515
     
    2424#include "Common/SemanticError.h"     // for SemanticError
    2525#include "Common/utility.h"           // for CodeLocation
    26 #include "Parser/LinkageSpec.h"       // for Cforall
     26#include "SynTree/LinkageSpec.h"      // for Cforall
    2727#include "SynTree/Attribute.h"        // for Attribute
    2828#include "SynTree/Constant.h"         // for Constant
  • src/GenPoly/Box.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun 21 15:49:59 2017
    13 // Update Count     : 346
     12// Last Modified On : Fri Dec 13 23:40:34 2019
     13// Update Count     : 347
    1414//
    1515
     
    3737#include "InitTweak/InitTweak.h"         // for getFunctionName, isAssignment
    3838#include "Lvalue.h"                      // for generalizedLvalue
    39 #include "Parser/LinkageSpec.h"          // for C, Spec, Cforall, Intrinsic
    4039#include "ResolvExpr/TypeEnvironment.h"  // for EqvClass
    4140#include "ResolvExpr/typeops.h"          // for typesCompatible
     
    4443#include "SymTab/Indexer.h"              // for Indexer
    4544#include "SymTab/Mangler.h"              // for Mangler
     45#include "SynTree/LinkageSpec.h"         // for C, Spec, Cforall, Intrinsic
    4646#include "SynTree/Attribute.h"           // for Attribute
    4747#include "SynTree/Constant.h"            // for Constant
  • src/GenPoly/Lvalue.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 17 09:11:18 2017
    13 // Update Count     : 5
     12// Last Modified On : Fri Dec 13 23:14:38 2019
     13// Update Count     : 7
    1414//
    1515
     
    1717#include <string>                        // for string
    1818
     19#include "Common/UniqueName.h"
    1920#include "Common/PassVisitor.h"
    2021#include "GenPoly.h"                     // for isPolyType
     
    2223
    2324#include "InitTweak/InitTweak.h"
    24 #include "Parser/LinkageSpec.h"          // for Spec, isBuiltin, Intrinsic
    2525#include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
    2626#include "ResolvExpr/Unify.h"            // for unify
    2727#include "ResolvExpr/typeops.h"
    2828#include "SymTab/Indexer.h"              // for Indexer
     29#include "SynTree/LinkageSpec.h"         // for Spec, isBuiltin, Intrinsic
    2930#include "SynTree/Declaration.h"         // for Declaration, FunctionDecl
    3031#include "SynTree/Expression.h"          // for Expression, ConditionalExpr
  • src/GenPoly/Specialize.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 07:53:59 2017
    13 // Update Count     : 31
     12// Last Modified On : Fri Dec 13 23:40:49 2019
     13// Update Count     : 32
    1414//
    1515
     
    2727#include "GenPoly.h"                     // for getFunctionType
    2828#include "InitTweak/InitTweak.h"         // for isIntrinsicCallExpr
    29 #include "Parser/LinkageSpec.h"          // for C
    3029#include "ResolvExpr/FindOpenVars.h"     // for findOpenVars
    3130#include "ResolvExpr/TypeEnvironment.h"  // for OpenVarSet, AssertionSet
    3231#include "Specialize.h"
     32#include "SynTree/LinkageSpec.h"         // for C
    3333#include "SynTree/Attribute.h"           // for Attribute
    3434#include "SynTree/Declaration.h"         // for FunctionDecl, DeclarationWit...
  • src/InitTweak/FixGlobalInit.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 04 15:14:56 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 07:53:11 2017
    13 // Update Count     : 18
     12// Last Modified On : Fri Dec 13 23:41:10 2019
     13// Update Count     : 19
    1414//
    1515
     
    2323#include "Common/UniqueName.h"     // for UniqueName
    2424#include "InitTweak.h"             // for isIntrinsicSingleArgCallStmt
    25 #include "Parser/LinkageSpec.h"    // for C
     25#include "SynTree/LinkageSpec.h"   // for C
    2626#include "SynTree/Attribute.h"     // for Attribute
    2727#include "SynTree/Constant.h"      // for Constant
  • src/InitTweak/FixInit.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Wed Jan 13 16:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 13 18:15:56 2019
    13 // Update Count     : 76
     12// Last Modified On : Fri Dec 13 23:41:27 2019
     13// Update Count     : 77
    1414//
    1515#include "FixInit.h"
     
    3838#include "GenPoly/GenPoly.h"           // for getFunctionType
    3939#include "InitTweak.h"                 // for getFunctionName, getCallArg
    40 #include "Parser/LinkageSpec.h"        // for C, Spec, Cforall, isBuiltin
    4140#include "ResolvExpr/Resolver.h"       // for findVoidExpression
    4241#include "ResolvExpr/typeops.h"        // for typesCompatible
     
    4443#include "SymTab/Indexer.h"            // for Indexer
    4544#include "SymTab/Mangler.h"            // for Mangler
     45#include "SynTree/LinkageSpec.h"       // for C, Spec, Cforall, isBuiltin
    4646#include "SynTree/Attribute.h"         // for Attribute
    4747#include "SynTree/Constant.h"          // for Constant
  • src/InitTweak/GenInit.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 17 09:12:36 2017
    13 // Update Count     : 183
     12// Last Modified On : Fri Dec 13 23:15:10 2019
     13// Update Count     : 184
    1414//
    1515#include "GenInit.h"
     
    3434#include "GenPoly/ScopedSet.h"         // for ScopedSet, ScopedSet<>::const_iter...
    3535#include "InitTweak.h"                 // for isConstExpr, InitExpander, checkIn...
    36 #include "Parser/LinkageSpec.h"        // for isOverridable, C
    3736#include "ResolvExpr/Resolver.h"
    3837#include "SymTab/Autogen.h"            // for genImplicitCall
    3938#include "SymTab/Mangler.h"            // for Mangler
     39#include "SynTree/LinkageSpec.h"       // for isOverridable, C
    4040#include "SynTree/Declaration.h"       // for ObjectDecl, DeclarationWithType
    4141#include "SynTree/Expression.h"        // for VariableExpr, UntypedExpr, Address...
  • src/InitTweak/InitTweak.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Fri May 13 11:26:36 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 25 22:21:48 2019
    13 // Update Count     : 7
     12// Last Modified On : Fri Dec 13 23:15:52 2019
     13// Update Count     : 8
    1414//
    1515
     
    3333#include "GenPoly/GenPoly.h"       // for getFunctionType
    3434#include "InitTweak.h"
    35 #include "Parser/LinkageSpec.h"    // for Spec, isBuiltin, Intrinsic
    3635#include "ResolvExpr/typeops.h"    // for typesCompatibleIgnoreQualifiers
    3736#include "SymTab/Autogen.h"
    3837#include "SymTab/Indexer.h"        // for Indexer
     38#include "SynTree/LinkageSpec.h"   // for Spec, isBuiltin, Intrinsic
    3939#include "SynTree/Attribute.h"     // for Attribute
    4040#include "SynTree/Constant.h"      // for Constant
  • src/MakeLibCfa.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sat May 16 10:33:33 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 17 21:08:09 2019
    13 // Update Count     : 41
     12// Last Modified On : Fri Dec 13 23:41:40 2019
     13// Update Count     : 42
    1414//
    1515
     
    2323#include "Common/SemanticError.h"   // for SemanticError
    2424#include "Common/UniqueName.h"      // for UniqueName
    25 #include "Parser/LinkageSpec.h"     // for Spec, Intrinsic, C
     25#include "SynTree/LinkageSpec.h"    // for Spec, Intrinsic, C
    2626#include "SynTree/Declaration.h"    // for FunctionDecl, ObjectDecl, Declara...
    2727#include "SynTree/Expression.h"     // for NameExpr, UntypedExpr, VariableExpr
  • src/Makefile.in

    r1712f542 r596fc4ad  
    212212        SymTab/Indexer.$(OBJEXT) SymTab/Mangler.$(OBJEXT) \
    213213        SymTab/ManglerCommon.$(OBJEXT) SymTab/Validate.$(OBJEXT)
    214 am__objects_7 = SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \
    215         SynTree/BasicType.$(OBJEXT) SynTree/PointerType.$(OBJEXT) \
    216         SynTree/ArrayType.$(OBJEXT) SynTree/ReferenceType.$(OBJEXT) \
    217         SynTree/FunctionType.$(OBJEXT) \
    218         SynTree/ReferenceToType.$(OBJEXT) SynTree/TupleType.$(OBJEXT) \
    219         SynTree/TypeofType.$(OBJEXT) SynTree/AttrType.$(OBJEXT) \
    220         SynTree/VarArgsType.$(OBJEXT) SynTree/ZeroOneType.$(OBJEXT) \
    221         SynTree/Constant.$(OBJEXT) SynTree/Expression.$(OBJEXT) \
    222         SynTree/TupleExpr.$(OBJEXT) SynTree/CommaExpr.$(OBJEXT) \
    223         SynTree/TypeExpr.$(OBJEXT) SynTree/ApplicationExpr.$(OBJEXT) \
    224         SynTree/AddressExpr.$(OBJEXT) SynTree/Statement.$(OBJEXT) \
    225         SynTree/CompoundStmt.$(OBJEXT) SynTree/DeclStmt.$(OBJEXT) \
     214am__objects_7 = SynTree/AddressExpr.$(OBJEXT) \
     215        SynTree/AggregateDecl.$(OBJEXT) \
     216        SynTree/ApplicationExpr.$(OBJEXT) SynTree/ArrayType.$(OBJEXT) \
     217        SynTree/AttrType.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \
     218        SynTree/BasicType.$(OBJEXT) SynTree/CommaExpr.$(OBJEXT) \
     219        SynTree/CompoundStmt.$(OBJEXT) SynTree/Constant.$(OBJEXT) \
     220        SynTree/DeclReplacer.$(OBJEXT) SynTree/DeclStmt.$(OBJEXT) \
    226221        SynTree/Declaration.$(OBJEXT) \
    227222        SynTree/DeclarationWithType.$(OBJEXT) \
    228         SynTree/ObjectDecl.$(OBJEXT) SynTree/FunctionDecl.$(OBJEXT) \
    229         SynTree/AggregateDecl.$(OBJEXT) \
    230         SynTree/NamedTypeDecl.$(OBJEXT) SynTree/TypeDecl.$(OBJEXT) \
    231         SynTree/Initializer.$(OBJEXT) \
    232         SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \
    233         SynTree/DeclReplacer.$(OBJEXT)
     223        SynTree/Expression.$(OBJEXT) SynTree/FunctionDecl.$(OBJEXT) \
     224        SynTree/FunctionType.$(OBJEXT) SynTree/Initializer.$(OBJEXT) \
     225        SynTree/LinkageSpec.$(OBJEXT) SynTree/NamedTypeDecl.$(OBJEXT) \
     226        SynTree/ObjectDecl.$(OBJEXT) SynTree/PointerType.$(OBJEXT) \
     227        SynTree/ReferenceToType.$(OBJEXT) \
     228        SynTree/ReferenceType.$(OBJEXT) SynTree/Statement.$(OBJEXT) \
     229        SynTree/TupleExpr.$(OBJEXT) SynTree/TupleType.$(OBJEXT) \
     230        SynTree/Type.$(OBJEXT) SynTree/TypeDecl.$(OBJEXT) \
     231        SynTree/TypeExpr.$(OBJEXT) SynTree/TypeSubstitution.$(OBJEXT) \
     232        SynTree/TypeofType.$(OBJEXT) SynTree/VarArgsType.$(OBJEXT) \
     233        SynTree/VoidType.$(OBJEXT) SynTree/ZeroOneType.$(OBJEXT)
    234234am__objects_8 = CompilationState.$(OBJEXT) $(am__objects_1) \
    235235        $(am__objects_2) Concurrency/Keywords.$(OBJEXT) \
    236236        $(am__objects_3) $(am__objects_4) GenPoly/GenPoly.$(OBJEXT) \
    237237        GenPoly/Lvalue.$(OBJEXT) InitTweak/GenInit.$(OBJEXT) \
    238         InitTweak/InitTweak.$(OBJEXT) Parser/LinkageSpec.$(OBJEXT) \
    239         $(am__objects_5) $(am__objects_6) SymTab/Demangle.$(OBJEXT) \
    240         $(am__objects_7) Tuples/TupleAssignment.$(OBJEXT) \
     238        InitTweak/InitTweak.$(OBJEXT) $(am__objects_5) \
     239        $(am__objects_6) SymTab/Demangle.$(OBJEXT) $(am__objects_7) \
     240        Tuples/TupleAssignment.$(OBJEXT) \
    241241        Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \
    242242        Tuples/Tuples.$(OBJEXT) Validate/HandleAttributes.$(OBJEXT) \
     
    261261        InitTweak/GenInit.$(OBJEXT) InitTweak/FixInit.$(OBJEXT) \
    262262        InitTweak/FixGlobalInit.$(OBJEXT) \
    263         InitTweak/InitTweak.$(OBJEXT) Parser/parser.$(OBJEXT) \
    264         Parser/lex.$(OBJEXT) Parser/TypedefTable.$(OBJEXT) \
    265         Parser/ParseNode.$(OBJEXT) Parser/DeclarationNode.$(OBJEXT) \
    266         Parser/ExpressionNode.$(OBJEXT) Parser/StatementNode.$(OBJEXT) \
    267         Parser/InitializerNode.$(OBJEXT) Parser/TypeData.$(OBJEXT) \
    268         Parser/LinkageSpec.$(OBJEXT) Parser/parserutility.$(OBJEXT) \
     263        InitTweak/InitTweak.$(OBJEXT) Parser/DeclarationNode.$(OBJEXT) \
     264        Parser/ExpressionNode.$(OBJEXT) \
     265        Parser/InitializerNode.$(OBJEXT) Parser/ParseNode.$(OBJEXT) \
     266        Parser/StatementNode.$(OBJEXT) Parser/TypeData.$(OBJEXT) \
     267        Parser/TypedefTable.$(OBJEXT) Parser/lex.$(OBJEXT) \
     268        Parser/parser.$(OBJEXT) Parser/parserutility.$(OBJEXT) \
    269269        $(am__objects_5) ResolvExpr/AlternativePrinter.$(OBJEXT) \
    270270        $(am__objects_6) $(am__objects_7) \
     
    559559        InitTweak/GenInit.cc InitTweak/FixInit.cc \
    560560        InitTweak/FixGlobalInit.cc InitTweak/InitTweak.cc \
    561         Parser/parser.yy Parser/lex.ll Parser/TypedefTable.cc \
    562         Parser/ParseNode.cc Parser/DeclarationNode.cc \
    563         Parser/ExpressionNode.cc Parser/StatementNode.cc \
    564         Parser/InitializerNode.cc Parser/TypeData.cc \
    565         Parser/LinkageSpec.cc Parser/parserutility.cc \
    566         $(SRC_RESOLVEXPR) ResolvExpr/AlternativePrinter.cc \
    567         $(SRC_SYMTAB) $(SRC_SYNTREE) Tuples/TupleAssignment.cc \
    568         Tuples/TupleExpansion.cc Tuples/Explode.cc Tuples/Tuples.cc \
     561        Parser/DeclarationNode.cc Parser/ExpressionNode.cc \
     562        Parser/InitializerNode.cc Parser/ParseNode.cc \
     563        Parser/StatementNode.cc Parser/TypeData.cc \
     564        Parser/TypedefTable.cc Parser/lex.ll Parser/parser.yy \
     565        Parser/parserutility.cc $(SRC_RESOLVEXPR) \
     566        ResolvExpr/AlternativePrinter.cc $(SRC_SYMTAB) $(SRC_SYNTREE) \
     567        Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \
     568        Tuples/Explode.cc Tuples/Tuples.cc \
    569569        Validate/HandleAttributes.cc Validate/FindSpecialDecls.cc \
    570570        Virtual/ExpandCasts.cc
     
    572572        Concurrency/Keywords.cc $(SRC_COMMON) $(SRC_CONTROLSTRUCT) \
    573573        GenPoly/GenPoly.cc GenPoly/Lvalue.cc InitTweak/GenInit.cc \
    574         InitTweak/InitTweak.cc Parser/LinkageSpec.cc $(SRC_RESOLVEXPR) \
    575         $(SRC_SYMTAB) SymTab/Demangle.cc $(SRC_SYNTREE) \
    576         Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \
    577         Tuples/Explode.cc Tuples/Tuples.cc \
     574        InitTweak/InitTweak.cc $(SRC_RESOLVEXPR) $(SRC_SYMTAB) \
     575        SymTab/Demangle.cc $(SRC_SYNTREE) Tuples/TupleAssignment.cc \
     576        Tuples/TupleExpansion.cc Tuples/Explode.cc Tuples/Tuples.cc \
    578577        Validate/HandleAttributes.cc Validate/FindSpecialDecls.cc
    579578MAINTAINERCLEANFILES = ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}}
     
    663662
    664663SRC_SYNTREE = \
    665       SynTree/Type.cc \
    666       SynTree/VoidType.cc \
     664      SynTree/AddressExpr.cc \
     665      SynTree/AggregateDecl.cc \
     666      SynTree/ApplicationExpr.cc \
     667      SynTree/ArrayType.cc \
     668      SynTree/AttrType.cc \
     669      SynTree/Attribute.cc \
    667670      SynTree/BasicType.cc \
    668       SynTree/PointerType.cc \
    669       SynTree/ArrayType.cc \
    670       SynTree/ReferenceType.cc \
    671       SynTree/FunctionType.cc \
    672       SynTree/ReferenceToType.cc \
    673       SynTree/TupleType.cc \
    674       SynTree/TypeofType.cc \
    675       SynTree/AttrType.cc \
    676       SynTree/VarArgsType.cc \
    677       SynTree/ZeroOneType.cc \
     671      SynTree/CommaExpr.cc \
     672      SynTree/CompoundStmt.cc \
    678673      SynTree/Constant.cc \
    679       SynTree/Expression.cc \
    680       SynTree/TupleExpr.cc \
    681       SynTree/CommaExpr.cc \
    682       SynTree/TypeExpr.cc \
    683       SynTree/ApplicationExpr.cc \
    684       SynTree/AddressExpr.cc \
    685       SynTree/Statement.cc \
    686       SynTree/CompoundStmt.cc \
     674      SynTree/DeclReplacer.cc \
    687675      SynTree/DeclStmt.cc \
    688676      SynTree/Declaration.cc \
    689677      SynTree/DeclarationWithType.cc \
     678      SynTree/Expression.cc \
     679      SynTree/FunctionDecl.cc \
     680      SynTree/FunctionType.cc \
     681      SynTree/Initializer.cc \
     682      SynTree/LinkageSpec.cc \
     683      SynTree/NamedTypeDecl.cc \
    690684      SynTree/ObjectDecl.cc \
    691       SynTree/FunctionDecl.cc \
    692       SynTree/AggregateDecl.cc \
    693       SynTree/NamedTypeDecl.cc \
     685      SynTree/PointerType.cc \
     686      SynTree/ReferenceToType.cc \
     687      SynTree/ReferenceType.cc \
     688      SynTree/Statement.cc \
     689      SynTree/TupleExpr.cc \
     690      SynTree/TupleType.cc \
     691      SynTree/Type.cc \
    694692      SynTree/TypeDecl.cc \
    695       SynTree/Initializer.cc \
     693      SynTree/TypeExpr.cc \
    696694      SynTree/TypeSubstitution.cc \
    697       SynTree/Attribute.cc \
    698       SynTree/DeclReplacer.cc
     695      SynTree/TypeofType.cc \
     696      SynTree/VarArgsType.cc \
     697      SynTree/VoidType.cc \
     698      SynTree/ZeroOneType.cc
    699699
    700700
     
    869869InitTweak/InitTweak.$(OBJEXT): InitTweak/$(am__dirstamp) \
    870870        InitTweak/$(DEPDIR)/$(am__dirstamp)
    871 Parser/$(am__dirstamp):
    872         @$(MKDIR_P) Parser
    873         @: > Parser/$(am__dirstamp)
    874 Parser/$(DEPDIR)/$(am__dirstamp):
    875         @$(MKDIR_P) Parser/$(DEPDIR)
    876         @: > Parser/$(DEPDIR)/$(am__dirstamp)
    877 Parser/LinkageSpec.$(OBJEXT): Parser/$(am__dirstamp) \
    878         Parser/$(DEPDIR)/$(am__dirstamp)
    879871ResolvExpr/$(am__dirstamp):
    880872        @$(MKDIR_P) ResolvExpr
     
    957949        @$(MKDIR_P) SynTree/$(DEPDIR)
    958950        @: > SynTree/$(DEPDIR)/$(am__dirstamp)
     951SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     952        SynTree/$(DEPDIR)/$(am__dirstamp)
     953SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     954        SynTree/$(DEPDIR)/$(am__dirstamp)
     955SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     956        SynTree/$(DEPDIR)/$(am__dirstamp)
     957SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \
     958        SynTree/$(DEPDIR)/$(am__dirstamp)
     959SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \
     960        SynTree/$(DEPDIR)/$(am__dirstamp)
     961SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \
     962        SynTree/$(DEPDIR)/$(am__dirstamp)
     963SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \
     964        SynTree/$(DEPDIR)/$(am__dirstamp)
     965SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     966        SynTree/$(DEPDIR)/$(am__dirstamp)
     967SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \
     968        SynTree/$(DEPDIR)/$(am__dirstamp)
     969SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \
     970        SynTree/$(DEPDIR)/$(am__dirstamp)
     971SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \
     972        SynTree/$(DEPDIR)/$(am__dirstamp)
     973SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \
     974        SynTree/$(DEPDIR)/$(am__dirstamp)
     975SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \
     976        SynTree/$(DEPDIR)/$(am__dirstamp)
     977SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \
     978        SynTree/$(DEPDIR)/$(am__dirstamp)
     979SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \
     980        SynTree/$(DEPDIR)/$(am__dirstamp)
     981SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     982        SynTree/$(DEPDIR)/$(am__dirstamp)
     983SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \
     984        SynTree/$(DEPDIR)/$(am__dirstamp)
     985SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \
     986        SynTree/$(DEPDIR)/$(am__dirstamp)
     987SynTree/LinkageSpec.$(OBJEXT): SynTree/$(am__dirstamp) \
     988        SynTree/$(DEPDIR)/$(am__dirstamp)
     989SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     990        SynTree/$(DEPDIR)/$(am__dirstamp)
     991SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     992        SynTree/$(DEPDIR)/$(am__dirstamp)
     993SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \
     994        SynTree/$(DEPDIR)/$(am__dirstamp)
     995SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \
     996        SynTree/$(DEPDIR)/$(am__dirstamp)
     997SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \
     998        SynTree/$(DEPDIR)/$(am__dirstamp)
     999SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \
     1000        SynTree/$(DEPDIR)/$(am__dirstamp)
     1001SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     1002        SynTree/$(DEPDIR)/$(am__dirstamp)
     1003SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \
     1004        SynTree/$(DEPDIR)/$(am__dirstamp)
    9591005SynTree/Type.$(OBJEXT): SynTree/$(am__dirstamp) \
    9601006        SynTree/$(DEPDIR)/$(am__dirstamp)
     1007SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
     1008        SynTree/$(DEPDIR)/$(am__dirstamp)
     1009SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
     1010        SynTree/$(DEPDIR)/$(am__dirstamp)
     1011SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \
     1012        SynTree/$(DEPDIR)/$(am__dirstamp)
     1013SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \
     1014        SynTree/$(DEPDIR)/$(am__dirstamp)
     1015SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \
     1016        SynTree/$(DEPDIR)/$(am__dirstamp)
    9611017SynTree/VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \
    9621018        SynTree/$(DEPDIR)/$(am__dirstamp)
    963 SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \
    964         SynTree/$(DEPDIR)/$(am__dirstamp)
    965 SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \
    966         SynTree/$(DEPDIR)/$(am__dirstamp)
    967 SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \
    968         SynTree/$(DEPDIR)/$(am__dirstamp)
    969 SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \
    970         SynTree/$(DEPDIR)/$(am__dirstamp)
    971 SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \
    972         SynTree/$(DEPDIR)/$(am__dirstamp)
    973 SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \
    974         SynTree/$(DEPDIR)/$(am__dirstamp)
    975 SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \
    976         SynTree/$(DEPDIR)/$(am__dirstamp)
    977 SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \
    978         SynTree/$(DEPDIR)/$(am__dirstamp)
    979 SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \
    980         SynTree/$(DEPDIR)/$(am__dirstamp)
    981 SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \
    982         SynTree/$(DEPDIR)/$(am__dirstamp)
    9831019SynTree/ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \
    984         SynTree/$(DEPDIR)/$(am__dirstamp)
    985 SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \
    986         SynTree/$(DEPDIR)/$(am__dirstamp)
    987 SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \
    988         SynTree/$(DEPDIR)/$(am__dirstamp)
    989 SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    990         SynTree/$(DEPDIR)/$(am__dirstamp)
    991 SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    992         SynTree/$(DEPDIR)/$(am__dirstamp)
    993 SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    994         SynTree/$(DEPDIR)/$(am__dirstamp)
    995 SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    996         SynTree/$(DEPDIR)/$(am__dirstamp)
    997 SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \
    998         SynTree/$(DEPDIR)/$(am__dirstamp)
    999 SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \
    1000         SynTree/$(DEPDIR)/$(am__dirstamp)
    1001 SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \
    1002         SynTree/$(DEPDIR)/$(am__dirstamp)
    1003 SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \
    1004         SynTree/$(DEPDIR)/$(am__dirstamp)
    1005 SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \
    1006         SynTree/$(DEPDIR)/$(am__dirstamp)
    1007 SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \
    1008         SynTree/$(DEPDIR)/$(am__dirstamp)
    1009 SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    1010         SynTree/$(DEPDIR)/$(am__dirstamp)
    1011 SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    1012         SynTree/$(DEPDIR)/$(am__dirstamp)
    1013 SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    1014         SynTree/$(DEPDIR)/$(am__dirstamp)
    1015 SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    1016         SynTree/$(DEPDIR)/$(am__dirstamp)
    1017 SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \
    1018         SynTree/$(DEPDIR)/$(am__dirstamp)
    1019 SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \
    1020         SynTree/$(DEPDIR)/$(am__dirstamp)
    1021 SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \
    1022         SynTree/$(DEPDIR)/$(am__dirstamp)
    1023 SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \
    1024         SynTree/$(DEPDIR)/$(am__dirstamp)
    1025 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \
    10261020        SynTree/$(DEPDIR)/$(am__dirstamp)
    10271021Tuples/$(am__dirstamp):
     
    11401134InitTweak/FixGlobalInit.$(OBJEXT): InitTweak/$(am__dirstamp) \
    11411135        InitTweak/$(DEPDIR)/$(am__dirstamp)
     1136Parser/$(am__dirstamp):
     1137        @$(MKDIR_P) Parser
     1138        @: > Parser/$(am__dirstamp)
     1139Parser/$(DEPDIR)/$(am__dirstamp):
     1140        @$(MKDIR_P) Parser/$(DEPDIR)
     1141        @: > Parser/$(DEPDIR)/$(am__dirstamp)
     1142Parser/DeclarationNode.$(OBJEXT): Parser/$(am__dirstamp) \
     1143        Parser/$(DEPDIR)/$(am__dirstamp)
     1144Parser/ExpressionNode.$(OBJEXT): Parser/$(am__dirstamp) \
     1145        Parser/$(DEPDIR)/$(am__dirstamp)
     1146Parser/InitializerNode.$(OBJEXT): Parser/$(am__dirstamp) \
     1147        Parser/$(DEPDIR)/$(am__dirstamp)
     1148Parser/ParseNode.$(OBJEXT): Parser/$(am__dirstamp) \
     1149        Parser/$(DEPDIR)/$(am__dirstamp)
     1150Parser/StatementNode.$(OBJEXT): Parser/$(am__dirstamp) \
     1151        Parser/$(DEPDIR)/$(am__dirstamp)
     1152Parser/TypeData.$(OBJEXT): Parser/$(am__dirstamp) \
     1153        Parser/$(DEPDIR)/$(am__dirstamp)
     1154Parser/TypedefTable.$(OBJEXT): Parser/$(am__dirstamp) \
     1155        Parser/$(DEPDIR)/$(am__dirstamp)
     1156Parser/lex.$(OBJEXT): Parser/$(am__dirstamp) \
     1157        Parser/$(DEPDIR)/$(am__dirstamp)
    11421158Parser/parser.hh: Parser/parser.cc
    11431159        @if test ! -f $@; then rm -f Parser/parser.cc; else :; fi
    11441160        @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) Parser/parser.cc; else :; fi
    11451161Parser/parser.$(OBJEXT): Parser/$(am__dirstamp) \
    1146         Parser/$(DEPDIR)/$(am__dirstamp)
    1147 Parser/lex.$(OBJEXT): Parser/$(am__dirstamp) \
    1148         Parser/$(DEPDIR)/$(am__dirstamp)
    1149 Parser/TypedefTable.$(OBJEXT): Parser/$(am__dirstamp) \
    1150         Parser/$(DEPDIR)/$(am__dirstamp)
    1151 Parser/ParseNode.$(OBJEXT): Parser/$(am__dirstamp) \
    1152         Parser/$(DEPDIR)/$(am__dirstamp)
    1153 Parser/DeclarationNode.$(OBJEXT): Parser/$(am__dirstamp) \
    1154         Parser/$(DEPDIR)/$(am__dirstamp)
    1155 Parser/ExpressionNode.$(OBJEXT): Parser/$(am__dirstamp) \
    1156         Parser/$(DEPDIR)/$(am__dirstamp)
    1157 Parser/StatementNode.$(OBJEXT): Parser/$(am__dirstamp) \
    1158         Parser/$(DEPDIR)/$(am__dirstamp)
    1159 Parser/InitializerNode.$(OBJEXT): Parser/$(am__dirstamp) \
    1160         Parser/$(DEPDIR)/$(am__dirstamp)
    1161 Parser/TypeData.$(OBJEXT): Parser/$(am__dirstamp) \
    11621162        Parser/$(DEPDIR)/$(am__dirstamp)
    11631163Parser/parserutility.$(OBJEXT): Parser/$(am__dirstamp) \
     
    12701270@AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/ExpressionNode.Po@am__quote@
    12711271@AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/InitializerNode.Po@am__quote@
    1272 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/LinkageSpec.Po@am__quote@
    12731272@AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/ParseNode.Po@am__quote@
    12741273@AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/StatementNode.Po@am__quote@
     
    13291328@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/FunctionType.Po@am__quote@
    13301329@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Initializer.Po@am__quote@
     1330@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/LinkageSpec.Po@am__quote@
    13311331@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/NamedTypeDecl.Po@am__quote@
    13321332@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ObjectDecl.Po@am__quote@
  • src/Parser/DeclarationNode.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 07:40:14 2019
    13 // Update Count     : 1123
     12// Last Modified On : Mon Dec 16 15:32:22 2019
     13// Update Count     : 1133
    1414//
    1515
     
    2424#include "Common/UniqueName.h"     // for UniqueName
    2525#include "Common/utility.h"        // for maybeClone, maybeBuild, CodeLocation
    26 #include "Parser/LinkageSpec.h"    // for Spec, linkageName, Cforall
    2726#include "Parser/ParseNode.h"      // for DeclarationNode, ExpressionNode
     27#include "SynTree/LinkageSpec.h"   // for Spec, linkageName, Cforall
    2828#include "SynTree/Attribute.h"     // for Attribute
    2929#include "SynTree/Declaration.h"   // for TypeDecl, ObjectDecl, Declaration
     
    4747const char * DeclarationNode::signednessNames[] = { "signed", "unsigned", "NoSignednessNames" };
    4848const char * DeclarationNode::lengthNames[] = { "short", "long", "long long", "NoLengthNames" };
    49 const char * DeclarationNode::typeClassNames[] = { "otype", "dtype", "ftype", "NoTypeClassNames" };
    5049const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", "__auto_type", "zero_t", "one_t", "NoBuiltinTypeNames" };
    5150
     
    5857
    5958//      variable.name = nullptr;
    60         variable.tyClass = NoTypeClass;
     59        variable.tyClass = TypeDecl::NUMBER_OF_KINDS;
    6160        variable.assertions = nullptr;
    6261        variable.initializer = nullptr;
     
    134133
    135134        if ( linkage != LinkageSpec::Cforall ) {
    136                 os << LinkageSpec::linkageName( linkage ) << " ";
     135                os << LinkageSpec::name( linkage ) << " ";
    137136        } // if
    138137
     
    312311} // DeclarationNode::newFromTypeGen
    313312
    314 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, const string * name ) {
     313DeclarationNode * DeclarationNode::newTypeParam( TypeDecl::Kind tc, const string * name ) {
    315314        DeclarationNode * newnode = new DeclarationNode;
    316315        newnode->type = nullptr;
     
    670669
    671670DeclarationNode * DeclarationNode::addAssertions( DeclarationNode * assertions ) {
    672         if ( variable.tyClass != NoTypeClass ) {
     671        if ( variable.tyClass != TypeDecl::NUMBER_OF_KINDS ) {
    673672                if ( variable.assertions ) {
    674673                        variable.assertions->appendList( assertions );
     
    875874
    876875DeclarationNode * DeclarationNode::addTypeInitializer( DeclarationNode * init ) {
    877         assertf( variable.tyClass != NoTypeClass, "Called addTypeInitializer on something that isn't a type variable." );
     876        assertf( variable.tyClass != TypeDecl::NUMBER_OF_KINDS, "Called addTypeInitializer on something that isn't a type variable." );
    878877        variable.initializer = init;
    879878        return this;
     
    10741073        } // if
    10751074
    1076         if ( variable.tyClass != NoTypeClass ) {
     1075        if ( variable.tyClass != TypeDecl::NUMBER_OF_KINDS ) {
    10771076                // otype is internally converted to dtype + otype parameters
    10781077                static const TypeDecl::Kind kindMap[] = { TypeDecl::Dtype, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype };
    1079                 assertf( sizeof(kindMap)/sizeof(kindMap[0]) == NoTypeClass, "DeclarationNode::build: kindMap is out of sync." );
     1078                static_assert( sizeof(kindMap)/sizeof(kindMap[0]) == TypeDecl::NUMBER_OF_KINDS, "DeclarationNode::build: kindMap is out of sync." );
    10801079                assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." );
    1081                 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.tyClass == Otype, variable.initializer ? variable.initializer->buildType() : nullptr );
     1080                TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.tyClass == TypeDecl::Otype, variable.initializer ? variable.initializer->buildType() : nullptr );
    10821081                buildList( variable.assertions, ret->get_assertions() );
    10831082                return ret;
  • src/Parser/ExpressionNode.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 10 23:01:47 2019
    13 // Update Count     : 980
     12// Last Modified On : Wed Dec 18 21:14:58 2019
     13// Update Count     : 981
    1414//
    1515
     
    265265        static const BasicType::Kind kind[2][12] = {
    266266                { BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::uuFloat80, BasicType::uuFloat128, BasicType::uFloat16, BasicType::uFloat32, BasicType::uFloat32x, BasicType::uFloat64, BasicType::uFloat64x, BasicType::uFloat128, BasicType::uFloat128x },
    267                 { BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, (BasicType::Kind)-1, (BasicType::Kind)-1, BasicType::uFloat16Complex, BasicType::uFloat32Complex, BasicType::uFloat32xComplex, BasicType::uFloat64Complex, BasicType::uFloat64xComplex, BasicType::uFloat128Complex, BasicType::uFloat128xComplex },
     267                { BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::NUMBER_OF_BASIC_TYPES, BasicType::NUMBER_OF_BASIC_TYPES, BasicType::uFloat16Complex, BasicType::uFloat32Complex, BasicType::uFloat32xComplex, BasicType::uFloat64Complex, BasicType::uFloat64xComplex, BasicType::uFloat128Complex, BasicType::uFloat128xComplex },
    268268        };
    269269
     
    374374
    375375Expression * build_field_name_FLOATING_DECIMALconstant( const string & str ) {
    376         if ( str[str.size()-1] != '.' ) SemanticError( yylloc, "invalid tuple index " + str );
     376        if ( str[str.size() - 1] != '.' ) SemanticError( yylloc, "invalid tuple index " + str );
    377377        Expression * ret = build_constantInteger( *new string( str.substr( 0, str.size()-1 ) ) );
    378378        delete &str;
  • src/Parser/ParseNode.h

    r1712f542 r596fc4ad  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 07:40:07 2019
    13 // Update Count     : 882
     12// Last Modified On : Mon Dec 16 07:46:01 2019
     13// Update Count     : 888
    1414//
    1515
     
    2828#include "Common/UniqueName.h"     // for UniqueName
    2929#include "Common/utility.h"        // for maybeClone, maybeBuild
    30 #include "Parser/LinkageSpec.h"    // for Spec
     30#include "SynTree/LinkageSpec.h"   // for Spec
    3131#include "SynTree/Declaration.h"   // for Aggregate
    3232#include "SynTree/Expression.h"    // for Expression, ConstantExpr (ptr only)
     
    218218        enum Length { Short, Long, LongLong, NoLength };
    219219        static const char * lengthNames[];
    220         enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass };
    221         static const char * typeClassNames[];
    222220        enum BuiltinType { Valist, AutoType, Zero, One, NoBuiltinType };
    223221        static const char * builtinTypeNames[];
     
    241239        static DeclarationNode * newName( const std::string * );
    242240        static DeclarationNode * newFromTypeGen( const std::string *, ExpressionNode * params );
    243         static DeclarationNode * newTypeParam( TypeClass, const std::string * );
     241        static DeclarationNode * newTypeParam( TypeDecl::Kind, const std::string * );
    244242        static DeclarationNode * newTrait( const std::string * name, DeclarationNode * params, DeclarationNode * asserts );
    245243        static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params );
     
    311309        struct Variable_t {
    312310//              const std::string * name;
    313                 DeclarationNode::TypeClass tyClass;
     311                TypeDecl::Kind tyClass;
    314312                DeclarationNode * assertions;
    315313                DeclarationNode * initializer;
  • src/Parser/TypeData.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 07:48:33 2019
    13 // Update Count     : 659
     12// Last Modified On : Mon Dec 16 07:56:46 2019
     13// Update Count     : 662
    1414//
    1515
     
    489489        for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i, n = (DeclarationNode*)n->get_next() ) {
    490490                TypeDecl * td = static_cast<TypeDecl *>(*i);
    491                 if ( n->variable.tyClass == DeclarationNode::Otype ) {
     491                if ( n->variable.tyClass == TypeDecl::Otype ) {
    492492                        // add assertion parameters to `type' tyvars in reverse order
    493493                        // add dtor:  void ^?{}(T *)
     
    522522        switch ( td->kind ) {
    523523          case TypeData::Unknown:
    524                         // fill in implicit int
    525                         return new BasicType( buildQualifiers( td ), BasicType::SignedInt );
     524                // fill in implicit int
     525                return new BasicType( buildQualifiers( td ), BasicType::SignedInt );
    526526          case TypeData::Basic:
    527                         return buildBasicType( td );
     527                return buildBasicType( td );
    528528          case TypeData::Pointer:
    529                         return buildPointer( td );
     529                return buildPointer( td );
    530530          case TypeData::Array:
    531                         return buildArray( td );
     531                return buildArray( td );
    532532          case TypeData::Reference:
    533                         return buildReference( td );
     533                return buildReference( td );
    534534          case TypeData::Function:
    535                         return buildFunction( td );
     535                return buildFunction( td );
    536536          case TypeData::AggregateInst:
    537                         return buildAggInst( td );
     537                return buildAggInst( td );
    538538          case TypeData::EnumConstant:
    539                         // the name gets filled in later -- by SymTab::Validate
    540                         return new EnumInstType( buildQualifiers( td ), "" );
     539                // the name gets filled in later -- by SymTab::Validate
     540                return new EnumInstType( buildQualifiers( td ), "" );
    541541          case TypeData::SymbolicInst:
    542                         return buildSymbolicInst( td );
     542                return buildSymbolicInst( td );
    543543          case TypeData::Tuple:
    544                         return buildTuple( td );
     544                return buildTuple( td );
    545545          case TypeData::Typeof:
    546546          case TypeData::Basetypeof:
    547                         return buildTypeof( td );
     547                return buildTypeof( td );
    548548          case TypeData::Builtin:
    549                         if (td->builtintype == DeclarationNode::Zero) {
    550                                 return new ZeroType( noQualifiers );
    551                         }
    552                         else if (td->builtintype == DeclarationNode::One) {
    553                                 return new OneType( noQualifiers );
    554                         }
    555                         else {
    556                                 return new VarArgsType( buildQualifiers( td ) );
    557                         }
     549                switch ( td->builtintype ) {
     550                  case DeclarationNode::Zero:
     551                        return new ZeroType( noQualifiers );
     552                  case DeclarationNode::One:
     553                        return new OneType( noQualifiers );
     554                  default:
     555                        return new VarArgsType( buildQualifiers( td ) );
     556                } // switch
    558557          case TypeData::GlobalScope:
    559                         return new GlobalScopeType();
    560                 case TypeData::Qualified:
    561                         return new QualifiedType( buildQualifiers( td ), typebuild( td->qualified.parent ), typebuild( td->qualified.child ) );
     558                return new GlobalScopeType();
     559          case TypeData::Qualified:
     560                return new QualifiedType( buildQualifiers( td ), typebuild( td->qualified.parent ), typebuild( td->qualified.child ) );
    562561          case TypeData::Symbolic:
    563562          case TypeData::Enum:
    564563          case TypeData::Aggregate:
    565                         assert( false );
     564                assert( false );
    566565        } // switch
    567566
  • src/Parser/TypeData.h

    r1712f542 r596fc4ad  
    1010// Created On       : Sat May 16 15:18:36 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 10 23:01:07 2019
    13 // Update Count     : 198
     12// Last Modified On : Fri Dec 13 23:42:35 2019
     13// Update Count     : 199
    1414//
    1515
     
    2121
    2222#include "ParseNode.h"           // for DeclarationNode, DeclarationNode::Ag...
    23 #include "Parser/LinkageSpec.h" // for Spec
     23#include "SynTree/LinkageSpec.h" // for Spec
    2424#include "SynTree/Type.h"        // for Type, ReferenceToType (ptr only)
    2525#include "SynTree/SynTree.h"     // for Visitor Nodes
  • src/Parser/module.mk

    r1712f542 r596fc4ad  
    1111## Created On       : Sat May 16 15:29:09 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Wed Jun 28 21:58:29 2017
    14 ## Update Count     : 104
     13## Last Modified On : Sat Dec 14 07:34:47 2019
     14## Update Count     : 107
    1515###############################################################################
    1616
     
    1919AM_YFLAGS = -d -t -v
    2020
    21 SRC += Parser/parser.yy \
    22        Parser/lex.ll \
    23        Parser/TypedefTable.cc \
    24        Parser/ParseNode.cc \
     21SRC += \
    2522       Parser/DeclarationNode.cc \
    2623       Parser/ExpressionNode.cc \
     24       Parser/InitializerNode.cc \
     25       Parser/ParseNode.cc \
    2726       Parser/StatementNode.cc \
    28        Parser/InitializerNode.cc \
    2927       Parser/TypeData.cc \
    30        Parser/LinkageSpec.cc \
     28       Parser/TypedefTable.cc \
     29       Parser/lex.ll \
     30       Parser/parser.yy \
    3131       Parser/parserutility.cc
    3232
    33 SRCDEMANGLE += \
    34         Parser/LinkageSpec.cc
    35 
    36 
    3733MOSTLYCLEANFILES += Parser/lex.cc Parser/parser.cc Parser/parser.hh Parser/parser.output
  • src/Parser/parser.yy

    r1712f542 r596fc4ad  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 12 17:54:22 2019
    13 // Update Count     : 4404
     12// Last Modified On : Mon Dec 16 15:32:58 2019
     13// Update Count     : 4409
    1414//
    1515
     
    5555#include "TypedefTable.h"
    5656#include "TypeData.h"
    57 #include "LinkageSpec.h"
     57#include "SynTree/LinkageSpec.h"
    5858#include "Common/SemanticError.h"                                               // error_str
    5959#include "Common/utility.h"                                                             // for maybeMoveBuild, maybeBuild, CodeLo...
     
    238238        DeclarationNode * decl;
    239239        AggregateDecl::Aggregate aggKey;
    240         DeclarationNode::TypeClass tclass;
     240        TypeDecl::Kind tclass;
    241241        StatementNode * sn;
    242242        WaitForStmt * wfs;
     
    24372437        | type_specifier identifier_parameter_declarator
    24382438        | assertion_list
    2439                 { $$ = DeclarationNode::newTypeParam( DeclarationNode::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); }
     2439                { $$ = DeclarationNode::newTypeParam( TypeDecl::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); }
    24402440        ;
    24412441
    24422442type_class:                                                                                             // CFA
    24432443        OTYPE
    2444                 { $$ = DeclarationNode::Otype; }
     2444                { $$ = TypeDecl::Otype; }
    24452445        | DTYPE
    2446                 { $$ = DeclarationNode::Dtype; }
     2446                { $$ = TypeDecl::Dtype; }
    24472447        | FTYPE
    2448                 { $$ = DeclarationNode::Ftype; }
     2448                { $$ = TypeDecl::Ftype; }
    24492449        | TTYPE
    2450                 { $$ = DeclarationNode::Ttype; }
     2450                { $$ = TypeDecl::Ttype; }
    24512451        ;
    24522452
     
    25892589                {
    25902590                        linkageStack.push( linkage );                           // handle nested extern "C"/"Cforall"
    2591                         linkage = LinkageSpec::linkageUpdate( yylloc, linkage, $2 );
     2591                        linkage = LinkageSpec::update( yylloc, linkage, $2 );
    25922592                }
    25932593          '{' up external_definition_list_opt down '}'
  • src/ResolvExpr/AdjustExprType.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sat May 16 23:41:42 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:34:53 2016
    13 // Update Count     : 4
     12// Last Modified On : Wed Dec 11 21:43:56 2019
     13// Update Count     : 6
    1414//
    1515
     
    133133                        // replace known function-type-variables with pointer-to-function
    134134                        if ( const ast::EqvClass * eqvClass = tenv.lookup( inst->name ) ) {
    135                                 if ( eqvClass->data.kind == ast::TypeVar::Ftype ) {
     135                                if ( eqvClass->data.kind == ast::TypeDecl::Ftype ) {
    136136                                        return new ast::PointerType{ inst };
    137137                                }
    138138                        } else if ( const ast::NamedTypeDecl * ntDecl = symtab.lookupType( inst->name ) ) {
    139139                                if ( auto tyDecl = dynamic_cast< const ast::TypeDecl * >( ntDecl ) ) {
    140                                         if ( tyDecl->kind == ast::TypeVar::Ftype ) {
     140                                        if ( tyDecl->kind == ast::TypeDecl::Ftype ) {
    141141                                                return new ast::PointerType{ inst };
    142142                                        }
  • src/ResolvExpr/PtrsCastable.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sun May 17 11:48:00 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:36:18 2016
    13 // Update Count     : 8
     12// Last Modified On : Wed Dec 11 21:48:33 2019
     13// Update Count     : 9
    1414//
    1515
     
    176176                        if ( const ast::NamedTypeDecl * named = symtab.lookupType( inst->name ) ) {
    177177                                if ( auto tyDecl = dynamic_cast< const ast::TypeDecl * >( named ) ) {
    178                                         if ( tyDecl->kind == ast::TypeVar::Ftype ) {
     178                                        if ( tyDecl->kind == ast::TypeDecl::Ftype ) {
    179179                                                return -1;
    180180                                        }
    181181                                }
    182182                        } else if ( const ast::EqvClass * eqvClass = env.lookup( inst->name ) ) {
    183                                 if ( eqvClass->data.kind == ast::TypeVar::Ftype ) {
     183                                if ( eqvClass->data.kind == ast::TypeDecl::Ftype ) {
    184184                                        return -1;
    185185                                }
  • src/ResolvExpr/Unify.cc

    r1712f542 r596fc4ad  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 12:27:10 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Sep  4 10:00:00 2019
    13 // Update Count     : 44
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Dec 13 23:43:05 2019
     13// Update Count     : 46
    1414//
    1515
     
    3232#include "Common/PassVisitor.h"     // for PassVisitor
    3333#include "FindOpenVars.h"           // for findOpenVars
    34 #include "Parser/LinkageSpec.h"     // for C
     34#include "SynTree/LinkageSpec.h"    // for C
    3535#include "SynTree/Constant.h"       // for Constant
    3636#include "SynTree/Declaration.h"    // for TypeDecl, TypeDecl::Data, Declarati...
     
    781781                                if ( const ast::EqvClass * clz = tenv.lookup( typeInst->name ) ) {
    782782                                        // expand ttype parameter into its actual type
    783                                         if ( clz->data.kind == ast::TypeVar::Ttype && clz->bound ) {
     783                                        if ( clz->data.kind == ast::TypeDecl::Ttype && clz->bound ) {
    784784                                                return clz->bound;
    785785                                        }
  • src/SymTab/Autogen.h

    r1712f542 r596fc4ad  
    1010// Created On       : Sun May 17 21:53:34 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:50:25 2017
    13 // Update Count     : 15
     12// Last Modified On : Fri Dec 13 16:38:06 2019
     13// Update Count     : 16
    1414//
    1515
     
    3434#include "SynTree/Expression.h"   // for NameExpr, ConstantExpr, UntypedExpr...
    3535#include "SynTree/Type.h"         // for Type, ArrayType, Type::Qualifiers
     36#include "SynTree/Statement.h"    // for CompoundStmt, DeclStmt, ExprStmt
    3637
    3738class CompoundStmt;
  • src/SymTab/Demangle.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Thu Jul 19 12:52:41 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 30 13:46:33 2019
    13 // Update Count     : 3
     12// Last Modified On : Fri Dec 13 14:54:15 2019
     13// Update Count     : 4
    1414//
    1515
     
    366366                                // type variable types
    367367                                for (size_t k = 0; k < TypeDecl::NUMBER_OF_KINDS; ++k) {
    368                                         static const std::string typeVariableNames[] = { "DT", "FT", "TT", };
     368                                        static const std::string typeVariableNames[] = { "DT", "OT", "FT", "TT", };
    369369                                        static_assert(
    370370                                                sizeof(typeVariableNames)/sizeof(typeVariableNames[0]) == TypeDecl::NUMBER_OF_KINDS,
  • src/SymTab/Indexer.cc

    r1712f542 r596fc4ad  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:37:33 2015
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Fri Mar  8 13:55:00 2019
    13 // Update Count     : 21
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Dec 13 23:43:19 2019
     13// Update Count     : 22
    1414//
    1515
     
    3131#include "InitTweak/InitTweak.h"   // for isConstructor, isCopyFunction, isC...
    3232#include "Mangler.h"               // for Mangler
    33 #include "Parser/LinkageSpec.h"    // for isMangled, isOverridable, Spec
    3433#include "ResolvExpr/typeops.h"    // for typesCompatible
     34#include "SynTree/LinkageSpec.h"   // for isMangled, isOverridable, Spec
    3535#include "SynTree/Constant.h"      // for Constant
    3636#include "SynTree/Declaration.h"   // for DeclarationWithType, FunctionDecl
  • src/SymTab/Mangler.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sun May 17 21:40:29 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 30 13:46:10 2019
    13 // Update Count     : 26
     12// Last Modified On : Fri Dec 13 23:43:49 2019
     13// Update Count     : 28
    1414//
    1515#include "Mangler.h"
     
    2626#include "Common/SemanticError.h"        // for SemanticError
    2727#include "Common/utility.h"              // for toString
    28 #include "Parser/LinkageSpec.h"          // for Spec, isOverridable, AutoGen, Int...
    2928#include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment
     29#include "SynTree/LinkageSpec.h"         // for Spec, isOverridable, AutoGen, Int...
    3030#include "SynTree/Declaration.h"         // for TypeDecl, DeclarationWithType
    3131#include "SynTree/Expression.h"          // for TypeExpr, Expression, operator<<
     
    654654                        // aside from the assert false.
    655655                        assertf(false, "Mangler_new should not visit typedecl: %s", toCString(decl));
    656                         assertf( decl->kind < ast::TypeVar::Kind::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->kind );
     656                        assertf( decl->kind < ast::TypeDecl::Kind::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->kind );
    657657                        mangleName << Encoding::typeVariables[ decl->kind ] << ( decl->name.length() ) << decl->name;
    658658                }
     
    674674                                        for ( const ast::TypeDecl * decl : ptype->forall ) {
    675675                                                switch ( decl->kind ) {
    676                                                 case ast::TypeVar::Kind::Dtype:
     676                                                case ast::TypeDecl::Kind::Dtype:
    677677                                                        dcount++;
    678678                                                        break;
    679                                                 case ast::TypeVar::Kind::Ftype:
     679                                                case ast::TypeDecl::Kind::Ftype:
    680680                                                        fcount++;
    681681                                                        break;
    682                                                 case ast::TypeVar::Kind::Ttype:
     682                                                case ast::TypeDecl::Kind::Ttype:
    683683                                                        vcount++;
    684684                                                        break;
  • src/SymTab/ManglerCommon.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sun May 17 21:44:03 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 14 17:06:37 2019
    13 // Update Count     : 26
     12// Last Modified On : Fri Dec 13 14:54:38 2019
     13// Update Count     : 28
    1414//
    1515
     
    104104                        const std::string typeVariables[] = {
    105105                                "BD", // dtype
     106                                "BO", // otype
    106107                                "BF", // ftype
    107108                                "BT", // ttype
  • src/SymTab/Validate.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sun May 17 21:50:04 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 10 22:22:01 2019
    13 // Update Count     : 362
     12// Last Modified On : Fri Dec 13 23:43:34 2019
     13// Update Count     : 363
    1414//
    1515
     
    6969#include "InitTweak/GenInit.h"         // for fixReturnStatements
    7070#include "InitTweak/InitTweak.h"       // for isCtorDtorAssign
    71 #include "Parser/LinkageSpec.h"        // for C
    7271#include "ResolvExpr/typeops.h"        // for typesCompatible
    7372#include "ResolvExpr/Resolver.h"       // for findSingleExpression
    7473#include "ResolvExpr/ResolveTypeof.h"  // for resolveTypeof
    7574#include "SymTab/Autogen.h"            // for SizeType
     75#include "SynTree/LinkageSpec.h"       // for C
    7676#include "SynTree/Attribute.h"         // for noAttributes, Attribute
    7777#include "SynTree/Constant.h"          // for Constant
  • src/SynTree/AggregateDecl.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Sun May 17 23:56:39 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 16:31:55 2019
    13 // Update Count     : 29
     12// Last Modified On : Mon Dec 16 15:07:20 2019
     13// Update Count     : 31
    1414//
    1515
     
    2222#include "Declaration.h"         // for AggregateDecl, TypeDecl, Declaration
    2323#include "Initializer.h"
    24 #include "Parser/LinkageSpec.h"  // for Spec, linkageName, Cforall
     24#include "LinkageSpec.h"         // for Spec, linkageName, Cforall
    2525#include "Type.h"                // for Type, Type::StorageClasses
    2626
     
    5555        os << typeString() << " " << name << ":";
    5656        if ( get_linkage() != LinkageSpec::Cforall ) {
    57                 os << " " << LinkageSpec::linkageName( linkage );
     57                os << " " << LinkageSpec::name( linkage );
    5858        } // if
    5959        os << " with body " << has_body();
  • src/SynTree/Declaration.h

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 16:48:20 2019
    13 // Update Count     : 149
     12// Last Modified On : Fri Dec 13 23:11:22 2019
     13// Update Count     : 157
    1414//
    1515
     
    2424#include "BaseSyntaxNode.h"      // for BaseSyntaxNode
    2525#include "Mutator.h"             // for Mutator
    26 #include "Parser/LinkageSpec.h"  // for Spec, Cforall
     26#include "LinkageSpec.h"         // for Spec, Cforall
    2727#include "SynTree.h"             // for UniqueId
    2828#include "SynTree/Type.h"        // for Type, Type::StorageClasses, Type::Fu...
     
    4343        bool extension = false;
    4444
    45         Declaration( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage );
    46         Declaration( const Declaration &other );
     45        Declaration( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage );
     46        Declaration( const Declaration & other );
    4747        virtual ~Declaration();
    4848
    49         const std::string &get_name() const { return name; }
     49        const std::string & get_name() const { return name; }
    5050        void set_name( std::string newValue ) { name = newValue; }
    5151
     
    5858
    5959        bool get_extension() const { return extension; }
    60         Declaration *set_extension( bool exten ) { extension = exten; return this; }
     60        Declaration * set_extension( bool exten ) { extension = exten; return this; }
    6161
    6262        void fixUniqueId( void );
    63         virtual Declaration *clone() const override = 0;
     63        virtual Declaration * clone() const override = 0;
    6464        virtual void accept( Visitor & v ) override = 0;
    6565        virtual void accept( Visitor & v ) const override = 0;
    66         virtual Declaration *acceptMutator( Mutator &m ) override = 0;
    67         virtual void print( std::ostream &os, Indenter indent = {} ) const override = 0;
    68         virtual void printShort( std::ostream &os, Indenter indent = {} ) const = 0;
     66        virtual Declaration * acceptMutator( Mutator & m ) override = 0;
     67        virtual void print( std::ostream & os, Indenter indent = {} ) const override = 0;
     68        virtual void printShort( std::ostream & os, Indenter indent = {} ) const = 0;
    6969
    7070        UniqueId uniqueId;
     
    8080        int scopeLevel = 0;
    8181
    82         Expression *asmName;
     82        Expression * asmName;
    8383        std::list< Attribute * > attributes;
    8484        bool isDeleted = false;
    8585
    86         DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs );
    87         DeclarationWithType( const DeclarationWithType &other );
     86        DeclarationWithType( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs );
     87        DeclarationWithType( const DeclarationWithType & other );
    8888        virtual ~DeclarationWithType();
    8989
     
    9696        DeclarationWithType * set_scopeLevel( int newValue ) { scopeLevel = newValue; return this; }
    9797
    98         Expression *get_asmName() const { return asmName; }
    99         DeclarationWithType * set_asmName( Expression *newValue ) { asmName = newValue; return this; }
     98        Expression * get_asmName() const { return asmName; }
     99        DeclarationWithType * set_asmName( Expression * newValue ) { asmName = newValue; return this; }
    100100
    101101        std::list< Attribute * >& get_attributes() { return attributes; }
     
    105105        //void set_functionSpecifiers( Type::FuncSpecifiers newValue ) { fs = newValue; }
    106106
    107         virtual DeclarationWithType *clone() const override = 0;
    108         virtual DeclarationWithType *acceptMutator( Mutator &m )  override = 0;
     107        virtual DeclarationWithType * clone() const override = 0;
     108        virtual DeclarationWithType * acceptMutator( Mutator & m )  override = 0;
    109109
    110110        virtual Type * get_type() const = 0;
     
    118118        typedef DeclarationWithType Parent;
    119119  public:
    120         Type *type;
    121         Initializer *init;
    122         Expression *bitfieldWidth;
    123 
    124         ObjectDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init,
     120        Type * type;
     121        Initializer * init;
     122        Expression * bitfieldWidth;
     123
     124        ObjectDecl( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Expression * bitfieldWidth, Type * type, Initializer * init,
    125125                                const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() );
    126         ObjectDecl( const ObjectDecl &other );
     126        ObjectDecl( const ObjectDecl & other );
    127127        virtual ~ObjectDecl();
    128128
    129129        virtual Type * get_type() const override { return type; }
    130         virtual void set_type(Type *newType) override { type = newType; }
    131 
    132         Initializer *get_init() const { return init; }
    133         void set_init( Initializer *newValue ) { init = newValue; }
    134 
    135         Expression *get_bitfieldWidth() const { return bitfieldWidth; }
    136         void set_bitfieldWidth( Expression *newValue ) { bitfieldWidth = newValue; }
     130        virtual void set_type(Type * newType) override { type = newType; }
     131
     132        Initializer * get_init() const { return init; }
     133        void set_init( Initializer * newValue ) { init = newValue; }
     134
     135        Expression * get_bitfieldWidth() const { return bitfieldWidth; }
     136        void set_bitfieldWidth( Expression * newValue ) { bitfieldWidth = newValue; }
    137137
    138138        static ObjectDecl * newObject( const std::string & name, Type * type, Initializer * init );
    139139
    140         virtual ObjectDecl *clone() const override { return new ObjectDecl( *this ); }
    141         virtual void accept( Visitor & v ) override { v.visit( this ); }
    142         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    143         virtual DeclarationWithType *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    144         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    145         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     140        virtual ObjectDecl * clone() const override { return new ObjectDecl( *this ); }
     141        virtual void accept( Visitor & v ) override { v.visit( this ); }
     142        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     143        virtual DeclarationWithType * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     144        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     145        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    146146};
    147147
     
    149149        typedef DeclarationWithType Parent;
    150150  public:
    151         FunctionType *type;
    152         CompoundStmt *statements;
     151        FunctionType * type;
     152        CompoundStmt * statements;
    153153        std::list< Expression * > withExprs;
    154154
    155         FunctionDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements,
     155        FunctionDecl( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType * type, CompoundStmt * statements,
    156156                                  const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() );
    157         FunctionDecl( const FunctionDecl &other );
     157        FunctionDecl( const FunctionDecl & other );
    158158        virtual ~FunctionDecl();
    159159
     
    162162
    163163        FunctionType * get_functionType() const { return type; }
    164         void set_functionType( FunctionType *newValue ) { type = newValue; }
    165         CompoundStmt *get_statements() const { return statements; }
    166         void set_statements( CompoundStmt *newValue ) { statements = newValue; }
     164        void set_functionType( FunctionType * newValue ) { type = newValue; }
     165        CompoundStmt * get_statements() const { return statements; }
     166        void set_statements( CompoundStmt * newValue ) { statements = newValue; }
    167167        bool has_body() const { return NULL != statements; }
    168168
    169169        static FunctionDecl * newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements );
    170170
    171         virtual FunctionDecl *clone() const override { return new FunctionDecl( *this ); }
    172         virtual void accept( Visitor & v ) override { v.visit( this ); }
    173         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    174         virtual DeclarationWithType *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    175         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    176         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     171        virtual FunctionDecl * clone() const override { return new FunctionDecl( *this ); }
     172        virtual void accept( Visitor & v ) override { v.visit( this ); }
     173        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     174        virtual DeclarationWithType * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     175        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     176        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    177177};
    178178
     
    180180        typedef Declaration Parent;
    181181  public:
    182         Type *base;
    183         std::list< TypeDecl* > parameters;
    184         std::list< DeclarationWithType* > assertions;
    185 
    186         NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *type );
    187         NamedTypeDecl( const NamedTypeDecl &other );
     182        Type * base;
     183        std::list< TypeDecl * > parameters;
     184        std::list< DeclarationWithType * > assertions;
     185
     186        NamedTypeDecl( const std::string & name, Type::StorageClasses scs, Type * type );
     187        NamedTypeDecl( const NamedTypeDecl & other );
    188188        virtual ~NamedTypeDecl();
    189189
    190         Type *get_base() const { return base; }
    191         void set_base( Type *newValue ) { base = newValue; }
    192         std::list< TypeDecl* >& get_parameters() { return parameters; }
    193         std::list< DeclarationWithType* >& get_assertions() { return assertions; }
     190        Type * get_base() const { return base; }
     191        void set_base( Type * newValue ) { base = newValue; }
     192        std::list< TypeDecl* > & get_parameters() { return parameters; }
     193        std::list< DeclarationWithType * >& get_assertions() { return assertions; }
    194194
    195195        virtual const char * typeString() const = 0;
    196196
    197         virtual NamedTypeDecl *clone() const override = 0;
    198         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    199         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     197        virtual NamedTypeDecl * clone() const override = 0;
     198        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     199        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    200200};
    201201
     
    203203        typedef NamedTypeDecl Parent;
    204204  public:
    205         enum Kind { Dtype, Ftype, Ttype, NUMBER_OF_KINDS };
    206 
     205        enum Kind { Dtype, Otype, Ftype, Ttype, NUMBER_OF_KINDS };
     206
     207        Kind kind;
     208        bool sized;
    207209        Type * init;
    208         bool sized;
    209210
    210211        /// Data extracted from a type decl
    211212        struct Data {
    212                 TypeDecl::Kind kind;
     213                Kind kind;
    213214                bool isComplete;
    214215
    215                 Data() : kind( (TypeDecl::Kind)-1 ), isComplete( false ) {}
    216                 Data( TypeDecl * typeDecl ) : Data( typeDecl->get_kind(), typeDecl->isComplete() ) {}
     216                Data() : kind( NUMBER_OF_KINDS ), isComplete( false ) {}
     217                Data( const TypeDecl * typeDecl ) : Data( typeDecl->get_kind(), typeDecl->isComplete() ) {}
    217218                Data( Kind kind, bool isComplete ) : kind( kind ), isComplete( isComplete ) {}
    218                 Data( const Data& d1, const Data& d2 )
    219                 : kind( d1.kind ), isComplete ( d1.isComplete || d2.isComplete ) {}
    220 
    221                 bool operator==(const Data & other) const { return kind == other.kind && isComplete == other.isComplete; }
    222                 bool operator!=(const Data & other) const { return !(*this == other);}
     219                Data( const Data & d1, const Data & d2 )
     220                        : kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {}
     221
     222                bool operator==( const Data & other ) const { return kind == other.kind && isComplete == other.isComplete; }
     223                bool operator!=( const Data & other ) const { return !(*this == other);}
    223224        };
    224225
    225         TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, bool sized, Type * init = nullptr );
    226         TypeDecl( const TypeDecl &other );
     226        TypeDecl( const std::string & name, Type::StorageClasses scs, Type * type, Kind kind, bool sized, Type * init = nullptr );
     227        TypeDecl( const TypeDecl & other );
    227228        virtual ~TypeDecl();
    228229
     
    239240        virtual const char * genTypeString() const;
    240241
    241         virtual TypeDecl *clone() const override { return new TypeDecl( *this ); }
    242         virtual void accept( Visitor & v ) override { v.visit( this ); }
    243         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    244         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    245         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    246 
    247         Kind kind;
     242        virtual TypeDecl * clone() const override { return new TypeDecl( *this ); }
     243        virtual void accept( Visitor & v ) override { v.visit( this ); }
     244        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     245        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     246        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
    248247};
    249248
     
    251250        typedef NamedTypeDecl Parent;
    252251  public:
    253         TypedefDecl( const std::string &name, CodeLocation location, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall )
     252        TypedefDecl( const std::string & name, CodeLocation location, Type::StorageClasses scs, Type * type, LinkageSpec::Spec spec = LinkageSpec::Cforall )
    254253                : Parent( name, scs, type ) { set_linkage( spec ); this->location = location; }
    255254
    256         TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    257 
    258         virtual const char * typeString() const override;
    259 
    260         virtual TypedefDecl *clone() const override { return new TypedefDecl( *this ); }
    261         virtual void accept( Visitor & v ) override { v.visit( this ); }
    262         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    263         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     255        TypedefDecl( const TypedefDecl & other ) : Parent( other ) {}
     256
     257        virtual const char * typeString() const override;
     258
     259        virtual TypedefDecl * clone() const override { return new TypedefDecl( *this ); }
     260        virtual void accept( Visitor & v ) override { v.visit( this ); }
     261        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     262        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
    264263  private:
    265264};
     
    277276        AggregateDecl * parent = nullptr;
    278277
    279         AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall );
    280         AggregateDecl( const AggregateDecl &other );
     278        AggregateDecl( const std::string & name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall );
     279        AggregateDecl( const AggregateDecl & other );
    281280        virtual ~AggregateDecl();
    282281
     
    290289        AggregateDecl * set_body( bool body ) { AggregateDecl::body = body; return this; }
    291290
    292         virtual void print( std::ostream &os, Indenter indent = {} ) const override final;
    293         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     291        virtual void print( std::ostream & os, Indenter indent = {} ) const override final;
     292        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    294293  protected:
    295294        virtual const char * typeString() const = 0;
     
    299298        typedef AggregateDecl Parent;
    300299  public:
    301         StructDecl( const std::string &name, Aggregate kind = Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {}
    302         StructDecl( const StructDecl &other ) : Parent( other ), kind( other.kind ) {}
     300        StructDecl( const std::string & name, Aggregate kind = Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {}
     301        StructDecl( const StructDecl & other ) : Parent( other ), kind( other.kind ) {}
    303302
    304303        bool is_coroutine() { return kind == Coroutine; }
     
    306305        bool is_thread() { return kind == Thread; }
    307306
    308         virtual StructDecl *clone() const override { return new StructDecl( *this ); }
    309         virtual void accept( Visitor & v ) override { v.visit( this ); }
    310         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    311         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     307        virtual StructDecl * clone() const override { return new StructDecl( *this ); }
     308        virtual void accept( Visitor & v ) override { v.visit( this ); }
     309        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     310        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
    312311        Aggregate kind;
    313312  private:
     
    318317        typedef AggregateDecl Parent;
    319318  public:
    320         UnionDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
    321         UnionDecl( const UnionDecl &other ) : Parent( other ) {}
    322 
    323         virtual UnionDecl *clone() const override { return new UnionDecl( *this ); }
    324         virtual void accept( Visitor & v ) override { v.visit( this ); }
    325         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    326         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     319        UnionDecl( const std::string & name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
     320        UnionDecl( const UnionDecl & other ) : Parent( other ) {}
     321
     322        virtual UnionDecl * clone() const override { return new UnionDecl( *this ); }
     323        virtual void accept( Visitor & v ) override { v.visit( this ); }
     324        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     325        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
    327326  private:
    328327        virtual const char * typeString() const override;
     
    332331        typedef AggregateDecl Parent;
    333332  public:
    334         EnumDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
    335         EnumDecl( const EnumDecl &other ) : Parent( other ) {}
     333        EnumDecl( const std::string & name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
     334        EnumDecl( const EnumDecl & other ) : Parent( other ) {}
    336335
    337336        bool valueOf( Declaration * enumerator, long long int & value );
    338337
    339         virtual EnumDecl *clone() const override { return new EnumDecl( *this ); }
    340         virtual void accept( Visitor & v ) override { v.visit( this ); }
    341         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    342         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     338        virtual EnumDecl * clone() const override { return new EnumDecl( *this ); }
     339        virtual void accept( Visitor & v ) override { v.visit( this ); }
     340        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     341        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
    343342  private:
    344343        std::unordered_map< std::string, long long int > enumValues;
     
    349348        typedef AggregateDecl Parent;
    350349  public:
    351         TraitDecl( const std::string &name, const std::list< Attribute * > & attributes, LinkageSpec::Spec linkage ) : Parent( name, attributes, linkage ) {
     350        TraitDecl( const std::string & name, const std::list< Attribute * > & attributes, LinkageSpec::Spec linkage ) : Parent( name, attributes, linkage ) {
    352351                assertf( attributes.empty(), "attribute unsupported for traits" );
    353352        }
    354         TraitDecl( const TraitDecl &other ) : Parent( other ) {}
    355 
    356         virtual TraitDecl *clone() const override { return new TraitDecl( *this ); }
    357         virtual void accept( Visitor & v ) override { v.visit( this ); }
    358         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    359         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     353        TraitDecl( const TraitDecl & other ) : Parent( other ) {}
     354
     355        virtual TraitDecl * clone() const override { return new TraitDecl( *this ); }
     356        virtual void accept( Visitor & v ) override { v.visit( this ); }
     357        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     358        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
    360359  private:
    361360        virtual const char * typeString() const override;
     
    381380class AsmDecl : public Declaration {
    382381  public:
    383         AsmStmt *stmt;
    384 
    385         AsmDecl( AsmStmt *stmt );
    386         AsmDecl( const AsmDecl &other );
     382        AsmStmt * stmt;
     383
     384        AsmDecl( AsmStmt * stmt );
     385        AsmDecl( const AsmDecl & other );
    387386        virtual ~AsmDecl();
    388387
    389         AsmStmt *get_stmt() { return stmt; }
    390         void set_stmt( AsmStmt *newValue ) { stmt = newValue; }
    391 
    392         virtual AsmDecl *clone() const override { return new AsmDecl( *this ); }
    393         virtual void accept( Visitor & v ) override { v.visit( this ); }
    394         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    395         virtual AsmDecl *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    396         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    397         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     388        AsmStmt * get_stmt() { return stmt; }
     389        void set_stmt( AsmStmt * newValue ) { stmt = newValue; }
     390
     391        virtual AsmDecl * clone() const override { return new AsmDecl( *this ); }
     392        virtual void accept( Visitor & v ) override { v.visit( this ); }
     393        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     394        virtual AsmDecl * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     395        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     396        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    398397};
    399398
     
    410409        virtual void accept( Visitor & v ) override { v.visit( this ); }
    411410        virtual void accept( Visitor & v ) const override { v.visit( this ); }
    412         virtual StaticAssertDecl * acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    413         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    414         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     411        virtual StaticAssertDecl * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     412        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     413        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    415414};
    416415
  • src/SynTree/DeclarationWithType.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:34:35 2017
    13 // Update Count     : 25
     12// Last Modified On : Fri Dec 13 23:45:16 2019
     13// Update Count     : 26
    1414//
    1515
     
    2020#include "Common/utility.h"      // for cloneAll, deleteAll, maybeClone
    2121#include "Declaration.h"         // for DeclarationWithType, Declaration
    22 #include "Parser/LinkageSpec.h"  // for Spec
    23 #include "SynTree/Expression.h"  // for ConstantExpr
     22#include "LinkageSpec.h"         // for Spec
     23#include "Expression.h"          // for ConstantExpr
    2424#include "Type.h"                // for Type, Type::FuncSpecifiers, Type::St...
    2525
  • src/SynTree/FunctionDecl.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Dec  7 17:40:09 2019
    13 // Update Count     : 75
     12// Last Modified On : Mon Dec 16 15:11:20 2019
     13// Update Count     : 77
    1414//
    1515
     
    2424#include "Declaration.h"         // for FunctionDecl, FunctionDecl::Parent
    2525#include "Expression.h"
    26 #include "Parser/LinkageSpec.h"  // for Spec, linkageName, Cforall
     26#include "LinkageSpec.h"         // for Spec, linkageName, Cforall
    2727#include "Statement.h"           // for CompoundStmt
    2828#include "Type.h"                // for Type, FunctionType, Type::FuncSpecif...
     
    7373        } // if
    7474        if ( linkage != LinkageSpec::Cforall ) {
    75                 os << LinkageSpec::linkageName( linkage ) << " ";
     75                os << LinkageSpec::name( linkage ) << " ";
    7676        } // if
    7777
  • src/SynTree/LinkageSpec.h

    r1712f542 r596fc4ad  
    1010// Created On       : Sat May 16 13:24:28 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul 10 16:02:34 2019
    13 // Update Count     : 18
     12// Last Modified On : Mon Dec 16 15:03:43 2019
     13// Update Count     : 20
    1414//
    1515
     
    2121
    2222namespace LinkageSpec {
    23         // All linkage specs are some combination of these flags:
    24         enum { Mangle = 1 << 0, Generate = 1 << 1, Overrideable = 1 << 2, Builtin = 1 << 3, GccBuiltin = 1 << 4, NoOfSpecs = 1 << 5, };
     23        // Bitflags for linkage specifiers
     24        enum {
     25                Mangle = 1 << 0,
     26                Generate = 1 << 1,
     27                Overrideable = 1 << 2,
     28                Builtin = 1 << 3,
     29                GccBuiltin = 1 << 4,
     30        };
    2531
     32        // Bitflag type for storage classes
    2633        union Spec {
    2734                unsigned int val;
     
    4249
    4350
    44         Spec linkageUpdate( CodeLocation location, Spec old_spec, const std::string * cmd );
    45         /* If cmd = "C" returns a Spec that is old_spec with is_mangled = false
    46          * If cmd = "Cforall" returns old_spec Spec with is_mangled = true
    47          */
     51        Spec update( CodeLocation location, Spec spec, const std::string * cmd );
     52        // If cmd = "C" returns a Spec that is old_spec with is_mangled = false
     53        // If cmd = "Cforall" returns old_spec Spec with is_mangled = true
    4854
    49         std::string linkageName( Spec );
     55        std::string name( Spec );
    5056
    5157        // To Update: LinkageSpec::isXyz( cur_spec ) -> cur_spec.is_xyz
  • src/SynTree/NamedTypeDecl.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 08:26:17 2019
    13 // Update Count     : 15
     12// Last Modified On : Mon Dec 16 15:11:40 2019
     13// Update Count     : 17
    1414//
    1515
     
    2020#include "Common/utility.h"      // for printAll, cloneAll, deleteAll, maybe...
    2121#include "Declaration.h"         // for NamedTypeDecl, DeclarationWithType
    22 #include "Parser/LinkageSpec.h"  // for Spec, Cforall, linkageName
     22#include "LinkageSpec.h"         // for Spec, Cforall, linkageName
    2323#include "Type.h"                // for Type, Type::StorageClasses
    2424
     
    4444
    4545        if ( linkage != LinkageSpec::Cforall ) {
    46                 os << LinkageSpec::linkageName( linkage ) << " ";
     46                os << LinkageSpec::name( linkage ) << " ";
    4747        } // if
    4848        get_storageClasses().print( os );
  • src/SynTree/ObjectDecl.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:34:27 2017
    13 // Update Count     : 59
     12// Last Modified On : Mon Dec 16 15:12:03 2019
     13// Update Count     : 61
    1414//
    1515
     
    2323#include "Expression.h"          // for Expression
    2424#include "Initializer.h"         // for Initializer
    25 #include "Parser/LinkageSpec.h"  // for Spec, linkageName, Cforall
     25#include "LinkageSpec.h"         // for Spec, linkageName, Cforall
    2626#include "Type.h"                // for Type, Type::StorageClasses, Type::Fu...
    2727
     
    4848
    4949        if ( linkage != LinkageSpec::Cforall ) {
    50                 os << LinkageSpec::linkageName( linkage ) << " ";
     50                os << LinkageSpec::name( linkage ) << " ";
    5151        } // if
    5252
  • src/SynTree/TupleType.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb  1 17:10:58 2017
    13 // Update Count     : 3
     12// Last Modified On : Fri Dec 13 23:44:38 2019
     13// Update Count     : 4
    1414//
    1515
     
    2020#include "Declaration.h"         // for Declaration, ObjectDecl
    2121#include "Initializer.h"         // for ListInit
    22 #include "Parser/LinkageSpec.h"  // for Cforall
     22#include "LinkageSpec.h"         // for Cforall
    2323#include "Type.h"                // for TupleType, Type, Type::Qualifiers
    2424
  • src/SynTree/TypeDecl.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 17:56:30 2019
    13 // Update Count     : 10
     12// Last Modified On : Fri Dec 13 15:26:14 2019
     13// Update Count     : 21
    1414//
    1515
     
    1818
    1919#include "Common/utility.h"  // for maybeClone
    20 #include "Parser/ParseNode.h"
    2120#include "Declaration.h"     // for TypeDecl, TypeDecl::Data, TypeDecl::Kind...
    2221#include "Type.h"            // for Type, Type::StorageClasses
    2322
    24 TypeDecl::TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, bool sized, Type * init ) : Parent( name, scs, type ), init( init ), sized( kind == Ttype || sized ), kind( kind ) {
     23TypeDecl::TypeDecl( const std::string & name, Type::StorageClasses scs, Type * type, Kind kind, bool sized, Type * init ) : Parent( name, scs, type ), kind( kind ), sized( kind == Ttype || sized ), init( init ) {
    2524}
    2625
    27 TypeDecl::TypeDecl( const TypeDecl &other ) : Parent( other ), init( maybeClone( other.init ) ), sized( other.sized ), kind( other.kind ) {
     26TypeDecl::TypeDecl( const TypeDecl & other ) : Parent( other ), kind( other.kind ), sized( other.sized ), init( maybeClone( other.init ) ) {
    2827}
    2928
    3029TypeDecl::~TypeDecl() {
    31   delete init;
     30        delete init;
    3231}
    3332
    3433const char * TypeDecl::typeString() const {
    35         static const char * kindNames[] = { "sized object type", "sized function type", "sized tuple type" };
    36         assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "typeString: kindNames is out of sync." );
    37         assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
     34        static const char * kindNames[] = { "sized data type", "sized object type", "sized function type", "sized tuple type" };
     35        static_assert( sizeof(kindNames)/sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "typeString: kindNames is out of sync." );
     36        assertf( kind < TypeDecl::NUMBER_OF_KINDS, "TypeDecl kind is out of bounds." );
    3837        return isComplete() ? kindNames[ kind ] : &kindNames[ kind ][ sizeof("sized") ]; // sizeof includes '\0'
    3938}
    4039
    4140const char * TypeDecl::genTypeString() const {
    42         static const char * kindNames[] = { "dtype", "ftype", "ttype" };
    43         assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "genTypeString: kindNames is out of sync." );
    44         assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
     41        static const char * kindNames[] = { "dtype", "otype", "ftype", "ttype" };
     42        static_assert( sizeof(kindNames)/sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "genTypeString: kindNames is out of sync." );
     43        assertf( kind < TypeDecl::NUMBER_OF_KINDS, "TypeDecl kind is out of bounds." );
    4544        return kindNames[ kind ];
    4645}
    4746
    4847void TypeDecl::print( std::ostream &os, Indenter indent ) const {
    49   NamedTypeDecl::print( os, indent );
    50   if ( init ) {
    51     os << std::endl << indent << "with type initializer: ";
    52     init->print( os, indent + 1 );
    53   }
     48        NamedTypeDecl::print( os, indent );
     49        if ( init ) {
     50                os << std::endl << indent << "with type initializer: ";
     51                init->print( os, indent + 1 );
     52        } // if
    5453}
    5554
    56 
    5755std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data ) {
    58   return os << data.kind << ", " << data.isComplete;
     56        return os << data.kind << ", " << data.isComplete;
    5957}
    6058
  • src/SynTree/module.mk

    r1712f542 r596fc4ad  
    1111## Created On       : Mon Jun  1 17:49:17 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Jun  1 17:54:09 2015
    14 ## Update Count     : 1
     13## Last Modified On : Sat Dec 14 07:26:43 2019
     14## Update Count     : 2
    1515###############################################################################
    1616
    1717SRC_SYNTREE = \
    18       SynTree/Type.cc \
    19       SynTree/VoidType.cc \
     18      SynTree/AddressExpr.cc \
     19      SynTree/AggregateDecl.cc \
     20      SynTree/ApplicationExpr.cc \
     21      SynTree/ArrayType.cc \
     22      SynTree/AttrType.cc \
     23      SynTree/Attribute.cc \
    2024      SynTree/BasicType.cc \
    21       SynTree/PointerType.cc \
    22       SynTree/ArrayType.cc \
    23       SynTree/ReferenceType.cc \
    24       SynTree/FunctionType.cc \
    25       SynTree/ReferenceToType.cc \
    26       SynTree/TupleType.cc \
    27       SynTree/TypeofType.cc \
    28       SynTree/AttrType.cc \
    29       SynTree/VarArgsType.cc \
    30       SynTree/ZeroOneType.cc \
     25      SynTree/CommaExpr.cc \
     26      SynTree/CompoundStmt.cc \
    3127      SynTree/Constant.cc \
    32       SynTree/Expression.cc \
    33       SynTree/TupleExpr.cc \
    34       SynTree/CommaExpr.cc \
    35       SynTree/TypeExpr.cc \
    36       SynTree/ApplicationExpr.cc \
    37       SynTree/AddressExpr.cc \
    38       SynTree/Statement.cc \
    39       SynTree/CompoundStmt.cc \
     28      SynTree/DeclReplacer.cc \
    4029      SynTree/DeclStmt.cc \
    4130      SynTree/Declaration.cc \
    4231      SynTree/DeclarationWithType.cc \
     32      SynTree/Expression.cc \
     33      SynTree/FunctionDecl.cc \
     34      SynTree/FunctionType.cc \
     35      SynTree/Initializer.cc \
     36      SynTree/LinkageSpec.cc \
     37      SynTree/NamedTypeDecl.cc \
    4338      SynTree/ObjectDecl.cc \
    44       SynTree/FunctionDecl.cc \
    45       SynTree/AggregateDecl.cc \
    46       SynTree/NamedTypeDecl.cc \
     39      SynTree/PointerType.cc \
     40      SynTree/ReferenceToType.cc \
     41      SynTree/ReferenceType.cc \
     42      SynTree/Statement.cc \
     43      SynTree/TupleExpr.cc \
     44      SynTree/TupleType.cc \
     45      SynTree/Type.cc \
    4746      SynTree/TypeDecl.cc \
    48       SynTree/Initializer.cc \
     47      SynTree/TypeExpr.cc \
    4948      SynTree/TypeSubstitution.cc \
    50       SynTree/Attribute.cc \
    51       SynTree/DeclReplacer.cc
     49      SynTree/TypeofType.cc \
     50      SynTree/VarArgsType.cc \
     51      SynTree/VoidType.cc \
     52      SynTree/ZeroOneType.cc
    5253
    5354SRC += $(SRC_SYNTREE)
  • src/Tuples/TupleAssignment.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 17 09:43:03 2017
    13 // Update Count     : 8
     12// Last Modified On : Fri Dec 13 23:45:33 2019
     13// Update Count     : 9
    1414//
    1515
     
    3434#include "InitTweak/GenInit.h"             // for genCtorInit
    3535#include "InitTweak/InitTweak.h"           // for getPointerBase, isAssignment
    36 #include "Parser/LinkageSpec.h"            // for Cforall
    3736#include "ResolvExpr/Alternative.h"        // for AltList, Alternative
    3837#include "ResolvExpr/AlternativeFinder.h"  // for AlternativeFinder, simpleC...
     
    4140#include "ResolvExpr/TypeEnvironment.h"    // for TypeEnvironment
    4241#include "ResolvExpr/typeops.h"            // for combos
     42#include "SynTree/LinkageSpec.h"           // for Cforall
    4343#include "SynTree/Declaration.h"           // for ObjectDecl
    4444#include "SynTree/Expression.h"            // for Expression, CastExpr, Name...
  • src/Tuples/TupleExpansion.cc

    r1712f542 r596fc4ad  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 19 14:39:00 2019
    13 // Update Count     : 22
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Dec 13 23:45:51 2019
     13// Update Count     : 24
    1414//
    1515
     
    2727#include "Common/utility.h"       // for CodeLocation
    2828#include "InitTweak/InitTweak.h"  // for getFunction
    29 #include "Parser/LinkageSpec.h"   // for Spec, C, Intrinsic
     29#include "SynTree/LinkageSpec.h"  // for Spec, C, Intrinsic
    3030#include "SynTree/Constant.h"     // for Constant
    3131#include "SynTree/Declaration.h"  // for StructDecl, DeclarationWithType
     
    361361        const ast::TypeInstType * isTtype( const ast::Type * type ) {
    362362                if ( const ast::TypeInstType * inst = dynamic_cast< const ast::TypeInstType * >( type ) ) {
    363                         if ( inst->base && inst->base->kind == ast::TypeVar::Ttype ) {
     363                        if ( inst->base && inst->base->kind == ast::TypeDecl::Ttype ) {
    364364                                return inst;
    365365                        }
  • src/main.cc

    r1712f542 r596fc4ad  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 23 06:50:08 2019
    13 // Update Count     : 607
     12// Last Modified On : Mon Dec 16 17:55:53 2019
     13// Update Count     : 627
    1414//
    1515
     
    2020#include <cstdio>                           // for fopen, FILE, fclose, stdin
    2121#include <cstdlib>                          // for exit, free, abort, EXIT_F...
    22 #include <csignal>                         // for signal, SIGABRT, SIGSEGV
     22#include <csignal>                          // for signal, SIGABRT, SIGSEGV
    2323#include <cstring>                          // for index
    2424#include <fstream>                          // for ofstream
     
    2828#include <list>                             // for list
    2929#include <string>                           // for char_traits, operator<<
     30
     31using namespace std;
     32
    3033
    3134#include "CompilationState.h"
     
    5356#include "InitTweak/GenInit.h"              // for genInit
    5457#include "MakeLibCfa.h"                     // for makeLibCfa
    55 #include "Parser/LinkageSpec.h"             // for Spec, Cforall, Intrinsic
    5658#include "Parser/ParseNode.h"               // for DeclarationNode, buildList
    5759#include "Parser/TypedefTable.h"            // for TypedefTable
     
    5961#include "ResolvExpr/Resolver.h"            // for resolve
    6062#include "SymTab/Validate.h"                // for validate
     63#include "SynTree/LinkageSpec.h"            // for Spec, Cforall, Intrinsic
    6164#include "SynTree/Declaration.h"            // for Declaration
    6265#include "SynTree/Visitor.h"                // for acceptAll
     
    6467#include "Virtual/ExpandCasts.h"            // for expandCasts
    6568
    66 
    67 using namespace std;
    6869
    6970static void NewPass( const char * const name ) {
     
    9798static bool waiting_for_gdb = false;                                    // flag to set cfa-cpp to wait for gdb on start
    9899
    99 static std::string PreludeDirector = "";
     100static string PreludeDirector = "";
    100101
    101102static void parse_cmdline( int argc, char *argv[] );
     
    115116        for ( int i = start; i < size - 2 && messages != nullptr; i += 1 ) {
    116117                char * mangled_name = nullptr, * offset_begin = nullptr, * offset_end = nullptr;
    117                 for ( char *p = messages[i]; *p; ++p ) {        // find parantheses and +offset
     118
     119                for ( char * p = messages[i]; *p; p += 1 ) {    // find parantheses and +offset
    118120                        if ( *p == '(' ) {
    119121                                mangled_name = p;
     
    153155} // backtrace
    154156
    155 static void sigSegvBusHandler( int sig_num ) {
    156         cerr << "*CFA runtime error* program cfa-cpp terminated with "
    157                  <<     (sig_num == SIGSEGV ? "segment fault" : "bus error")
    158                  << "." << endl;
     157#define SIGPARMS int sig __attribute__(( unused )), siginfo_t * sfp __attribute__(( unused )), ucontext_t * cxt __attribute__(( unused ))
     158
     159static void Signal( int sig, void (*handler)(SIGPARMS), int flags ) {
     160        struct sigaction act;
     161
     162        act.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler;
     163        act.sa_flags = flags;
     164
     165        if ( sigaction( sig, &act, nullptr ) == -1 ) {
     166            cerr << "*CFA runtime error* problem installing signal handler, error(" << errno << ") " << strerror( errno ) << endl;
     167            _exit( EXIT_FAILURE );
     168        } // if
     169} // Signal
     170
     171static void sigSegvBusHandler( SIGPARMS ) {
     172        if ( sfp->si_addr == nullptr ) {
     173                cerr << "Null pointer (nullptr) dereference." << endl;
     174        } else {
     175                cerr << (sig == SIGSEGV ? "Segment fault" : "Bus error") << " at memory location " << sfp->si_addr << "." << endl
     176                         << "Possible cause is reading outside the address space or writing to a protected area within the address space with an invalid pointer or subscript." << endl;
     177        } // if
    159178        backtrace( 2 );                                                                         // skip first 2 stack frames
    160         //_exit( EXIT_FAILURE );
    161179        abort();                                                                                        // cause core dump for debugging
    162180} // sigSegvBusHandler
    163181
    164 static void sigAbortHandler( __attribute__((unused)) int sig_num ) {
     182static void sigAbortHandler( SIGPARMS ) {
    165183        backtrace( 6 );                                                                         // skip first 6 stack frames
    166         signal( SIGABRT, SIG_DFL);                                                      // reset default signal handler
     184        Signal( SIGABRT, (void (*)(SIGPARMS))SIG_DFL, SA_SIGINFO );     // reset default signal handler
    167185        raise( SIGABRT );                                                                       // reraise SIGABRT
    168186} // sigAbortHandler
     
    173191        list< Declaration * > translationUnit;
    174192
    175         signal( SIGSEGV, sigSegvBusHandler );
    176         signal( SIGBUS, sigSegvBusHandler );
    177         signal( SIGABRT, sigAbortHandler );
    178 
    179         // std::cout << "main" << std::endl;
     193        Signal( SIGSEGV, sigSegvBusHandler, SA_SIGINFO );
     194        Signal( SIGBUS, sigSegvBusHandler, SA_SIGINFO );
     195        Signal( SIGABRT, sigAbortHandler, SA_SIGINFO );
     196
     197        // cout << "main" << endl;
    180198        // for ( int i = 0; i < argc; i += 1 ) {
    181         //      std::cout << '\t' << argv[i] << std::endl;
     199        //      cout << '\t' << argv[i] << endl;
    182200        // } // for
    183201
     
    186204
    187205        if ( waiting_for_gdb ) {
    188                 std::cerr << "Waiting for gdb" << std::endl;
    189                 std::cerr << "run :" << std::endl;
    190                 std::cerr << "  gdb attach " << getpid() << std::endl;
     206                cerr << "Waiting for gdb" << endl;
     207                cerr << "run :" << endl;
     208                cerr << "  gdb attach " << getpid() << endl;
    191209                raise(SIGSTOP);
    192210        } // if
     
    388406                return EXIT_FAILURE;
    389407        } catch ( ... ) {
    390                 std::exception_ptr eptr = std::current_exception();
     408                exception_ptr eptr = current_exception();
    391409                try {
    392410                        if (eptr) {
    393                                 std::rethrow_exception(eptr);
     411                                rethrow_exception(eptr);
    394412                        } else {
    395                                 std::cerr << "Exception Uncaught and Unknown" << std::endl;
    396                         } // if
    397                 } catch(const std::exception& e) {
    398                         std::cerr << "Uncaught Exception \"" << e.what() << "\"\n";
     413                                cerr << "Exception Uncaught and Unknown" << endl;
     414                        } // if
     415                } catch(const exception& e) {
     416                        cerr << "Uncaught Exception \"" << e.what() << "\"\n";
    399417                } // try
    400418                return EXIT_FAILURE;
  • tests/.expect/completeTypeError.txt

    r1712f542 r596fc4ad  
    1010      Application of
    1111        Variable Expression: *?: forall
    12           DT: object type
     12          DT: data type
    1313          function
    1414        ... with parameters
     
    3333      Application of
    3434        Variable Expression: *?: forall
    35           DT: object type
     35          DT: data type
    3636          function
    3737        ... with parameters
     
    8787Cost ( 0, 1, 0, 0, 1, -5, 0 ): Application of
    8888            Variable Expression: baz: forall
    89               T: sized object type
     89              T: sized data type
    9090              ... with assertions
    9191                ?=?: pointer to function
  • tools/catchsig.c

    r1712f542 r596fc4ad  
    2121        printf("Starting...\n");
    2222        sig(SIGHUP);
    23       sig(SIGINT);
    24       sig(SIGQUIT);
    25       sig(SIGILL);
    26       sig(SIGABRT);
    27       sig(SIGFPE);
    28       sig(SIGSEGV);
    29       sig(SIGPIPE);
    30       sig(SIGALRM);
    31       sig(SIGTERM);
    32       sig(SIGUSR1);
    33       sig(SIGUSR2);
    34       sig(SIGCHLD);
    35       sig(SIGCONT);
    36       sig(SIGTSTP);
    37       sig(SIGTTIN);
    38       sig(SIGTTOU);
     23        sig(SIGINT);
     24        sig(SIGQUIT);
     25        sig(SIGILL);
     26        sig(SIGABRT);
     27        sig(SIGFPE);
     28        sig(SIGSEGV);
     29        sig(SIGPIPE);
     30        sig(SIGALRM);
     31        sig(SIGTERM);
     32        sig(SIGUSR1);
     33        sig(SIGUSR2);
     34        sig(SIGCHLD);
     35        sig(SIGCONT);
     36        sig(SIGTSTP);
     37        sig(SIGTTIN);
     38        sig(SIGTTOU);
    3939        while(1);
    4040        return 0;
Note: See TracChangeset for help on using the changeset viewer.