Use nullptr where possible instead of NULL or 0

This commit is contained in:
Johannes Kauffmann 2022-11-22 19:09:31 +01:00 committed by Jeremy Hayes
parent 728c689574
commit a7603c132d
38 changed files with 248 additions and 248 deletions

View file

@ -226,7 +226,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const());
break;
default:
return 0;
return nullptr;
#endif
}
}
@ -354,7 +354,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
break;
default:
return 0;
return nullptr;
}
TIntermConstantUnion *newNode = new TIntermConstantUnion(newConstArray, returnType);
@ -1345,7 +1345,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons
{
TType dereferencedType(node->getType(), index);
dereferencedType.getQualifier().storage = EvqConst;
TIntermTyped* result = 0;
TIntermTyped* result = nullptr;
int size = dereferencedType.computeNumComponents();
// arrays, vectors, matrices, all use simple multiplicative math
@ -1365,7 +1365,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons
result = addConstantUnion(TConstUnionArray(node->getAsConstantUnion()->getConstArray(), start, size), node->getType(), loc);
if (result == 0)
if (result == nullptr)
result = node;
else
result->setType(dereferencedType);
@ -1387,7 +1387,7 @@ TIntermTyped* TIntermediate::foldSwizzle(TIntermTyped* node, TSwizzleSelectors<T
TIntermTyped* result = addConstantUnion(constArray, node->getType(), loc);
if (result == 0)
if (result == nullptr)
result = node;
else
result->setType(TType(node->getBasicType(), EvqConst, selectors.size()));

View file

@ -352,7 +352,7 @@ TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermT
TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
const TSourceLoc& loc)
{
if (child == 0)
if (child == nullptr)
return nullptr;
if (child->getType().getBasicType() == EbtBlock)

View file

@ -1165,7 +1165,7 @@ TFunction* TParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunct
if (symbol && builtIn && function.getBuiltInOp() == EOpSpirvInst)
symbol = nullptr;
#endif
const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0;
const TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr;
if (prevDec) {
if (prevDec->isPrototyped() && prototype)
profileRequires(loc, EEsProfile, 300, nullptr, "multiple prototypes for same function");
@ -3140,7 +3140,7 @@ void TParseContext::reservedPpErrorCheck(const TSourceLoc& loc, const char* iden
ppWarn(loc, "\"defined\" is (un)defined:", op, identifier);
else
ppError(loc, "\"defined\" can't be (un)defined:", op, identifier);
else if (strstr(identifier, "__") != 0 && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) {
else if (strstr(identifier, "__") != nullptr && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) {
// The extension GL_EXT_spirv_intrinsics allows us to declare macros prefixed with "__".
if (isEsProfile() && version >= 300 &&
(strcmp(identifier, "__LINE__") == 0 ||
@ -5206,7 +5206,7 @@ void TParseContext::inductiveLoopCheck(const TSourceLoc& loc, TIntermNode* init,
bool badInit = false;
if (! init || ! init->getAsAggregate() || init->getAsAggregate()->getSequence().size() != 1)
badInit = true;
TIntermBinary* binaryInit = 0;
TIntermBinary* binaryInit = nullptr;
if (! badInit) {
// get the declaration assignment
binaryInit = init->getAsAggregate()->getSequence()[0]->getAsBinaryNode();
@ -6015,7 +6015,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
if (language == EShLangMesh || language == EShLangTask) {
requireExtensions(loc, Num_AEP_mesh_shader, AEP_mesh_shader, "gl_WorkGroupSize");
} else {
profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize");
profileRequires(loc, EEsProfile, 310, nullptr, "gl_WorkGroupSize");
profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize");
}
#endif
@ -7082,7 +7082,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
realFunc.addParameter(TParameter().copyParam((*function)[i]));
}
TParameter tmpP = { 0, &uintType };
TParameter tmpP = { nullptr, &uintType };
realFunc.addParameter(TParameter().copyParam(tmpP));
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true));
@ -7099,7 +7099,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
realFunc.addParameter(TParameter().copyParam((*function)[i]));
}
TParameter tmpP = { 0, &uintType };
TParameter tmpP = { nullptr, &uintType };
realFunc.addParameter(TParameter().copyParam(tmpP));
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true));

View file

@ -438,12 +438,12 @@ public:
const TFunction* findFunction400(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
const TFunction* findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
void declareTypeDefaults(const TSourceLoc&, const TPublicType&);
TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = 0, TIntermTyped* initializer = 0);
TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = nullptr, TIntermTyped* initializer = nullptr);
TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&);
TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&);
TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
void inheritMemoryQualifiers(const TQualifier& from, TQualifier& to);
void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = nullptr, TArraySizes* arraySizes = nullptr);
void blockStorageRemap(const TSourceLoc&, const TString*, TQualifier&);
void blockStageIoCheck(const TSourceLoc&, const TQualifier&);
void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName);

View file

@ -267,8 +267,8 @@ void* TPoolAllocator::allocate(size_t numBytes)
//
size_t numBytesToAlloc = allocationSize + headerSkip;
tHeader* memory = reinterpret_cast<tHeader*>(::new char[numBytesToAlloc]);
if (memory == 0)
return 0;
if (memory == nullptr)
return nullptr;
// Use placement-new to initialize header
new(memory) tHeader(inUseList, (numBytesToAlloc + pageSize - 1) / pageSize);
@ -289,8 +289,8 @@ void* TPoolAllocator::allocate(size_t numBytes)
freeList = freeList->nextPage;
} else {
memory = reinterpret_cast<tHeader*>(::new char[pageSize]);
if (memory == 0)
return 0;
if (memory == nullptr)
return nullptr;
}
// Use placement-new to initialize header
@ -308,7 +308,7 @@ void* TPoolAllocator::allocate(size_t numBytes)
//
void TAllocation::checkAllocList() const
{
for (const TAllocation* alloc = this; alloc != 0; alloc = alloc->prevAlloc)
for (const TAllocation* alloc = this; alloc != nullptr; alloc = alloc->prevAlloc)
alloc->check();
}

View file

@ -1357,7 +1357,7 @@ int ShInitialize()
ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions)
{
if (!InitThread())
return 0;
return nullptr;
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructCompiler(language, debugOptions));
@ -1367,7 +1367,7 @@ ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions)
ShHandle ShConstructLinker(const EShExecutable executable, int debugOptions)
{
if (!InitThread())
return 0;
return nullptr;
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructLinker(executable, debugOptions));
@ -1377,7 +1377,7 @@ ShHandle ShConstructLinker(const EShExecutable executable, int debugOptions)
ShHandle ShConstructUniformMap()
{
if (!InitThread())
return 0;
return nullptr;
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructUniformMap());
@ -1386,7 +1386,7 @@ ShHandle ShConstructUniformMap()
void ShDestruct(ShHandle handle)
{
if (handle == 0)
if (handle == nullptr)
return;
TShHandleBase* base = static_cast<TShHandleBase*>(handle);
@ -1419,7 +1419,7 @@ int ShFinalize()
for (int source = 0; source < SourceCount; ++source) {
for (int stage = 0; stage < EShLangCount; ++stage) {
delete SharedSymbolTables[version][spvVersion][p][source][stage];
SharedSymbolTables[version][spvVersion][p][source][stage] = 0;
SharedSymbolTables[version][spvVersion][p][source][stage] = nullptr;
}
}
}
@ -1432,7 +1432,7 @@ int ShFinalize()
for (int source = 0; source < SourceCount; ++source) {
for (int pc = 0; pc < EPcCount; ++pc) {
delete CommonSymbolTable[version][spvVersion][p][source][pc];
CommonSymbolTable[version][spvVersion][p][source][pc] = 0;
CommonSymbolTable[version][spvVersion][p][source][pc] = nullptr;
}
}
}
@ -1475,12 +1475,12 @@ int ShCompile(
)
{
// Map the generic handle to the C++ object
if (handle == 0)
if (handle == nullptr)
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
TCompiler* compiler = base->getAsCompiler();
if (compiler == 0)
if (compiler == nullptr)
return 0;
SetThreadPoolAllocator(compiler->getPool());
@ -1520,13 +1520,13 @@ int ShLinkExt(
const ShHandle compHandles[],
const int numHandles)
{
if (linkHandle == 0 || numHandles == 0)
if (linkHandle == nullptr || numHandles == 0)
return 0;
THandleList cObjects;
for (int i = 0; i < numHandles; ++i) {
if (compHandles[i] == 0)
if (compHandles[i] == nullptr)
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(compHandles[i]);
if (base->getAsLinker()) {
@ -1535,7 +1535,7 @@ int ShLinkExt(
if (base->getAsCompiler())
cObjects.push_back(base->getAsCompiler());
if (cObjects[i] == 0)
if (cObjects[i] == nullptr)
return 0;
}
@ -1544,7 +1544,7 @@ int ShLinkExt(
SetThreadPoolAllocator(linker->getPool());
if (linker == 0)
if (linker == nullptr)
return 0;
linker->infoSink.info.erase();
@ -1569,7 +1569,7 @@ int ShLinkExt(
//
void ShSetEncryptionMethod(ShHandle handle)
{
if (handle == 0)
if (handle == nullptr)
return;
}
@ -1578,8 +1578,8 @@ void ShSetEncryptionMethod(ShHandle handle)
//
const char* ShGetInfoLog(const ShHandle handle)
{
if (handle == 0)
return 0;
if (handle == nullptr)
return nullptr;
TShHandleBase* base = static_cast<TShHandleBase*>(handle);
TInfoSink* infoSink;
@ -1589,7 +1589,7 @@ const char* ShGetInfoLog(const ShHandle handle)
else if (base->getAsLinker())
infoSink = &(base->getAsLinker()->getInfoSink());
else
return 0;
return nullptr;
infoSink->info << infoSink->debug.c_str();
return infoSink->info.c_str();
@ -1601,14 +1601,14 @@ const char* ShGetInfoLog(const ShHandle handle)
//
const void* ShGetExecutable(const ShHandle handle)
{
if (handle == 0)
return 0;
if (handle == nullptr)
return nullptr;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
if (linker == 0)
return 0;
if (linker == nullptr)
return nullptr;
return linker->getObjectCode();
}
@ -1623,13 +1623,13 @@ const void* ShGetExecutable(const ShHandle handle)
//
int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* table)
{
if (handle == 0)
if (handle == nullptr)
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
if (linker == 0)
if (linker == nullptr)
return 0;
linker->setAppAttributeBindings(table);
@ -1642,13 +1642,13 @@ int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* t
//
int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* table)
{
if (handle == 0)
if (handle == nullptr)
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
if (linker == 0)
if (linker == nullptr)
return 0;
linker->setFixedAttributeBindings(table);
@ -1660,12 +1660,12 @@ int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* tab
//
int ShExcludeAttributes(const ShHandle handle, int *attributes, int count)
{
if (handle == 0)
if (handle == nullptr)
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
if (linker == 0)
if (linker == nullptr)
return 0;
linker->setExcludedAttributes(attributes, count);
@ -1681,12 +1681,12 @@ int ShExcludeAttributes(const ShHandle handle, int *attributes, int count)
//
int ShGetUniformLocation(const ShHandle handle, const char* name)
{
if (handle == 0)
if (handle == nullptr)
return -1;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
TUniformMap* uniformMap= base->getAsUniformMap();
if (uniformMap == 0)
if (uniformMap == nullptr)
return -1;
return uniformMap->getLocation(name);
@ -1954,14 +1954,14 @@ const char* TShader::getInfoDebugLog()
TProgram::TProgram() :
#if !defined(GLSLANG_WEB)
reflection(0),
reflection(nullptr),
#endif
linked(false)
{
pool = new TPoolAllocator;
infoSink = new TInfoSink;
for (int s = 0; s < EShLangCount; ++s) {
intermediate[s] = 0;
intermediate[s] = nullptr;
newedIntermediate[s] = false;
}
}

View file

@ -416,7 +416,7 @@ TAnonMember* TAnonMember::clone() const
// copy of the original container.
assert(0);
return 0;
return nullptr;
}
TSymbolTableLevel* TSymbolTableLevel::clone() const

View file

@ -84,7 +84,7 @@ typedef TVector<const char*> TExtensionList;
class TSymbol {
public:
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
explicit TSymbol(const TString *n) : name(n), uniqueId(0), extensions(0), writable(true) { }
explicit TSymbol(const TString *n) : name(n), uniqueId(0), extensions(nullptr), writable(true) { }
virtual TSymbol* clone() const = 0;
virtual ~TSymbol() { } // rely on all symbol owned memory coming from the pool
@ -97,18 +97,18 @@ public:
changeName(NewPoolTString(newName.c_str()));
}
virtual const TString& getMangledName() const { return getName(); }
virtual TFunction* getAsFunction() { return 0; }
virtual const TFunction* getAsFunction() const { return 0; }
virtual TVariable* getAsVariable() { return 0; }
virtual const TVariable* getAsVariable() const { return 0; }
virtual const TAnonMember* getAsAnonMember() const { return 0; }
virtual TFunction* getAsFunction() { return nullptr; }
virtual const TFunction* getAsFunction() const { return nullptr; }
virtual TVariable* getAsVariable() { return nullptr; }
virtual const TVariable* getAsVariable() const { return nullptr; }
virtual const TAnonMember* getAsAnonMember() const { return nullptr; }
virtual const TType& getType() const = 0;
virtual TType& getWritableType() = 0;
virtual void setUniqueId(long long id) { uniqueId = id; }
virtual long long getUniqueId() const { return uniqueId; }
virtual void setExtensions(int numExts, const char* const exts[])
{
assert(extensions == 0);
assert(extensions == nullptr);
assert(numExts > 0);
extensions = NewPoolObject(extensions);
for (int e = 0; e < numExts; ++e)
@ -229,7 +229,7 @@ struct TParameter {
if (param.name)
name = NewPoolTString(param.name->c_str());
else
name = 0;
name = nullptr;
type = param.type->clone();
defaultValue = param.defaultValue;
return *this;
@ -243,7 +243,7 @@ struct TParameter {
class TFunction : public TSymbol {
public:
explicit TFunction(TOperator o) :
TSymbol(0),
TSymbol(nullptr),
op(o),
defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0) { }
TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull) :
@ -411,7 +411,7 @@ protected:
class TSymbolTableLevel {
public:
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
TSymbolTableLevel() : defaultPrecision(0), anonId(0), thisLevel(false) { }
TSymbolTableLevel() : defaultPrecision(nullptr), anonId(0), thisLevel(false) { }
~TSymbolTableLevel();
bool insert(const TString& name, TSymbol* symbol) {
@ -493,7 +493,7 @@ public:
{
tLevel::const_iterator it = level.find(name);
if (it == level.end())
return 0;
return nullptr;
else
return (*it).second;
}
@ -561,7 +561,7 @@ public:
{
// can call multiple times at one scope, will only latch on first call,
// as we're tracking the previous scope's values, not the current values
if (defaultPrecision != 0)
if (defaultPrecision != nullptr)
return;
defaultPrecision = new TPrecisionQualifier[EbtNumTypes];
@ -573,7 +573,7 @@ public:
{
// can be called for table level pops that didn't set the
// defaults
if (defaultPrecision == 0 || p == 0)
if (defaultPrecision == nullptr || p == nullptr)
return;
for (int t = 0; t < EbtNumTypes; ++t)
@ -622,7 +622,7 @@ public:
// don't deallocate levels passed in from elsewhere
while (table.size() > adoptedLevels)
pop(0);
pop(nullptr);
}
void adoptLevels(TSymbolTable& symTable)
@ -783,7 +783,7 @@ public:
// Normal find of a symbol, that can optionally say whether the symbol was found
// at a built-in level or the current top-scope level.
TSymbol* find(const TString& name, bool* builtIn = 0, bool* currentScope = 0, int* thisDepthP = 0)
TSymbol* find(const TString& name, bool* builtIn = nullptr, bool* currentScope = nullptr, int* thisDepthP = nullptr)
{
int level = currentLevel();
TSymbol* symbol;
@ -827,7 +827,7 @@ public:
++thisDepth;
symbol = table[level]->find(name);
--level;
} while (symbol == 0 && level >= 0);
} while (symbol == nullptr && level >= 0);
if (! table[level + 1]->isThisLevel())
thisDepth = 0;

View file

@ -1066,8 +1066,8 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con
if (strcmp(extension, "GL_NV_mesh_shader") == 0) {
requireStage(loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask | EShLangFragmentMask),
"#extension GL_NV_mesh_shader");
profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_NV_mesh_shader");
profileRequires(loc, EEsProfile, 320, 0, "#extension GL_NV_mesh_shader");
profileRequires(loc, ECoreProfile, 450, nullptr, "#extension GL_NV_mesh_shader");
profileRequires(loc, EEsProfile, 320, nullptr, "#extension GL_NV_mesh_shader");
if (extensionTurnedOn(E_GL_EXT_mesh_shader)) {
error(loc, "GL_EXT_mesh_shader is already turned on, and not allowed with", "#extension", extension);
}
@ -1075,8 +1075,8 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con
else if (strcmp(extension, "GL_EXT_mesh_shader") == 0) {
requireStage(loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask | EShLangFragmentMask),
"#extension GL_EXT_mesh_shader");
profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_EXT_mesh_shader");
profileRequires(loc, EEsProfile, 320, 0, "#extension GL_EXT_mesh_shader");
profileRequires(loc, ECoreProfile, 450, nullptr, "#extension GL_EXT_mesh_shader");
profileRequires(loc, EEsProfile, 320, nullptr, "#extension GL_EXT_mesh_shader");
if (extensionTurnedOn(E_GL_NV_mesh_shader)) {
error(loc, "GL_NV_mesh_shader is already turned on, and not allowed with", "#extension", extension);
}

View file

@ -5446,7 +5446,7 @@ yyreduce:
case 31: /* function_call_header_with_parameters: function_call_header assignment_expression */
#line 526 "MachineIndependent/glslang.y"
{
TParameter param = { 0, new TType };
TParameter param = { nullptr, new TType };
param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType());
(yyvsp[-1].interm).function->addParameter(param);
(yyval.interm).function = (yyvsp[-1].interm).function;
@ -5458,7 +5458,7 @@ yyreduce:
case 32: /* function_call_header_with_parameters: function_call_header_with_parameters COMMA assignment_expression */
#line 533 "MachineIndependent/glslang.y"
{
TParameter param = { 0, new TType };
TParameter param = { nullptr, new TType };
param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType());
(yyvsp[-2].interm).function->addParameter(param);
(yyval.interm).function = (yyvsp[-2].interm).function;
@ -5479,7 +5479,7 @@ yyreduce:
#line 551 "MachineIndependent/glslang.y"
{
// Constructor
(yyval.interm).intermNode = 0;
(yyval.interm).intermNode = nullptr;
(yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type));
}
#line 5486 "MachineIndependent/glslang_tab.cpp"
@ -5491,8 +5491,8 @@ yyreduce:
//
// Should be a method or subroutine call, but we haven't recognized the arguments yet.
//
(yyval.interm).function = 0;
(yyval.interm).intermNode = 0;
(yyval.interm).function = nullptr;
(yyval.interm).intermNode = nullptr;
TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode();
if (method) {
@ -5508,7 +5508,7 @@ yyreduce:
parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", "");
}
if ((yyval.interm).function == 0) {
if ((yyval.interm).function == nullptr) {
// error recover
TString* empty = NewPoolTString("");
(yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull);
@ -5521,7 +5521,7 @@ yyreduce:
#line 584 "MachineIndependent/glslang.y"
{
// Constructor
(yyval.interm).intermNode = 0;
(yyval.interm).intermNode = nullptr;
(yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type));
}
#line 5528 "MachineIndependent/glslang_tab.cpp"
@ -5612,7 +5612,7 @@ yyreduce:
#line 637 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5619 "MachineIndependent/glslang_tab.cpp"
@ -5622,7 +5622,7 @@ yyreduce:
#line 642 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5629 "MachineIndependent/glslang_tab.cpp"
@ -5633,7 +5633,7 @@ yyreduce:
{
parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%");
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5640 "MachineIndependent/glslang_tab.cpp"
@ -5649,7 +5649,7 @@ yyreduce:
#line 657 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5656 "MachineIndependent/glslang_tab.cpp"
@ -5659,7 +5659,7 @@ yyreduce:
#line 662 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5666 "MachineIndependent/glslang_tab.cpp"
@ -5676,7 +5676,7 @@ yyreduce:
{
parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left");
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5683 "MachineIndependent/glslang_tab.cpp"
@ -5687,7 +5687,7 @@ yyreduce:
{
parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right");
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5694 "MachineIndependent/glslang_tab.cpp"
@ -5703,7 +5703,7 @@ yyreduce:
#line 687 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
#line 5710 "MachineIndependent/glslang_tab.cpp"
@ -5713,7 +5713,7 @@ yyreduce:
#line 692 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
#line 5720 "MachineIndependent/glslang_tab.cpp"
@ -5723,7 +5723,7 @@ yyreduce:
#line 697 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
#line 5730 "MachineIndependent/glslang_tab.cpp"
@ -5733,7 +5733,7 @@ yyreduce:
#line 702 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
#line 5740 "MachineIndependent/glslang_tab.cpp"
@ -5753,7 +5753,7 @@ yyreduce:
parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "==");
parseContext.referenceCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "==");
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "==", EOpEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
#line 5760 "MachineIndependent/glslang_tab.cpp"
@ -5767,7 +5767,7 @@ yyreduce:
parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!=");
parseContext.referenceCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!=");
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "!=", EOpNotEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
#line 5774 "MachineIndependent/glslang_tab.cpp"
@ -5784,7 +5784,7 @@ yyreduce:
{
parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and");
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5791 "MachineIndependent/glslang_tab.cpp"
@ -5801,7 +5801,7 @@ yyreduce:
{
parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or");
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5808 "MachineIndependent/glslang_tab.cpp"
@ -5818,7 +5818,7 @@ yyreduce:
{
parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or");
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
#line 5825 "MachineIndependent/glslang_tab.cpp"
@ -5834,7 +5834,7 @@ yyreduce:
#line 763 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
#line 5841 "MachineIndependent/glslang_tab.cpp"
@ -5850,7 +5850,7 @@ yyreduce:
#line 772 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
#line 5857 "MachineIndependent/glslang_tab.cpp"
@ -5866,7 +5866,7 @@ yyreduce:
#line 781 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0)
if ((yyval.interm.intermTypedNode) == nullptr)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
#line 5873 "MachineIndependent/glslang_tab.cpp"
@ -5895,7 +5895,7 @@ yyreduce:
parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode));
parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[0].interm.intermTypedNode));
(yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[-5].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-4].lex).loc);
if ((yyval.interm.intermTypedNode) == 0) {
if ((yyval.interm.intermTypedNode) == nullptr) {
parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), (yyvsp[0].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
@ -5919,7 +5919,7 @@ yyreduce:
parseContext.lValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode));
parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode));
(yyval.interm.intermTypedNode) = parseContext.addAssign((yyvsp[-1].interm).loc, (yyvsp[-1].interm).op, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0) {
if ((yyval.interm.intermTypedNode) == nullptr) {
parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), (yyvsp[0].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
@ -6040,7 +6040,7 @@ yyreduce:
{
parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode));
(yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc);
if ((yyval.interm.intermTypedNode) == 0) {
if ((yyval.interm.intermTypedNode) == nullptr) {
parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), (yyvsp[0].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
@ -6061,7 +6061,7 @@ yyreduce:
#line 894 "MachineIndependent/glslang.y"
{
parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */);
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
// TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
}
#line 6068 "MachineIndependent/glslang_tab.cpp"
@ -6073,7 +6073,7 @@ yyreduce:
parseContext.requireExtensions((yyvsp[-1].interm).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier");
(yyvsp[-1].interm).function->setSpirvInstruction(*(yyvsp[-2].interm.spirvInst)); // Attach SPIR-V intruction qualifier
parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */);
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
// TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
}
#line 6080 "MachineIndependent/glslang_tab.cpp"
@ -6084,7 +6084,7 @@ yyreduce:
{
parseContext.globalCheck((yyvsp[0].lex).loc, "SPIR-V execution mode qualifier");
parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier");
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 6090 "MachineIndependent/glslang_tab.cpp"
break;
@ -6102,11 +6102,11 @@ yyreduce:
case 98: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */
#line 918 "MachineIndependent/glslang.y"
{
parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement");
parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, nullptr, "precision statement");
// lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope
parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]);
parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision);
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 6112 "MachineIndependent/glslang_tab.cpp"
break;
@ -6115,7 +6115,7 @@ yyreduce:
#line 925 "MachineIndependent/glslang.y"
{
parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList);
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 6121 "MachineIndependent/glslang_tab.cpp"
break;
@ -6124,7 +6124,7 @@ yyreduce:
#line 929 "MachineIndependent/glslang.y"
{
parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string);
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 6130 "MachineIndependent/glslang_tab.cpp"
break;
@ -6133,7 +6133,7 @@ yyreduce:
#line 933 "MachineIndependent/glslang.y"
{
parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes);
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 6139 "MachineIndependent/glslang_tab.cpp"
break;
@ -6143,7 +6143,7 @@ yyreduce:
{
parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier);
parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type));
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 6149 "MachineIndependent/glslang_tab.cpp"
break;
@ -6153,7 +6153,7 @@ yyreduce:
{
parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers);
parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string);
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 6159 "MachineIndependent/glslang_tab.cpp"
break;
@ -6164,7 +6164,7 @@ yyreduce:
parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers);
(yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string);
parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList));
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 6170 "MachineIndependent/glslang_tab.cpp"
break;
@ -6330,7 +6330,7 @@ yyreduce:
{
if ((yyvsp[-1].interm.type).arraySizes) {
parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires((yyvsp[-1].interm.type).loc, EEsProfile, 300, 0, "arrayed type");
parseContext.profileRequires((yyvsp[-1].interm.type).loc, EEsProfile, 300, nullptr, "arrayed type");
parseContext.arraySizeRequiredCheck((yyvsp[-1].interm.type).loc, *(yyvsp[-1].interm.type).arraySizes);
}
if ((yyvsp[-1].interm.type).basicType == EbtVoid) {
@ -6350,7 +6350,7 @@ yyreduce:
{
if ((yyvsp[-2].interm.type).arraySizes) {
parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type");
parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, nullptr, "arrayed type");
parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes);
}
TType* type = new TType((yyvsp[-2].interm.type));
@ -6427,7 +6427,7 @@ yyreduce:
case 124: /* parameter_type_specifier: type_specifier */
#line 1146 "MachineIndependent/glslang.y"
{
TParameter param = { 0, new TType((yyvsp[0].interm.type)) };
TParameter param = { nullptr, new TType((yyvsp[0].interm.type)) };
(yyval.interm).param = param;
if ((yyvsp[0].interm.type).arraySizes)
parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes);
@ -6475,7 +6475,7 @@ yyreduce:
#line 1171 "MachineIndependent/glslang.y"
{
(yyval.interm).type = (yyvsp[-4].interm).type;
TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode));
TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, nullptr, (yyvsp[0].interm.intermTypedNode));
(yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc);
}
#line 6482 "MachineIndependent/glslang_tab.cpp"
@ -6485,7 +6485,7 @@ yyreduce:
#line 1179 "MachineIndependent/glslang.y"
{
(yyval.interm).type = (yyvsp[0].interm.type);
(yyval.interm).intermNode = 0;
(yyval.interm).intermNode = nullptr;
parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type);
@ -6497,7 +6497,7 @@ yyreduce:
#line 1186 "MachineIndependent/glslang.y"
{
(yyval.interm).type = (yyvsp[-1].interm.type);
(yyval.interm).intermNode = 0;
(yyval.interm).intermNode = nullptr;
parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type));
}
#line 6504 "MachineIndependent/glslang_tab.cpp"
@ -6507,7 +6507,7 @@ yyreduce:
#line 1191 "MachineIndependent/glslang.y"
{
(yyval.interm).type = (yyvsp[-2].interm.type);
(yyval.interm).intermNode = 0;
(yyval.interm).intermNode = nullptr;
parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes);
}
#line 6514 "MachineIndependent/glslang_tab.cpp"
@ -6518,7 +6518,7 @@ yyreduce:
{
(yyval.interm).type = (yyvsp[-4].interm.type);
TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode));
(yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc);
(yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, initNode, (yyvsp[-1].lex).loc);
}
#line 6524 "MachineIndependent/glslang_tab.cpp"
break;
@ -6527,8 +6527,8 @@ yyreduce:
#line 1201 "MachineIndependent/glslang.y"
{
(yyval.interm).type = (yyvsp[-3].interm.type);
TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode));
(yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc);
TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), nullptr, (yyvsp[0].interm.intermTypedNode));
(yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, initNode, (yyvsp[-1].lex).loc);
}
#line 6534 "MachineIndependent/glslang_tab.cpp"
break;
@ -6541,7 +6541,7 @@ yyreduce:
parseContext.globalQualifierTypeCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyval.interm.type));
if ((yyvsp[0].interm.type).arraySizes) {
parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type");
parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, nullptr, "arrayed type");
}
parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier);
}
@ -6556,7 +6556,7 @@ yyreduce:
if ((yyvsp[0].interm.type).arraySizes) {
parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type");
parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, nullptr, "arrayed type");
}
if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier))
@ -6581,7 +6581,7 @@ yyreduce:
#line 1247 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "invariant");
parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant");
parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, nullptr, "invariant");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.invariant = true;
}
@ -6592,8 +6592,8 @@ yyreduce:
#line 1256 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "smooth");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "smooth");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, nullptr, "smooth");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, nullptr, "smooth");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.smooth = true;
}
@ -6604,8 +6604,8 @@ yyreduce:
#line 1263 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "flat");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "flat");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, nullptr, "flat");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, nullptr, "flat");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.flat = true;
}
@ -6617,7 +6617,7 @@ yyreduce:
{
parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "noperspective");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, nullptr, "noperspective");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.nopersp = true;
}
@ -6945,8 +6945,8 @@ yyreduce:
case 172: /* storage_qualifier: CENTROID */
#line 1466 "MachineIndependent/glslang.y"
{
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, nullptr, "centroid");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, nullptr, "centroid");
parseContext.globalCheck((yyvsp[0].lex).loc, "centroid");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.centroid = true;
@ -6969,7 +6969,7 @@ yyreduce:
{
parseContext.globalCheck((yyvsp[0].lex).loc, "shared");
parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, nullptr, "shared");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshMask | EShLangTaskMask), "shared");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqShared;
@ -7415,7 +7415,7 @@ yyreduce:
case 214: /* type_parameter_specifier_opt: %empty */
#line 1745 "MachineIndependent/glslang.y"
{
(yyval.interm.typeParameters) = 0;
(yyval.interm.typeParameters) = nullptr;
}
#line 7421 "MachineIndependent/glslang_tab.cpp"
break;
@ -10779,7 +10779,7 @@ yyreduce:
case 533: /* precision_qualifier: HIGH_PRECISION */
#line 3534 "MachineIndependent/glslang.y"
{
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, nullptr, "highp precision qualifier");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh);
}
@ -10789,7 +10789,7 @@ yyreduce:
case 534: /* precision_qualifier: MEDIUM_PRECISION */
#line 3539 "MachineIndependent/glslang.y"
{
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, nullptr, "mediump precision qualifier");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium);
}
@ -10799,7 +10799,7 @@ yyreduce:
case 535: /* precision_qualifier: LOW_PRECISION */
#line 3544 "MachineIndependent/glslang.y"
{
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier");
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, nullptr, "lowp precision qualifier");
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow);
}
@ -10874,7 +10874,7 @@ yyreduce:
{
if ((yyvsp[-2].interm.type).arraySizes) {
parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type");
parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, nullptr, "arrayed type");
if (parseContext.isEsProfile())
parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes);
}
@ -10901,7 +10901,7 @@ yyreduce:
{
if ((yyvsp[-2].interm.type).arraySizes) {
parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type");
parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, nullptr, "arrayed type");
if (parseContext.isEsProfile())
parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes);
}
@ -11009,7 +11009,7 @@ yyreduce:
case 552: /* initializer_list: initializer */
#line 3691 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc());
(yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(nullptr, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc());
}
#line 11015 "MachineIndependent/glslang_tab.cpp"
break;
@ -11100,7 +11100,7 @@ yyreduce:
case 566: /* compound_statement: LEFT_BRACE RIGHT_BRACE */
#line 3735 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = 0; }
{ (yyval.interm.intermNode) = nullptr; }
#line 11105 "MachineIndependent/glslang_tab.cpp"
break;
@ -11185,7 +11185,7 @@ yyreduce:
case 576: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */
#line 3778 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 11191 "MachineIndependent/glslang_tab.cpp"
break;
@ -11206,8 +11206,8 @@ yyreduce:
(yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode));
if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase ||
(yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) {
parseContext.wrapupSwitchSubsequence(0, (yyvsp[0].interm.intermNode));
(yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case
parseContext.wrapupSwitchSubsequence(nullptr, (yyvsp[0].interm.intermNode));
(yyval.interm.intermNode) = nullptr; // start a fresh subsequence for what's after this case
}
}
#line 11214 "MachineIndependent/glslang_tab.cpp"
@ -11218,8 +11218,8 @@ yyreduce:
{
if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase ||
(yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) {
parseContext.wrapupSwitchSubsequence((yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0, (yyvsp[0].interm.intermNode));
(yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case
parseContext.wrapupSwitchSubsequence((yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : nullptr, (yyvsp[0].interm.intermNode));
(yyval.interm.intermNode) = nullptr; // start a fresh subsequence for what's after this case
} else
(yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode));
}
@ -11228,7 +11228,7 @@ yyreduce:
case 580: /* expression_statement: SEMICOLON */
#line 3808 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = 0; }
{ (yyval.interm.intermNode) = nullptr; }
#line 11233 "MachineIndependent/glslang_tab.cpp"
break;
@ -11278,7 +11278,7 @@ yyreduce:
#line 3836 "MachineIndependent/glslang.y"
{
(yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode);
(yyval.interm.nodePair).node2 = 0;
(yyval.interm.nodePair).node2 = nullptr;
}
#line 11284 "MachineIndependent/glslang_tab.cpp"
break;
@ -11298,11 +11298,11 @@ yyreduce:
parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type));
TType type((yyvsp[-3].interm.type));
TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode));
TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), nullptr, (yyvsp[0].interm.intermTypedNode));
if (initNode)
(yyval.interm.intermTypedNode) = initNode->getAsTyped();
else
(yyval.interm.intermTypedNode) = 0;
(yyval.interm.intermTypedNode) = nullptr;
}
#line 11308 "MachineIndependent/glslang_tab.cpp"
break;
@ -11341,7 +11341,7 @@ yyreduce:
case 592: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */
#line 3881 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0);
(yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : nullptr);
delete parseContext.switchSequenceStack.back();
parseContext.switchSequenceStack.pop_back();
parseContext.switchLevel.pop_back();
@ -11355,7 +11355,7 @@ yyreduce:
case 593: /* switch_statement_list: %empty */
#line 3893 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 11361 "MachineIndependent/glslang_tab.cpp"
break;
@ -11371,7 +11371,7 @@ yyreduce:
case 595: /* case_label: CASE expression COLON */
#line 3902 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
if (parseContext.switchLevel.size() == 0)
parseContext.error((yyvsp[-2].lex).loc, "cannot appear outside switch statement", "case", "");
else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
@ -11388,7 +11388,7 @@ yyreduce:
case 596: /* case_label: DEFAULT COLON */
#line 3914 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
if (parseContext.switchLevel.size() == 0)
parseContext.error((yyvsp[-1].lex).loc, "cannot appear outside switch statement", "default", "");
else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
@ -11434,7 +11434,7 @@ yyreduce:
#line 3946 "MachineIndependent/glslang.y"
{
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
(yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc);
(yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), nullptr, true, (yyvsp[-5].lex).loc);
--parseContext.loopNestingLevel;
--parseContext.statementNestingLevel;
--parseContext.controlFlowNestingLevel;
@ -11461,7 +11461,7 @@ yyreduce:
parseContext.boolCheck((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode));
(yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[-5].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, false, (yyvsp[-4].lex).loc);
(yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[-5].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), nullptr, false, (yyvsp[-4].lex).loc);
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
--parseContext.loopNestingLevel;
--parseContext.statementNestingLevel;
@ -11525,7 +11525,7 @@ yyreduce:
case 608: /* conditionopt: %empty */
#line 4004 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = 0;
(yyval.interm.intermTypedNode) = nullptr;
}
#line 11531 "MachineIndependent/glslang_tab.cpp"
break;
@ -11534,7 +11534,7 @@ yyreduce:
#line 4010 "MachineIndependent/glslang.y"
{
(yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode);
(yyval.interm.nodePair).node2 = 0;
(yyval.interm.nodePair).node2 = nullptr;
}
#line 11540 "MachineIndependent/glslang_tab.cpp"
break;
@ -11826,7 +11826,7 @@ yyreduce:
#line 4190 "MachineIndependent/glslang.y"
{
parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i);
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 11832 "MachineIndependent/glslang_tab.cpp"
break;
@ -11836,7 +11836,7 @@ yyreduce:
{
parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq));
parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i);
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 11842 "MachineIndependent/glslang_tab.cpp"
break;
@ -11845,7 +11845,7 @@ yyreduce:
#line 4199 "MachineIndependent/glslang.y"
{
parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate());
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 11851 "MachineIndependent/glslang_tab.cpp"
break;
@ -11855,7 +11855,7 @@ yyreduce:
{
parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq));
parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate());
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 11861 "MachineIndependent/glslang_tab.cpp"
break;
@ -11864,7 +11864,7 @@ yyreduce:
#line 4208 "MachineIndependent/glslang.y"
{
parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate());
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 11870 "MachineIndependent/glslang_tab.cpp"
break;
@ -11874,7 +11874,7 @@ yyreduce:
{
parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq));
parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate());
(yyval.interm.intermNode) = 0;
(yyval.interm.intermNode) = nullptr;
}
#line 11880 "MachineIndependent/glslang_tab.cpp"
break;

View file

@ -1552,7 +1552,7 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
break;
}
if (treeRoot == 0 || ! tree)
if (treeRoot == nullptr || ! tree)
return;
TOutputTraverser it(infoSink);

View file

@ -1383,7 +1383,7 @@ void TIntermediate::checkCallGraphCycles(TInfoSink& infoSink)
TCall* newRoot;
do {
// See if we have unvisited parts of the graph.
newRoot = 0;
newRoot = nullptr;
for (TGraph::iterator call = callGraph.begin(); call != callGraph.end(); ++call) {
if (! call->visited) {
newRoot = &(*call);

View file

@ -284,7 +284,7 @@ public:
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) :
language(l),
profile(p), version(v),
treeRoot(0),
treeRoot(nullptr),
resources(TBuiltInResource{}),
numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false),
invertY(false),

View file

@ -198,7 +198,7 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node)
bool TIntermediate::parseConstTree(TIntermNode* root, TConstUnionArray unionArray, TOperator constructorType, const TType& t, bool singleConstantParam)
{
if (root == 0)
if (root == nullptr)
return false;
TConstTraverser it(unionArray, singleConstantParam, constructorType, t);

View file

@ -65,7 +65,7 @@ public:
infoSink(infoSink), version(version),
language(language),
spvVersion(spvVersion),
intermediate(interm), messages(messages), numErrors(0), currentScanner(0) { }
intermediate(interm), messages(messages), numErrors(0), currentScanner(nullptr) { }
virtual ~TParseVersions() { }
void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc);
void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc);

View file

@ -85,7 +85,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace glslang {
TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) :
preamble(0), strings(0), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false),
preamble(nullptr), strings(nullptr), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false),
rootFileName(rootFileName),
currentSourceFile(rootFileName),
disableEscapeSequences(false)

View file

@ -121,7 +121,7 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
if (atom == '#') {
if (peekToken('#')) {
parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)");
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, 0, "token pasting (##)");
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "token pasting (##)");
currentPos++;
atom = PpAtomPaste;
}

View file

@ -423,7 +423,7 @@ getSymbolToDefinitionMappingAndPreciseSymbolIDs(const glslang::TIntermediate& in
ReturnBranchNodeSet());
TIntermNode* root = intermediate.getTreeRoot();
if (root == 0)
if (root == nullptr)
return result_tuple;
NodeMapping& symbol_definition_mapping = std::get<0>(result_tuple);

View file

@ -682,7 +682,7 @@ public:
}
// For a binary operation indexing into an aggregate, chase down the base of the aggregate.
// Return 0 if the topology does not fit this situation.
// Return nullptr if the topology does not fit this situation.
TIntermSymbol* findBase(const TIntermBinary* node)
{
TIntermSymbol *base = node->getLeft()->getAsSymbolNode();