1 | /* |
---|---|
2 | * Copyright 2016 Google Inc. |
3 | * |
4 | * Use of this source code is governed by a BSD-style license that can be |
5 | * found in the LICENSE file. |
6 | */ |
7 | |
8 | #ifndef SKSL_UNRESOLVEDFUNCTION |
9 | #define SKSL_UNRESOLVEDFUNCTION |
10 | |
11 | #include "src/sksl/ir/SkSLFunctionDeclaration.h" |
12 | |
13 | namespace SkSL { |
14 | |
15 | /** |
16 | * A symbol representing multiple functions with the same name. |
17 | */ |
18 | struct UnresolvedFunction : public Symbol { |
19 | UnresolvedFunction(std::vector<const FunctionDeclaration*> funcs) |
20 | : INHERITED(-1, kUnresolvedFunction_Kind, funcs[0]->fName) |
21 | , fFunctions(std::move(funcs)) { |
22 | #ifdef DEBUG |
23 | for (auto func : funcs) { |
24 | SkASSERT(func->fName == fName); |
25 | } |
26 | #endif |
27 | } |
28 | |
29 | #ifdef SK_DEBUG |
30 | String description() const override { |
31 | return fName; |
32 | } |
33 | #endif |
34 | |
35 | const std::vector<const FunctionDeclaration*> fFunctions; |
36 | |
37 | typedef Symbol INHERITED; |
38 | }; |
39 | |
40 | } // namespace |
41 | |
42 | #endif |
43 |