Fix compilation issues with MSVC 2010

(mostly by eliminating use of range-based for loops and std::tie)
This commit is contained in:
rdb
2016-02-23 22:17:38 +01:00
parent 0967748fbc
commit 32084e889d
8 changed files with 28 additions and 28 deletions

View File

@@ -688,8 +688,8 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
void TGlslangToSpvTraverser::dumpSpv(std::vector<unsigned int>& out)
{
// finish off the entry-point SPV instruction by adding the Input/Output <id>
for (auto it : iOSet)
entryPoint->addIdOperand(it);
for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it)
entryPoint->addIdOperand(*it);
builder.dump(out);
}

View File

@@ -91,8 +91,9 @@ public:
delayed_[continueBlock] = true;
}
}
for (const auto succ : block->getSuccessors())
visit(succ);
const auto successors = block->getSuccessors();
for (auto it = successors.cbegin(); it != successors.cend(); ++it)
visit(*it);
if (continueBlock) {
delayed_[continueBlock] = false;
visit(continueBlock);

View File

@@ -1141,8 +1141,8 @@ void Builder::createNoResultOp(Op opCode, Id operand)
void Builder::createNoResultOp(Op opCode, const std::vector<Id>& operands)
{
Instruction* op = new Instruction(opCode);
for (auto operand : operands)
op->addIdOperand(operand);
for (auto it = operands.cbegin(); it != operands.cend(); ++it)
op->addIdOperand(*it);
buildPoint->addInstruction(std::unique_ptr<Instruction>(op));
}
@@ -1197,8 +1197,8 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3)
Id Builder::createOp(Op opCode, Id typeId, const std::vector<Id>& operands)
{
Instruction* op = new Instruction(getUniqueId(), typeId, opCode);
for (auto operand : operands)
op->addIdOperand(operand);
for (auto it = operands.cbegin(); it != operands.cend(); ++it)
op->addIdOperand(*it);
buildPoint->addInstruction(std::unique_ptr<Instruction>(op));
return op->getResultId();
@@ -2106,9 +2106,9 @@ Id Builder::accessChainGetInferredType()
type = getContainedTypeId(type);
// dereference each index
for (auto deref : accessChain.indexChain) {
for (auto it = accessChain.indexChain.cbegin(); it != accessChain.indexChain.cend(); ++it) {
if (isStructType(type))
type = getContainedTypeId(type, getConstantScalar(deref));
type = getContainedTypeId(type, getConstantScalar(*it));
else
type = getContainedTypeId(type);
}
@@ -2136,9 +2136,9 @@ void Builder::dump(std::vector<unsigned int>& out) const
out.push_back(0);
// Capabilities
for (auto cap : capabilities) {
for (auto it = capabilities.cbegin(); it != capabilities.cend(); ++it) {
Instruction capInst(0, 0, OpCapability);
capInst.addImmediateOperand(cap);
capInst.addImmediateOperand(*it);
capInst.dump(out);
}