Changes in src/Parser/DeclarationNode.cc [68f9c43:f14d956]
- File:
-
- 1 edited
-
src/Parser/DeclarationNode.cc (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r68f9c43 rf14d956 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 22 15:37:17201813 // Update Count : 10 3312 // Last Modified On : Fri Apr 20 22:37:20 2018 13 // Update Count : 1063 14 14 // 15 15 … … 47 47 const char * DeclarationNode::aggregateNames[] = { "struct", "union", "trait", "coroutine", "monitor", "thread", "NoAggregateNames" }; 48 48 const char * DeclarationNode::typeClassNames[] = { "otype", "dtype", "ftype", "NoTypeClassNames" }; 49 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", " NoBuiltinTypeNames" };49 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", "zero_t", "one_t", "NoBuiltinTypeNames" }; 50 50 51 51 UniqueName DeclarationNode::anonymous( "__anonymous" ); … … 71 71 attr.expr = nullptr; 72 72 attr.type = nullptr; 73 74 assert.condition = nullptr; 75 assert.message = nullptr; 73 76 } 74 77 … … 88 91 // asmName, no delete, passed to next stage 89 92 delete initializer; 93 94 delete assert.condition; 95 delete assert.message; 90 96 } 91 97 … … 117 123 newnode->attr.expr = maybeClone( attr.expr ); 118 124 newnode->attr.type = maybeClone( attr.type ); 125 126 newnode->assert.condition = maybeClone( assert.condition ); 127 newnode->assert.message = maybeClone( assert.message ); 119 128 return newnode; 120 129 } // DeclarationNode::clone … … 434 443 return newnode; 435 444 } 445 446 DeclarationNode * DeclarationNode::newStaticAssert( ExpressionNode * condition, Expression * message ) { 447 DeclarationNode * newnode = new DeclarationNode; 448 newnode->assert.condition = condition; 449 newnode->assert.message = message; 450 return newnode; 451 } 452 436 453 437 454 void appendError( string & dst, const string & src ) { … … 544 561 545 562 checkQualifiers( type, q->type ); 563 if ( (builtin == Zero || builtin == One) && error.length() == 0 ) { 564 SemanticWarning( yylloc, Warning::BadQualifiersZeroOne, Type::QualifiersNames[ilog2( q->type->qualifiers.val )], builtinTypeNames[builtin] ); 565 // appendError( error, string( "questionable qualifiers" ) ); 566 } // if 546 567 addQualifiersToType( q->type, type ); 547 568 … … 907 928 delete newType->aggInst.aggregate->enumeration.constants; 908 929 newType->aggInst.aggregate->enumeration.constants = nullptr; 930 newType->aggInst.aggregate->enumeration.body = false; 909 931 } else { 910 932 assert( newType->aggInst.aggregate->kind == TypeData::Aggregate ); 911 933 delete newType->aggInst.aggregate->aggregate.fields; 912 934 newType->aggInst.aggregate->aggregate.fields = nullptr; 935 newType->aggInst.aggregate->aggregate.body = false; 913 936 } // if 914 937 // don't hoist twice … … 986 1009 obj->location = cur->location; 987 1010 * out++ = obj; 1011 delete agg; 988 1012 } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) { 989 1013 UnionInstType * inst = new UnionInstType( Type::Qualifiers(), agg->get_name() ); … … 1050 1074 return buildDecl( type, name ? *name : string( "" ), storageClasses, maybeBuild< Expression >( bitfieldWidth ), funcSpecs, linkage, asmName, maybeBuild< Initializer >(initializer), attributes )->set_extension( extension ); 1051 1075 } // if 1076 1077 if ( assert.condition ) { 1078 return new StaticAssertDecl( maybeBuild< Expression >( assert.condition ), strict_dynamic_cast< ConstantExpr * >( maybeClone( assert.message ) ) ); 1079 } 1052 1080 1053 1081 // SUE's cannot have function specifiers, either
Note:
See TracChangeset
for help on using the changeset viewer.