OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkSLIRGenerator.h" | 8 #include "SkSLIRGenerator.h" |
9 | 9 |
10 #include "limits.h" | 10 #include "limits.h" |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 std::shared_ptr<SymbolTable> old = fSymbolTable; | 480 std::shared_ptr<SymbolTable> old = fSymbolTable; |
481 AutoSymbolTable table(this); | 481 AutoSymbolTable table(this); |
482 Modifiers mods = this->convertModifiers(intf.fModifiers); | 482 Modifiers mods = this->convertModifiers(intf.fModifiers); |
483 std::vector<Type::Field> fields; | 483 std::vector<Type::Field> fields; |
484 for (size_t i = 0; i < intf.fDeclarations.size(); i++) { | 484 for (size_t i = 0; i < intf.fDeclarations.size(); i++) { |
485 std::unique_ptr<VarDeclaration> decl = this->convertVarDeclaration( | 485 std::unique_ptr<VarDeclaration> decl = this->convertVarDeclaration( |
486 *intf.f
Declarations[i], | 486 *intf.f
Declarations[i], |
487 Variabl
e::kGlobal_Storage); | 487 Variabl
e::kGlobal_Storage); |
488 for (size_t j = 0; j < decl->fVars.size(); j++) { | 488 for (size_t j = 0; j < decl->fVars.size(); j++) { |
489 fields.push_back(Type::Field(decl->fVars[j]->fModifiers, decl->fVars
[j]->fName, | 489 fields.push_back(Type::Field(decl->fVars[j]->fModifiers, decl->fVars
[j]->fName, |
490 decl->fVars[j]->fType)); | 490 &decl->fVars[j]->fType)); |
491 if (decl->fValues[j]) { | 491 if (decl->fValues[j]) { |
492 fErrors.error(decl->fPosition, | 492 fErrors.error(decl->fPosition, |
493 "initializers are not permitted on interface block
fields"); | 493 "initializers are not permitted on interface block
fields"); |
494 } | 494 } |
495 if (decl->fVars[j]->fModifiers.fFlags & (Modifiers::kIn_Flag | | 495 if (decl->fVars[j]->fModifiers.fFlags & (Modifiers::kIn_Flag | |
496 Modifiers::kOut_Flag | | 496 Modifiers::kOut_Flag | |
497 Modifiers::kUniform_Flag | | 497 Modifiers::kUniform_Flag | |
498 Modifiers::kConst_Flag)) { | 498 Modifiers::kConst_Flag)) { |
499 fErrors.error(decl->fPosition, | 499 fErrors.error(decl->fPosition, |
500 "interface block fields may not have storage quali
fiers"); | 500 "interface block fields may not have storage quali
fiers"); |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 case Expression::kIndex_Kind: | 1258 case Expression::kIndex_Kind: |
1259 this->markWrittenTo(*((IndexExpression&) expr).fBase); | 1259 this->markWrittenTo(*((IndexExpression&) expr).fBase); |
1260 break; | 1260 break; |
1261 default: | 1261 default: |
1262 fErrors.error(expr.fPosition, "cannot assign to '" + expr.descriptio
n() + "'"); | 1262 fErrors.error(expr.fPosition, "cannot assign to '" + expr.descriptio
n() + "'"); |
1263 break; | 1263 break; |
1264 } | 1264 } |
1265 } | 1265 } |
1266 | 1266 |
1267 } | 1267 } |
OLD | NEW |