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

Function NewStructMember

shadercompiler/EffectCompilerMetal.cpp:2209–2224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2207}
2208
2209ASTNode* NewStructMember( ParserState& state, Symbol* sourceSymbol )
2210{
2211 auto symbol = state.GetSymbolTable().AddSymbol( state.AllocateNameWithPrefix( sourceSymbol->name ) );
2212 auto nameDecl = state.NewNode( NT_NAME_DECLARATION );
2213 symbol->definition = nameDecl;
2214 symbol->type = sourceSymbol->type;
2215 symbol->interpolationModifier = sourceSymbol->interpolationModifier;
2216 symbol->semantic = sourceSymbol->semantic;
2217 nameDecl->SetSymbol( symbol );
2218 nameDecl->SetType( sourceSymbol->type );
2219
2220 auto member = state.NewNode( NT_STRUCT_MEMBER );
2221 member->AddChild( nameDecl );
2222 member->SetType( sourceSymbol->type );
2223 return member;
2224}
2225
2226// Collects fields from nested structures and copies them int a flat structure
2227// In the process gathers access expressions for source struct fields (in the form blah.foo.bar...)

Callers 3

GatherFieldsFunction · 0.85
GatherInputsFunction · 0.85
GatherOutputsFunction · 0.85

Calls 6

AddSymbolMethod · 0.80
NewNodeMethod · 0.80
SetSymbolMethod · 0.80
AddChildMethod · 0.80
SetTypeMethod · 0.45

Tested by

no test coverage detected