| 561 | } |
| 562 | |
| 563 | static void PatchCBuffers( ParserState& state, ASTNode* parent, unsigned& index ) |
| 564 | { |
| 565 | ASTNode* node = parent->GetChild( index ); |
| 566 | if( node == nullptr ) |
| 567 | { |
| 568 | return; |
| 569 | } |
| 570 | if( node->GetNodeType() == NT_NAME_DECLARATION ) |
| 571 | { |
| 572 | int cbufferIndex = GetCBufferIndex( node->GetSymbol() ); |
| 573 | if( cbufferIndex >= 0 ) |
| 574 | { |
| 575 | ASTNode* shadowStruct; |
| 576 | ASTNode* cbuffer = AddCBuffer( state, node, cbufferIndex, shadowStruct ); |
| 577 | |
| 578 | cbuffer->AddChild( node ); |
| 579 | parent->RemoveChild( index ); |
| 580 | if( shadowStruct ) |
| 581 | { |
| 582 | parent->InsertChild( index++, shadowStruct ); |
| 583 | } |
| 584 | parent->InsertChild( index, cbuffer ); |
| 585 | } |
| 586 | } |
| 587 | for( unsigned i = 0; i < node->GetChildrenCount(); ++i ) |
| 588 | { |
| 589 | PatchCBuffers( state, node, i ); |
| 590 | } |
| 591 | } |
| 592 | |
| 593 | void PatchCBuffers( ParserState& state ) |
| 594 | { |
no test coverage detected