Changes in src/Parser/DeclarationNode.cc [e496303:08d5507b]
- File:
-
- 1 edited
-
src/Parser/DeclarationNode.cc (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
re496303 r08d5507b 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 14 1 4:45:52201713 // Update Count : 9 7312 // Last Modified On : Tue Mar 14 10:19:38 2017 13 // Update Count : 964 14 14 // 15 15 … … 202 202 203 203 204 DeclarationNode * DeclarationNode::newStorageClass( StorageClasses sc ) {204 DeclarationNode * DeclarationNode::newStorageClass( DeclarationNode::StorageClasses sc ) { 205 205 DeclarationNode * newnode = new DeclarationNode; 206 206 newnode->storageClasses = sc; … … 208 208 } // DeclarationNode::newStorageClass 209 209 210 DeclarationNode * DeclarationNode::newFuncSpecifier( FuncSpecifiers fs ) {210 DeclarationNode * DeclarationNode::newFuncSpecifier( DeclarationNode::FuncSpecifiers fs ) { 211 211 DeclarationNode * newnode = new DeclarationNode; 212 212 newnode->funcSpecs = fs; … … 214 214 } // DeclarationNode::newFuncSpecifier 215 215 216 DeclarationNode * DeclarationNode::newTypeQualifier( TypeQualifier stq ) {216 DeclarationNode * DeclarationNode::newTypeQualifier( TypeQualifier tq ) { 217 217 DeclarationNode * newnode = new DeclarationNode; 218 218 newnode->type = new TypeData(); 219 newnode->type->typeQualifiers = tq;219 newnode->type->typeQualifiers[ tq ] = true; 220 220 return newnode; 221 221 } // DeclarationNode::newQualifier … … 457 457 458 458 void DeclarationNode::checkQualifiers( const TypeData * src, const TypeData * dst ) { 459 const Type Qualifiers qsrc = src->typeQualifiers, qdst = dst->typeQualifiers; // optimization460 461 if ( (qsrc .val & qdst.val) != 0 ) {// duplicates ?459 const TypeData::TypeQualifiers qsrc = src->typeQualifiers, qdst = dst->typeQualifiers; // optimization 460 461 if ( (qsrc & qdst).any() ) { // duplicates ? 462 462 for ( unsigned int i = 0; i < NoTypeQualifier; i += 1 ) { // find duplicates 463 463 if ( qsrc[i] && qdst[i] ) { … … 520 520 src = nullptr; 521 521 } else { 522 dst->typeQualifiers .val |= src->typeQualifiers.val;522 dst->typeQualifiers |= src->typeQualifiers; 523 523 } // if 524 524 } // addQualifiersToType … … 578 578 switch ( dst->kind ) { 579 579 case TypeData::Unknown: 580 src->typeQualifiers .val |= dst->typeQualifiers.val;580 src->typeQualifiers |= dst->typeQualifiers; 581 581 dst = src; 582 582 src = nullptr; 583 583 break; 584 584 case TypeData::Basic: 585 dst->typeQualifiers .val |= src->typeQualifiers.val;585 dst->typeQualifiers |= src->typeQualifiers; 586 586 if ( src->kind != TypeData::Unknown ) { 587 587 assert( src->kind == TypeData::Basic ); … … 619 619 dst->base->aggInst.params = maybeClone( src->aggregate.actuals ); 620 620 } // if 621 dst->base->typeQualifiers .val |= src->typeQualifiers.val;621 dst->base->typeQualifiers |= src->typeQualifiers; 622 622 src = nullptr; 623 623 break; … … 651 651 type->aggInst.hoistType = o->type->enumeration.body; 652 652 } // if 653 type->typeQualifiers .val |= o->type->typeQualifiers.val;653 type->typeQualifiers |= o->type->typeQualifiers; 654 654 } else { 655 655 type = o->type; … … 807 807 p->type->base->aggInst.params = maybeClone( type->aggregate.actuals ); 808 808 } // if 809 p->type->base->typeQualifiers .val |= type->typeQualifiers.val;809 p->type->base->typeQualifiers |= type->typeQualifiers; 810 810 break; 811 811 … … 844 844 lastArray->base->aggInst.params = maybeClone( type->aggregate.actuals ); 845 845 } // if 846 lastArray->base->typeQualifiers .val |= type->typeQualifiers.val;846 lastArray->base->typeQualifiers |= type->typeQualifiers; 847 847 break; 848 848 default:
Note:
See TracChangeset
for help on using the changeset viewer.