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<std::shared_ptr<FunctionDeclaration>> funcs) | 19 UnresolvedFunction(std::vector<const 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 |
22 for (auto func : funcs) { | 23 for (auto func : funcs) { |
23 ASSERT(func->fName == fName); | 24 ASSERT(func->fName == fName); |
24 } | 25 } |
| 26 #endif |
25 } | 27 } |
26 | 28 |
27 virtual std::string description() const override { | 29 virtual std::string description() const override { |
28 return fName; | 30 return fName; |
29 } | 31 } |
30 | 32 |
31 const std::vector<std::shared_ptr<FunctionDeclaration>> fFunctions; | 33 const std::vector<const FunctionDeclaration*> fFunctions; |
32 | 34 |
33 typedef Symbol INHERITED; | 35 typedef Symbol INHERITED; |
34 }; | 36 }; |
35 | 37 |
36 } // namespace | 38 } // namespace |
37 | 39 |
38 #endif | 40 #endif |
OLD | NEW |