MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / constructAggregate

Method constructAggregate

glslang/MachineIndependent/ParseHelper.cpp:10363–10375  ·  view source on GitHub ↗

This function tests for the type of the parameters to the structure or array constructor. Raises an error message if the expected type does not match the parameter passed to the constructor. Returns nullptr for an error or the input node itself if the expected and the given parameter types match.

Source from the content-addressed store, hash-verified

10361// Returns nullptr for an error or the input node itself if the expected and the given parameter types match.
10362//
10363TIntermTyped* TParseContext::constructAggregate(TIntermNode* node, const TType& type, int paramCount, const TSourceLoc& loc)
10364{
10365 TIntermTyped* converted = intermediate.addConversion(EOpConstructStruct, type, node->getAsTyped());
10366 if (! converted || converted->getType() != type) {
10367 bool enhanced = intermediate.getEnhancedMsgs();
10368 error(loc, "", "constructor", "cannot convert parameter %d from '%s' to '%s'", paramCount,
10369 node->getAsTyped()->getType().getCompleteString(enhanced).c_str(), type.getCompleteString(enhanced).c_str());
10370
10371 return nullptr;
10372 }
10373
10374 return converted;
10375}
10376
10377// If a memory qualifier is present in 'to', also make it present in 'from'.
10378void TParseContext::inheritMemoryQualifiers(const TQualifier& from, TQualifier& to)

Callers

nothing calls this directly

Calls 7

errorFunction · 0.85
addConversionMethod · 0.80
getTypeMethod · 0.80
getEnhancedMsgsMethod · 0.80
c_strMethod · 0.80
getAsTypedMethod · 0.45
getCompleteStringMethod · 0.45

Tested by

no test coverage detected