| 897 | } |
| 898 | |
| 899 | int GetNodeOrder( ASTNode* t ) |
| 900 | { |
| 901 | switch( t->GetNodeType() ) |
| 902 | { |
| 903 | case NT_VAR_DECLARATION_LIST: |
| 904 | if( auto child = t->GetChildOrNull( 0 ) ) |
| 905 | { |
| 906 | if( child->GetNodeType() == NT_CBUFFER ) |
| 907 | { |
| 908 | return 2; |
| 909 | } |
| 910 | } |
| 911 | if( auto child = t->GetChildOrNull( 1 ) ) |
| 912 | { |
| 913 | if( child->GetNodeType() == NT_CBUFFER ) |
| 914 | { |
| 915 | return 2; |
| 916 | } |
| 917 | } |
| 918 | if( GetRegisterType( t->GetType() ) ) |
| 919 | { |
| 920 | return 2; |
| 921 | } |
| 922 | else |
| 923 | { |
| 924 | return 1; |
| 925 | } |
| 926 | case NT_TECHNIQUE: |
| 927 | return 12; |
| 928 | case NT_FUNCTION_DEFINITION: |
| 929 | return 11; |
| 930 | case NT_STRUCT: |
| 931 | return 0; |
| 932 | default: |
| 933 | return 0; |
| 934 | } |
| 935 | } |
| 936 | |
| 937 | void SortProgramNodes( ASTNode* root ) |
| 938 | { |
no test coverage detected