Changeset 8b7ee09


Ignore:
Timestamp:
Aug 19, 2016, 8:57:22 AM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
ac71a86, e6955b1
Parents:
f487962
Message:

rename type LinkageSpec::Type to LinkageSpec::Spec, which affects many files

Location:
src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • src/Common/Assert.cc

    rf487962 r8b7ee09  
    1010// Created On       : Thu Aug 18 13:26:59 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 18 16:32:47 2016
    13 // Update Count     : 7
     12// Last Modified On : Thu Aug 18 23:40:29 2016
     13// Update Count     : 8
    1414//
    15 
    1615
    1716#include <assert.h>
  • src/Common/CompilerError.h

    rf487962 r8b7ee09  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 07:20:37 2015
    13 // Update Count     : 2
     12// Last Modified On : Thu Aug 18 23:41:30 2016
     13// Update Count     : 3
    1414//
    1515
     
    1818
    1919#include <string>
    20 //#include "../config.h"
    2120
    2221class CompilerError : public std::exception {
  • src/Parser/DeclarationNode.cc

    rf487962 r8b7ee09  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 23:14:51 2016
    13 // Update Count     : 181
     12// Last Modified On : Thu Aug 18 23:48:23 2016
     13// Update Count     : 182
    1414//
    1515
     
    4141UniqueName DeclarationNode::anonymous( "__anonymous" );
    4242
    43 extern LinkageSpec::Type linkage;                                               // defined in parser.yy
     43extern LinkageSpec::Spec linkage;                                               // defined in parser.yy
    4444
    4545DeclarationNode *DeclarationNode::clone() const {
  • src/Parser/LinkageSpec.cc

    rf487962 r8b7ee09  
    1010// Created On       : Sat May 16 13:22:09 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 23:02:37 2016
    13 // Update Count     : 11
     12// Last Modified On : Thu Aug 18 23:47:14 2016
     13// Update Count     : 12
    1414//
    1515
     
    2020#include "Common/SemanticError.h"
    2121
    22 LinkageSpec::Type LinkageSpec::fromString( const std::string &stringSpec ) {
     22LinkageSpec::Spec LinkageSpec::fromString( const std::string &stringSpec ) {
    2323        if ( stringSpec == "\"Cforall\"" ) {
    2424                return Cforall;
     
    3030}
    3131
    32 std::string LinkageSpec::toString( LinkageSpec::Type linkage ) {
    33         static const char *linkageKinds[LinkageSpec::NoOfTypes] = {
     32std::string LinkageSpec::toString( LinkageSpec::Spec linkage ) {
     33        static const char *linkageKinds[LinkageSpec::NoOfSpecs] = {
    3434                "intrinsic", "Cforall", "C", "automatically generated", "compiler built-in",
    3535        };
     
    3737}
    3838
    39 bool LinkageSpec::isDecoratable( Type t ) {
    40         static bool decoratable[LinkageSpec::NoOfTypes] = {
     39bool LinkageSpec::isDecoratable( Spec t ) {
     40        static bool decoratable[LinkageSpec::NoOfSpecs] = {
    4141                //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler
    4242                        true,           true,           false,  true,           false,
    4343        };
    44         return decoratable[ t ];
     44        return decoratable[t];
    4545}
    4646
    47 bool LinkageSpec::isGeneratable( Type t ) {
    48         static bool generatable[LinkageSpec::NoOfTypes] = {
     47bool LinkageSpec::isGeneratable( Spec t ) {
     48        static bool generatable[LinkageSpec::NoOfSpecs] = {
    4949                //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler
    5050                        true,           true,           true,   true,           false,
    5151        };
    52         return generatable[ t ];
     52        return generatable[t];
    5353}
    5454
    55 bool LinkageSpec::isOverloadable( Type t ) {
     55bool LinkageSpec::isOverloadable( Spec t ) {
    5656        return isDecoratable( t );
    5757}
    5858
    5959
    60 bool LinkageSpec::isOverridable( Type t ) {
    61         static bool overridable[LinkageSpec::NoOfTypes] = {
     60bool LinkageSpec::isOverridable( Spec t ) {
     61        static bool overridable[LinkageSpec::NoOfSpecs] = {
    6262                //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler
    6363                        true,           false,          false,  true,           false,
    6464        };
    65         return overridable[ t ];
     65        return overridable[t];
    6666}
    6767
    68 bool LinkageSpec::isBuiltin( Type t ) {
    69         static bool builtin[LinkageSpec::NoOfTypes] = {
     68bool LinkageSpec::isBuiltin( Spec t ) {
     69        static bool builtin[LinkageSpec::NoOfSpecs] = {
    7070                //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler
    7171                        true,           false,          false,  false,          true,
    7272        };
    73         return builtin[ t ];
     73        return builtin[t];
    7474}
    7575
  • src/Parser/LinkageSpec.h

    rf487962 r8b7ee09  
    1010// Created On       : Sat May 16 13:24:28 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 22:19:48 2016
    13 // Update Count     : 6
     12// Last Modified On : Thu Aug 18 23:47:16 2016
     13// Update Count     : 7
    1414//
    1515
     
    2020
    2121struct LinkageSpec {
    22         enum Type {
     22        enum Spec {
    2323                Intrinsic,                                                                              // C built-in defined in prelude
    2424                Cforall,                                                                                // ordinary
     
    2626                AutoGen,                                                                                // built by translator (struct assignment)
    2727                Compiler,                                                                               // gcc internal
    28                 NoOfTypes
     28                NoOfSpecs
    2929        };
    3030 
    31         static Type fromString( const std::string & );
    32         static std::string toString( Type );
     31        static Spec fromString( const std::string & );
     32        static std::string toString( Spec );
    3333 
    34         static bool isDecoratable( Type );
    35         static bool isGeneratable( Type );
    36         static bool isOverloadable( Type );
    37         static bool isOverridable( Type );
    38         static bool isBuiltin( Type );
     34        static bool isDecoratable( Spec );
     35        static bool isGeneratable( Spec );
     36        static bool isOverloadable( Spec );
     37        static bool isOverridable( Spec );
     38        static bool isBuiltin( Spec );
    3939};
    4040
  • src/Parser/ParseNode.h

    rf487962 r8b7ee09  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 23:15:59 2016
    13 // Update Count     : 541
     12// Last Modified On : Thu Aug 18 23:48:37 2016
     13// Update Count     : 542
    1414//
    1515
     
    273273        bool get_hasEllipsis() const;
    274274        const std::string &get_name() const { return name; }
    275         LinkageSpec::Type get_linkage() const { return linkage; }
     275        LinkageSpec::Spec get_linkage() const { return linkage; }
    276276        DeclarationNode *extractAggregate() const;
    277277        ExpressionNode *get_enumeratorValue() const { return enumeratorValue; }
     
    293293        InitializerNode *initializer;
    294294        bool hasEllipsis;
    295         LinkageSpec::Type linkage;
     295        LinkageSpec::Spec linkage;
    296296        bool extension = false;
    297297        std::string error;
  • src/Parser/TypeData.cc

    rf487962 r8b7ee09  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 08:47:48 2016
    13 // Update Count     : 63
     12// Last Modified On : Thu Aug 18 23:48:44 2016
     13// Update Count     : 64
    1414//
    1515
     
    478478}
    479479
    480 Declaration *TypeData::buildDecl( std::string name, DeclarationNode::StorageClass sc, Expression *bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Type linkage, Initializer *init ) const {
     480Declaration *TypeData::buildDecl( std::string name, DeclarationNode::StorageClass sc, Expression *bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer *init ) const {
    481481        if ( kind == TypeData::Function ) {
    482482                FunctionDecl *decl;
  • src/Parser/TypeData.h

    rf487962 r8b7ee09  
    1010// Created On       : Sat May 16 15:18:36 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Aug 15 14:28:32 2016
    13 // Update Count     : 21
     12// Last Modified On : Thu Aug 18 23:48:52 2016
     13// Update Count     : 22
    1414//
    1515
     
    126126        TypeData * extractAggregate( bool toplevel = true ) const;
    127127        // helper function for DeclNodeImpl::build
    128         Declaration * buildDecl( std::string name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Type linkage, Initializer * init = 0 ) const;
     128        Declaration * buildDecl( std::string name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer * init = 0 ) const;
    129129        // helper functions for build()
    130130        Type::Qualifiers buildQualifiers() const;
  • src/Parser/parser.cc

    rf487962 r8b7ee09  
    8484
    8585extern DeclarationNode * parseTree;
    86 extern LinkageSpec::Type linkage;
     86extern LinkageSpec::Spec linkage;
    8787extern TypedefTable typedefTable;
    8888
    89 std::stack< LinkageSpec::Type > linkageStack;
     89std::stack< LinkageSpec::Spec > linkageStack;
    9090
    9191void appendStr( std::string &to, std::string *from ) {
  • src/Parser/parser.yy

    rf487962 r8b7ee09  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 11:18:40 2016
    13 // Update Count     : 1908
     12// Last Modified On : Thu Aug 18 23:49:10 2016
     13// Update Count     : 1909
    1414//
    1515
     
    5656
    5757extern DeclarationNode * parseTree;
    58 extern LinkageSpec::Type linkage;
     58extern LinkageSpec::Spec linkage;
    5959extern TypedefTable typedefTable;
    6060
    61 std::stack< LinkageSpec::Type > linkageStack;
     61std::stack< LinkageSpec::Spec > linkageStack;
    6262
    6363void appendStr( std::string &to, std::string *from ) {
  • src/SynTree/Declaration.cc

    rf487962 r8b7ee09  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Dec 09 14:08:29 2015
    13 // Update Count     : 12
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 18 23:49:57 2016
     13// Update Count     : 13
    1414//
    1515
     
    2727static IdMapType idMap;
    2828
    29 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage )
     29Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage )
    3030                : name( name ), storageClass( sc ), linkage( linkage ), isInline( false ), isNoreturn( false ), uniqueId( 0 ) {
    3131}
  • src/SynTree/Declaration.h

    rf487962 r8b7ee09  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 12 21:03:17 2016
    13 // Update Count     : 39
     12// Last Modified On : Thu Aug 18 23:50:24 2016
     13// Update Count     : 40
    1414//
    1515
     
    2626class Declaration {
    2727  public:
    28         Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
     28        Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage );
    2929        Declaration( const Declaration &other );
    3030        virtual ~Declaration();
     
    3434        DeclarationNode::StorageClass get_storageClass() const { return storageClass; }
    3535        void set_storageClass( DeclarationNode::StorageClass newValue ) { storageClass = newValue; }
    36         LinkageSpec::Type get_linkage() const { return linkage; }
    37         void set_linkage( LinkageSpec::Type newValue ) { linkage = newValue; }
     36        LinkageSpec::Spec get_linkage() const { return linkage; }
     37        void set_linkage( LinkageSpec::Spec newValue ) { linkage = newValue; }
    3838        bool get_isInline() const { return isInline; }
    3939        void set_isInline( bool newValue ) { isInline = newValue; }
     
    5656        std::string name;
    5757        DeclarationNode::StorageClass storageClass;
    58         LinkageSpec::Type linkage;
     58        LinkageSpec::Spec linkage;
    5959        bool isInline, isNoreturn;
    6060        UniqueId uniqueId;
     
    6464class DeclarationWithType : public Declaration {
    6565  public:
    66         DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, const std::list< Attribute * > & attributes );
     66        DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes );
    6767        DeclarationWithType( const DeclarationWithType &other );
    6868        virtual ~DeclarationWithType();
     
    9797        typedef DeclarationWithType Parent;
    9898  public:
    99         ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false );
     99        ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false );
    100100        ObjectDecl( const ObjectDecl &other );
    101101        virtual ~ObjectDecl();
     
    123123        typedef DeclarationWithType Parent;
    124124  public:
    125         FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, const std::list< Attribute * > attributes = std::list< Attribute * >() );
     125        FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, const std::list< Attribute * > attributes = std::list< Attribute * >() );
    126126        FunctionDecl( const FunctionDecl &other );
    127127        virtual ~FunctionDecl();
  • src/SynTree/DeclarationWithType.cc

    rf487962 r8b7ee09  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Mon Apr 11 15:35:27 2016
    13 // Update Count     : 3
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 18 23:50:41 2016
     13// Update Count     : 4
    1414//
    1515
     
    1919#include "Common/utility.h"
    2020
    21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, const std::list< Attribute * > & attributes )
     21DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes )
    2222                : Declaration( name, sc, linkage ), attributes( attributes ) {
    2323}
  • src/SynTree/FunctionDecl.cc

    rf487962 r8b7ee09  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 06 15:59:48 2016
    13 // Update Count     : 19
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 18 23:50:14 2016
     13// Update Count     : 20
    1414//
    1515
     
    2222#include "Common/utility.h"
    2323
    24 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes )
     24FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes )
    2525                : Parent( name, sc, linkage, attributes ), type( type ), statements( statements ) {
    2626        set_isInline( isInline );
  • src/SynTree/ObjectDecl.cc

    rf487962 r8b7ee09  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 13 13:23:32 2016
    13 // Update Count     : 30
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 18 23:50:33 2016
     13// Update Count     : 31
    1414//
    1515
     
    2222#include "Statement.h"
    2323
    24 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, bool isInline, bool isNoreturn )
     24ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, bool isInline, bool isNoreturn )
    2525        : Parent( name, sc, linkage, attributes ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
    2626        set_isInline( isInline );
  • src/main.cc

    rf487962 r8b7ee09  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 18 16:33:49 2016
    13 // Update Count     : 347
     12// Last Modified On : Fri Aug 19 08:31:22 2016
     13// Update Count     : 350
    1414//
    1515
     
    4343
    4444
    45 LinkageSpec::Type linkage = LinkageSpec::Cforall;
     45LinkageSpec::Spec linkage = LinkageSpec::Cforall;
    4646TypedefTable typedefTable;
    4747DeclarationNode * parseTree = nullptr;                                  // program parse tree
     
    6767
    6868static void parse_cmdline( int argc, char *argv[], const char *& filename );
    69 static void parse( FILE * input, LinkageSpec::Type t, bool shouldExit = false );
     69static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false );
    7070static void dump( std::list< Declaration * > & translationUnit, std::ostream & out = std::cout );
    7171
     
    348348} // parse_cmdline
    349349
    350 static void parse( FILE * input, LinkageSpec::Type link, bool shouldExit ) {
     350static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit ) {
    351351        extern int yyparse( void );
    352352        extern FILE * yyin;
    353353        extern int yylineno;
    354354
    355         linkage = link;                                                                         // set globals
     355        ::linkage = linkage;                                                            // set globals
    356356        yyin = input;
    357357        yylineno = 1;
Note: See TracChangeset for help on using the changeset viewer.