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