From affa6a3da87e9ea85f1d4fe3137b5bccbbc56f92 Mon Sep 17 00:00:00 2001 From: Ethan Nicholas Date: Fri, 2 Jun 2017 13:52:38 +0000 Subject: Revert "Fixed an issue with sksl variable declarations" This reverts commit 88bd8edcff23dc9cf31b664cba7ba73b235318b0. Reason for revert: unhappy bots Original change's description: > Fixed an issue with sksl variable declarations > > There was an issue where multiple variables defined in the same > declaration were not being sequenced appropriately during analysis, so > 'int x = 0, y = x + 1' would report that x was undefined. > > Bug: skia: > Change-Id: I882f7e216467306f6a6013a0a34aac30a4c60744 > Reviewed-on: https://skia-review.googlesource.com/18313 > Reviewed-by: Chris Dalton > Commit-Queue: Ethan Nicholas > TBR=csmartdalton@google.com,ethannicholas@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Change-Id: Ibc68674289dce70b6173a347a0e78bb0f1e6db1b Reviewed-on: https://skia-review.googlesource.com/18457 Commit-Queue: Greg Daniel Reviewed-by: Ethan Nicholas --- src/sksl/SkSLIRGenerator.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/sksl/SkSLIRGenerator.cpp') diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp index f85ea1054d..2e280d8702 100644 --- a/src/sksl/SkSLIRGenerator.cpp +++ b/src/sksl/SkSLIRGenerator.cpp @@ -614,20 +614,19 @@ std::unique_ptr IRGenerator::convertInterfaceBlock(const ASTInte if (!decl) { return nullptr; } - for (const auto& stmt : decl->fVars) { - VarDeclaration& vd = (VarDeclaration&) *stmt; + for (const auto& var : decl->fVars) { if (haveRuntimeArray) { fErrors.error(decl->fPosition, "only the last entry in an interface block may be a runtime-sized " "array"); } - fields.push_back(Type::Field(vd.fVar->fModifiers, vd.fVar->fName, - &vd.fVar->fType)); - if (vd.fValue) { + fields.push_back(Type::Field(var->fVar->fModifiers, var->fVar->fName, + &var->fVar->fType)); + if (var->fValue) { fErrors.error(decl->fPosition, "initializers are not permitted on interface block fields"); } - if (vd.fVar->fModifiers.fFlags & (Modifiers::kIn_Flag | + if (var->fVar->fModifiers.fFlags & (Modifiers::kIn_Flag | Modifiers::kOut_Flag | Modifiers::kUniform_Flag | Modifiers::kBuffer_Flag | @@ -635,8 +634,8 @@ std::unique_ptr IRGenerator::convertInterfaceBlock(const ASTInte fErrors.error(decl->fPosition, "interface block fields may not have storage qualifiers"); } - if (vd.fVar->fType.kind() == Type::kArray_Kind && - vd.fVar->fType.columns() == -1) { + if (var->fVar->fType.kind() == Type::kArray_Kind && + var->fVar->fType.columns() == -1) { haveRuntimeArray = true; } } -- cgit v1.2.3