Changeset f841241 for src/Parser/DeclarationNode.cc
- Timestamp:
- Mar 15, 2017, 11:23:48 AM (6 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 9243cc91, ecc7752
- Parents:
- 3831b58 (diff), e61a35e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r3831b58 rf841241 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 0:19:38201713 // Update Count : 9 6412 // Last Modified On : Tue Mar 14 14:45:52 2017 13 // Update Count : 973 14 14 // 15 15 … … 202 202 203 203 204 DeclarationNode * DeclarationNode::newStorageClass( DeclarationNode::StorageClasses sc ) {204 DeclarationNode * DeclarationNode::newStorageClass( StorageClasses sc ) { 205 205 DeclarationNode * newnode = new DeclarationNode; 206 206 newnode->storageClasses = sc; … … 208 208 } // DeclarationNode::newStorageClass 209 209 210 DeclarationNode * DeclarationNode::newFuncSpecifier( DeclarationNode::FuncSpecifiers fs ) {210 DeclarationNode * DeclarationNode::newFuncSpecifier( FuncSpecifiers fs ) { 211 211 DeclarationNode * newnode = new DeclarationNode; 212 212 newnode->funcSpecs = fs; … … 214 214 } // DeclarationNode::newFuncSpecifier 215 215 216 DeclarationNode * DeclarationNode::newTypeQualifier( TypeQualifier tq ) {216 DeclarationNode * DeclarationNode::newTypeQualifier( TypeQualifiers tq ) { 217 217 DeclarationNode * newnode = new DeclarationNode; 218 218 newnode->type = new TypeData(); 219 newnode->type->typeQualifiers [ tq ] = true;219 newnode->type->typeQualifiers = tq; 220 220 return newnode; 221 221 } // DeclarationNode::newQualifier … … 457 457 458 458 void DeclarationNode::checkQualifiers( const TypeData * src, const TypeData * dst ) { 459 const Type Data::TypeQualifiers qsrc = src->typeQualifiers, qdst = dst->typeQualifiers; // optimization460 461 if ( (qsrc & qdst).any() ) {// duplicates ?459 const TypeQualifiers qsrc = src->typeQualifiers, qdst = dst->typeQualifiers; // optimization 460 461 if ( (qsrc.val & qdst.val) != 0 ) { // 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 |= src->typeQualifiers;522 dst->typeQualifiers.val |= src->typeQualifiers.val; 523 523 } // if 524 524 } // addQualifiersToType … … 578 578 switch ( dst->kind ) { 579 579 case TypeData::Unknown: 580 src->typeQualifiers |= dst->typeQualifiers;580 src->typeQualifiers.val |= dst->typeQualifiers.val; 581 581 dst = src; 582 582 src = nullptr; 583 583 break; 584 584 case TypeData::Basic: 585 dst->typeQualifiers |= src->typeQualifiers;585 dst->typeQualifiers.val |= src->typeQualifiers.val; 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 |= src->typeQualifiers;621 dst->base->typeQualifiers.val |= src->typeQualifiers.val; 622 622 src = nullptr; 623 623 break; … … 651 651 type->aggInst.hoistType = o->type->enumeration.body; 652 652 } // if 653 type->typeQualifiers |= o->type->typeQualifiers;653 type->typeQualifiers.val |= o->type->typeQualifiers.val; 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 |= type->typeQualifiers;809 p->type->base->typeQualifiers.val |= type->typeQualifiers.val; 810 810 break; 811 811 … … 844 844 lastArray->base->aggInst.params = maybeClone( type->aggregate.actuals ); 845 845 } // if 846 lastArray->base->typeQualifiers |= type->typeQualifiers;846 lastArray->base->typeQualifiers.val |= type->typeQualifiers.val; 847 847 break; 848 848 default:
Note: See TracChangeset
for help on using the changeset viewer.