Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: src/sksl/ir/SkSLSymbolTable.cpp

Issue 2437063002: re-re-land of skslc now automatically turns on derivatives support (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/sksl/ir/SkSLSymbolTable.h ('k') | tests/SkSLGLSLTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkSLSymbolTable.h" 8 #include "SkSLSymbolTable.h"
9 #include "SkSLUnresolvedFunction.h" 9 #include "SkSLUnresolvedFunction.h"
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 functions.push_back((const FunctionDeclaration*) symbol); 90 functions.push_back((const FunctionDeclaration*) symbol);
91 UnresolvedFunction* u = new UnresolvedFunction(std::move(functions)) ; 91 UnresolvedFunction* u = new UnresolvedFunction(std::move(functions)) ;
92 fSymbols[name] = u; 92 fSymbols[name] = u;
93 this->takeOwnership(u); 93 this->takeOwnership(u);
94 } 94 }
95 } else { 95 } else {
96 fErrorReporter.error(symbol->fPosition, "symbol '" + name + "' was alrea dy defined"); 96 fErrorReporter.error(symbol->fPosition, "symbol '" + name + "' was alrea dy defined");
97 } 97 }
98 } 98 }
99 99
100
101 void SymbolTable::markAllFunctionsBuiltin() {
102 for (const auto& pair : fSymbols) {
103 switch (pair.second->fKind) {
104 case Symbol::kFunctionDeclaration_Kind:
105 ((FunctionDeclaration&) *pair.second).fBuiltin = true;
106 break;
107 case Symbol::kUnresolvedFunction_Kind:
108 for (auto& f : ((UnresolvedFunction&) *pair.second).fFunctions) {
109 ((FunctionDeclaration*) f)->fBuiltin = true;
110 }
111 break;
112 default:
113 break;
114 }
115 }
116 }
117
100 } // namespace 118 } // namespace
OLDNEW
« no previous file with comments | « src/sksl/ir/SkSLSymbolTable.h ('k') | tests/SkSLGLSLTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698