Changeset 8b7ee09 for src/Parser
- Timestamp:
- Aug 19, 2016, 8:57:22 AM (8 years ago)
- 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
- Location:
- src/Parser
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rf487962 r8b7ee09 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 23:14:51201613 // Update Count : 18 112 // Last Modified On : Thu Aug 18 23:48:23 2016 13 // Update Count : 182 14 14 // 15 15 … … 41 41 UniqueName DeclarationNode::anonymous( "__anonymous" ); 42 42 43 extern LinkageSpec:: Typelinkage; // defined in parser.yy43 extern LinkageSpec::Spec linkage; // defined in parser.yy 44 44 45 45 DeclarationNode *DeclarationNode::clone() const { -
src/Parser/LinkageSpec.cc
rf487962 r8b7ee09 10 10 // Created On : Sat May 16 13:22:09 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 23:02:37201613 // Update Count : 1 112 // Last Modified On : Thu Aug 18 23:47:14 2016 13 // Update Count : 12 14 14 // 15 15 … … 20 20 #include "Common/SemanticError.h" 21 21 22 LinkageSpec:: TypeLinkageSpec::fromString( const std::string &stringSpec ) {22 LinkageSpec::Spec LinkageSpec::fromString( const std::string &stringSpec ) { 23 23 if ( stringSpec == "\"Cforall\"" ) { 24 24 return Cforall; … … 30 30 } 31 31 32 std::string LinkageSpec::toString( LinkageSpec:: Typelinkage ) {33 static const char *linkageKinds[LinkageSpec::NoOf Types] = {32 std::string LinkageSpec::toString( LinkageSpec::Spec linkage ) { 33 static const char *linkageKinds[LinkageSpec::NoOfSpecs] = { 34 34 "intrinsic", "Cforall", "C", "automatically generated", "compiler built-in", 35 35 }; … … 37 37 } 38 38 39 bool LinkageSpec::isDecoratable( Typet ) {40 static bool decoratable[LinkageSpec::NoOf Types] = {39 bool LinkageSpec::isDecoratable( Spec t ) { 40 static bool decoratable[LinkageSpec::NoOfSpecs] = { 41 41 // Intrinsic, Cforall, C, AutoGen, Compiler 42 42 true, true, false, true, false, 43 43 }; 44 return decoratable[ t];44 return decoratable[t]; 45 45 } 46 46 47 bool LinkageSpec::isGeneratable( Typet ) {48 static bool generatable[LinkageSpec::NoOf Types] = {47 bool LinkageSpec::isGeneratable( Spec t ) { 48 static bool generatable[LinkageSpec::NoOfSpecs] = { 49 49 // Intrinsic, Cforall, C, AutoGen, Compiler 50 50 true, true, true, true, false, 51 51 }; 52 return generatable[ t];52 return generatable[t]; 53 53 } 54 54 55 bool LinkageSpec::isOverloadable( Typet ) {55 bool LinkageSpec::isOverloadable( Spec t ) { 56 56 return isDecoratable( t ); 57 57 } 58 58 59 59 60 bool LinkageSpec::isOverridable( Typet ) {61 static bool overridable[LinkageSpec::NoOf Types] = {60 bool LinkageSpec::isOverridable( Spec t ) { 61 static bool overridable[LinkageSpec::NoOfSpecs] = { 62 62 // Intrinsic, Cforall, C, AutoGen, Compiler 63 63 true, false, false, true, false, 64 64 }; 65 return overridable[ t];65 return overridable[t]; 66 66 } 67 67 68 bool LinkageSpec::isBuiltin( Typet ) {69 static bool builtin[LinkageSpec::NoOf Types] = {68 bool LinkageSpec::isBuiltin( Spec t ) { 69 static bool builtin[LinkageSpec::NoOfSpecs] = { 70 70 // Intrinsic, Cforall, C, AutoGen, Compiler 71 71 true, false, false, false, true, 72 72 }; 73 return builtin[ t];73 return builtin[t]; 74 74 } 75 75 -
src/Parser/LinkageSpec.h
rf487962 r8b7ee09 10 10 // Created On : Sat May 16 13:24:28 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 22:19:48201613 // Update Count : 612 // Last Modified On : Thu Aug 18 23:47:16 2016 13 // Update Count : 7 14 14 // 15 15 … … 20 20 21 21 struct LinkageSpec { 22 enum Type{22 enum Spec { 23 23 Intrinsic, // C built-in defined in prelude 24 24 Cforall, // ordinary … … 26 26 AutoGen, // built by translator (struct assignment) 27 27 Compiler, // gcc internal 28 NoOf Types28 NoOfSpecs 29 29 }; 30 30 31 static TypefromString( const std::string & );32 static std::string toString( Type);31 static Spec fromString( const std::string & ); 32 static std::string toString( Spec ); 33 33 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 ); 39 39 }; 40 40 -
src/Parser/ParseNode.h
rf487962 r8b7ee09 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 23:15:59201613 // Update Count : 54 112 // Last Modified On : Thu Aug 18 23:48:37 2016 13 // Update Count : 542 14 14 // 15 15 … … 273 273 bool get_hasEllipsis() const; 274 274 const std::string &get_name() const { return name; } 275 LinkageSpec:: Typeget_linkage() const { return linkage; }275 LinkageSpec::Spec get_linkage() const { return linkage; } 276 276 DeclarationNode *extractAggregate() const; 277 277 ExpressionNode *get_enumeratorValue() const { return enumeratorValue; } … … 293 293 InitializerNode *initializer; 294 294 bool hasEllipsis; 295 LinkageSpec:: Typelinkage;295 LinkageSpec::Spec linkage; 296 296 bool extension = false; 297 297 std::string error; -
src/Parser/TypeData.cc
rf487962 r8b7ee09 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 08:47:48201613 // Update Count : 6 312 // Last Modified On : Thu Aug 18 23:48:44 2016 13 // Update Count : 64 14 14 // 15 15 … … 478 478 } 479 479 480 Declaration *TypeData::buildDecl( std::string name, DeclarationNode::StorageClass sc, Expression *bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec:: Typelinkage, Initializer *init ) const {480 Declaration *TypeData::buildDecl( std::string name, DeclarationNode::StorageClass sc, Expression *bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer *init ) const { 481 481 if ( kind == TypeData::Function ) { 482 482 FunctionDecl *decl; -
src/Parser/TypeData.h
rf487962 r8b7ee09 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 15 14:28:32 201613 // Update Count : 2 112 // Last Modified On : Thu Aug 18 23:48:52 2016 13 // Update Count : 22 14 14 // 15 15 … … 126 126 TypeData * extractAggregate( bool toplevel = true ) const; 127 127 // helper function for DeclNodeImpl::build 128 Declaration * buildDecl( std::string name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec:: Typelinkage, 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; 129 129 // helper functions for build() 130 130 Type::Qualifiers buildQualifiers() const; -
src/Parser/parser.cc
rf487962 r8b7ee09 84 84 85 85 extern DeclarationNode * parseTree; 86 extern LinkageSpec:: Typelinkage;86 extern LinkageSpec::Spec linkage; 87 87 extern TypedefTable typedefTable; 88 88 89 std::stack< LinkageSpec:: Type> linkageStack;89 std::stack< LinkageSpec::Spec > linkageStack; 90 90 91 91 void appendStr( std::string &to, std::string *from ) { -
src/Parser/parser.yy
rf487962 r8b7ee09 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 11:18:40 201613 // Update Count : 190 812 // Last Modified On : Thu Aug 18 23:49:10 2016 13 // Update Count : 1909 14 14 // 15 15 … … 56 56 57 57 extern DeclarationNode * parseTree; 58 extern LinkageSpec:: Typelinkage;58 extern LinkageSpec::Spec linkage; 59 59 extern TypedefTable typedefTable; 60 60 61 std::stack< LinkageSpec:: Type> linkageStack;61 std::stack< LinkageSpec::Spec > linkageStack; 62 62 63 63 void appendStr( std::string &to, std::string *from ) {
Note: See TracChangeset
for help on using the changeset viewer.