blob: 7e8a3601e86f188fa1dfb0f78666867146ab5797 [file] [log] [blame]
ethannicholasb3058bd2016-07-01 08:22:01 -07001/*
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
13namespace SkSL {
14
15/**
16 * A symbol representing multiple functions with the same name.
17 */
18struct UnresolvedFunction : public Symbol {
ethannicholasd598f792016-07-25 10:08:54 -070019 UnresolvedFunction(std::vector<const FunctionDeclaration*> funcs)
ethannicholasb3058bd2016-07-01 08:22:01 -070020 : INHERITED(Position(), kUnresolvedFunction_Kind, funcs[0]->fName)
21 , fFunctions(std::move(funcs)) {
ethannicholasd598f792016-07-25 10:08:54 -070022#ifdef DEBUG
ethannicholasf789b382016-08-03 12:43:36 -070023 for (auto func : funcs) {
24 ASSERT(func->fName == fName);
25 }
ethannicholasd598f792016-07-25 10:08:54 -070026#endif
ethannicholasb3058bd2016-07-01 08:22:01 -070027 }
28
Greg Daniel792d0f12016-11-20 14:53:35 +000029 virtual std::string description() const override {
ethannicholasb3058bd2016-07-01 08:22:01 -070030 return fName;
31 }
32
ethannicholasd598f792016-07-25 10:08:54 -070033 const std::vector<const FunctionDeclaration*> fFunctions;
ethannicholasb3058bd2016-07-01 08:22:01 -070034
35 typedef Symbol INHERITED;
36};
37
38} // namespace
39
40#endif