• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "SkSLFunctionDeclaration.h"
12 
13 namespace SkSL {
14 
15 /**
16  * A symbol representing multiple functions with the same name.
17  */
18 struct UnresolvedFunction : public Symbol {
UnresolvedFunctionUnresolvedFunction19     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 
descriptionUnresolvedFunction29     String description() const override {
30         return fName;
31     }
32 
33     const std::vector<const FunctionDeclaration*> fFunctions;
34 
35     typedef Symbol INHERITED;
36 };
37 
38 } // namespace
39 
40 #endif
41