Non-functional: Rename some entry-point variables to entryPoint, not main.
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp
index fc269e9..7abd04d 100755
--- a/SPIRV/GlslangToSpv.cpp
+++ b/SPIRV/GlslangToSpv.cpp
@@ -182,8 +182,8 @@
// There is a 1:1 mapping between a spv builder and a module; this is thread safe
spv::Builder builder;
- bool inMain;
- bool mainTerminated;
+ bool inEntryPoint;
+ bool entryPointTerminated;
bool linkageOnly; // true when visiting the set of objects in the AST present only for establishing interface, whether or not they were statically used
std::set<spv::Id> iOSet; // all input/output variables from either static use or declaration of interface
const glslang::TIntermediate* glslangIntermediate;
@@ -769,7 +769,7 @@
: TIntermTraverser(true, false, true), shaderEntry(nullptr), currentFunction(nullptr),
sequenceDepth(0), logger(buildLogger),
builder((glslang::GetKhronosToolId() << 16) | GeneratorVersion, logger),
- inMain(false), mainTerminated(false), linkageOnly(false),
+ inEntryPoint(false), entryPointTerminated(false), linkageOnly(false),
glslangIntermediate(glslangIntermediate)
{
spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage());
@@ -902,7 +902,7 @@
// Finish creating SPV, after the traversal is complete.
void TGlslangToSpvTraverser::finishSpv()
{
- if (! mainTerminated) {
+ if (! entryPointTerminated) {
builder.setBuildPoint(shaderEntry->getLastBlock());
builder.leaveFunction();
}
@@ -1383,17 +1383,17 @@
case glslang::EOpFunction:
if (visit == glslang::EvPreVisit) {
if (isShaderEntryPoint(node)) {
- inMain = true;
+ inEntryPoint = true;
builder.setBuildPoint(shaderEntry->getLastBlock());
currentFunction = shaderEntry;
} else {
handleFunctionEntry(node);
}
} else {
- if (inMain)
- mainTerminated = true;
+ if (inEntryPoint)
+ entryPointTerminated = true;
builder.leaveFunction();
- inMain = false;
+ inEntryPoint = false;
}
return true;
diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp
index 4703edc..04b0f04 100644
--- a/SPIRV/SpvBuilder.cpp
+++ b/SPIRV/SpvBuilder.cpp
@@ -64,7 +64,7 @@
builderNumber(magicNumber),
buildPoint(0),
uniqueId(0),
- mainFunction(0),
+ entryPointFunction(0),
generatingOpCodeForSpecConst(false),
logger(buildLogger)
{
@@ -967,15 +967,15 @@
// Comments in header
Function* Builder::makeEntryPoint(const char* entryPoint)
{
- assert(! mainFunction);
+ assert(! entryPointFunction);
Block* entry;
std::vector<Id> params;
std::vector<Decoration> precisions;
- mainFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, precisions, &entry);
+ entryPointFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, precisions, &entry);
- return mainFunction;
+ return entryPointFunction;
}
// Comments in header
diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h
index 0e8d9ca..e8524b2 100755
--- a/SPIRV/SpvBuilder.h
+++ b/SPIRV/SpvBuilder.h
@@ -564,7 +564,7 @@
Module module;
Block* buildPoint;
Id uniqueId;
- Function* mainFunction;
+ Function* entryPointFunction;
bool generatingOpCodeForSpecConst;
AccessChain accessChain;