Changeset f855545
- Timestamp:
- Nov 2, 2018, 7:46:19 AM (5 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- c45b304
- Parents:
- 30ee9ef
- Location:
- src/Parser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r30ee9ef rf855545 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 20 14:56:54201813 // Update Count : 110 712 // Last Modified On : Thu Nov 1 20:54:26 2018 13 // Update Count : 1108 14 14 // 15 15 … … 402 402 } 403 403 404 DeclarationNode * DeclarationNode::newTypeof( ExpressionNode * expr ) {405 DeclarationNode * newnode = new DeclarationNode; 406 newnode->type = new TypeData( TypeData::Typeof );404 DeclarationNode * DeclarationNode::newTypeof( ExpressionNode * expr, bool basetypeof ) { 405 DeclarationNode * newnode = new DeclarationNode; 406 newnode->type = new TypeData( basetypeof ? TypeData::Basetypeof : TypeData::Typeof ); 407 407 newnode->type->typeexpr = expr; 408 408 return newnode; -
src/Parser/ParseNode.h
r30ee9ef rf855545 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Aug 4 09:39:40201813 // Update Count : 85 312 // Last Modified On : Thu Nov 1 20:54:53 2018 13 // Update Count : 854 14 14 // 15 15 … … 249 249 static DeclarationNode * newBitfield( ExpressionNode * size ); 250 250 static DeclarationNode * newTuple( DeclarationNode * members ); 251 static DeclarationNode * newTypeof( ExpressionNode * expr );251 static DeclarationNode * newTypeof( ExpressionNode * expr, bool basetypeof = false ); 252 252 static DeclarationNode * newAttr( const std::string *, ExpressionNode * expr ); // @ attributes 253 253 static DeclarationNode * newAttr( const std::string *, DeclarationNode * type ); // @ attributes -
src/Parser/TypeData.cc
r30ee9ef rf855545 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 20 14:39:31201813 // Update Count : 62 212 // Last Modified On : Thu Nov 1 20:56:14 2018 13 // Update Count : 623 14 14 // 15 15 … … 96 96 break; 97 97 case Typeof: 98 case Basetypeof: 98 99 // typeexpr = new Typeof_t; 99 100 typeexpr = nullptr; … … 166 167 break; 167 168 case Typeof: 169 case Basetypeof: 168 170 // delete typeexpr->expr; 169 171 delete typeexpr; … … 245 247 break; 246 248 case Typeof: 249 case Basetypeof: 247 250 newtype->typeexpr = maybeClone( typeexpr ); 248 251 break; … … 419 422 } // if 420 423 break; 424 case Basetypeof: 425 os << "base-"; 426 __attribute__((fallthrough)); 421 427 case Typeof: 422 428 os << "type-of expression "; … … 457 463 case Tuple: 458 464 case Typeof: 465 case Basetypeof: 459 466 case Builtin: 460 467 assertf(false, "Tried to get leaf name from kind without a name: %d", kind); … … 535 542 return buildTuple( td ); 536 543 case TypeData::Typeof: 544 case TypeData::Basetypeof: 537 545 return buildTypeof( td ); 538 546 case TypeData::Builtin: … … 929 937 930 938 TypeofType * buildTypeof( const TypeData * td ) { 931 assert( td->kind == TypeData::Typeof );939 assert( td->kind == TypeData::Typeof || td->kind == TypeData::Basetypeof ); 932 940 assert( td->typeexpr ); 933 941 // assert( td->typeexpr->expr ); 934 return new TypeofType( buildQualifiers( td ), td->typeexpr->build() );942 return new TypeofType( td->kind == TypeData::Basetypeof ? Type::Qualifiers{} : buildQualifiers( td ), td->typeexpr->build() ); 935 943 } // buildTypeof 936 944 -
src/Parser/TypeData.h
r30ee9ef rf855545 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 20 13:56:40201813 // Update Count : 19 512 // Last Modified On : Thu Nov 1 20:56:46 2018 13 // Update Count : 196 14 14 // 15 15 … … 27 27 struct TypeData { 28 28 enum Kind { Basic, Pointer, Reference, Array, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic, 29 SymbolicInst, Tuple, Typeof, B uiltin, GlobalScope, Qualified, Unknown };29 SymbolicInst, Tuple, Typeof, Basetypeof, Builtin, GlobalScope, Qualified, Unknown }; 30 30 31 31 struct Aggregate_t {
Note: See TracChangeset
for help on using the changeset viewer.