| 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 #ifndef SKSL_UNRESOLVEDFUNCTION | 8 #ifndef SKSL_UNRESOLVEDFUNCTION |
| 9 #define SKSL_UNRESOLVEDFUNCTION | 9 #define SKSL_UNRESOLVEDFUNCTION |
| 10 | 10 |
| 11 #include "SkSLFunctionDeclaration.h" | 11 #include "SkSLFunctionDeclaration.h" |
| 12 | 12 |
| 13 namespace SkSL { | 13 namespace SkSL { |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * A symbol representing multiple functions with the same name. | 16 * A symbol representing multiple functions with the same name. |
| 17 */ | 17 */ |
| 18 struct UnresolvedFunction : public Symbol { | 18 struct UnresolvedFunction : public Symbol { |
| 19 UnresolvedFunction(std::vector<const FunctionDeclaration*> funcs) | 19 UnresolvedFunction(std::vector<std::shared_ptr<FunctionDeclaration>> funcs) |
| 20 : INHERITED(Position(), kUnresolvedFunction_Kind, funcs[0]->fName) | 20 : INHERITED(Position(), kUnresolvedFunction_Kind, funcs[0]->fName) |
| 21 , fFunctions(std::move(funcs)) { | 21 , fFunctions(std::move(funcs)) { |
| 22 #ifdef DEBUG | |
| 23 for (auto func : funcs) { | 22 for (auto func : funcs) { |
| 24 ASSERT(func->fName == fName); | 23 ASSERT(func->fName == fName); |
| 25 } | 24 } |
| 26 #endif | |
| 27 } | 25 } |
| 28 | 26 |
| 29 virtual std::string description() const override { | 27 virtual std::string description() const override { |
| 30 return fName; | 28 return fName; |
| 31 } | 29 } |
| 32 | 30 |
| 33 const std::vector<const FunctionDeclaration*> fFunctions; | 31 const std::vector<std::shared_ptr<FunctionDeclaration>> fFunctions; |
| 34 | 32 |
| 35 typedef Symbol INHERITED; | 33 typedef Symbol INHERITED; |
| 36 }; | 34 }; |
| 37 | 35 |
| 38 } // namespace | 36 } // namespace |
| 39 | 37 |
| 40 #endif | 38 #endif |
| OLD | NEW |