MCPcopy Create free account
hub / github.com/carbonengine/trinity / HasUsedDeclarations

Function HasUsedDeclarations

shadercompiler/OutputHLSL.cpp:51–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51bool HasUsedDeclarations( ASTNode* node )
52{
53 for( unsigned i = 0; i < node->GetChildrenCount(); ++i )
54 {
55 if( node->GetChild( i ) )
56 {
57 if( node->GetChild( i )->GetNodeType() == NT_VAR_DECLARATION_LIST )
58 {
59 if( HasUsedDeclarations( node->GetChild( i ) ) )
60 {
61 return true;
62 }
63 }
64 else if( node->GetChild( i )->GetNodeType() == NT_NAME_DECLARATION )
65 {
66 if( node->GetChild( i )->GetSymbol() && node->GetChild( i )->GetSymbol()->used )
67 {
68 return true;
69 }
70 }
71 }
72 }
73 return false;
74}
75
76std::map<int, std::string> s_operators = {
77 { OP_MUL_ASSIGN, "*=" },

Callers 1

OutputHLSL.cppFile · 0.70

Calls 4

GetChildrenCountMethod · 0.80
GetNodeTypeMethod · 0.80
GetSymbolMethod · 0.80
GetChildMethod · 0.45

Tested by

no test coverage detected