SkSLUnresolvedFunction.h 870 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #ifndef SKSL_UNRESOLVEDFUNCTION
  8. #define SKSL_UNRESOLVEDFUNCTION
  9. #include "src/sksl/ir/SkSLFunctionDeclaration.h"
  10. namespace SkSL {
  11. /**
  12. * A symbol representing multiple functions with the same name.
  13. */
  14. struct UnresolvedFunction : public Symbol {
  15. UnresolvedFunction(std::vector<const FunctionDeclaration*> funcs)
  16. : INHERITED(-1, kUnresolvedFunction_Kind, funcs[0]->fName)
  17. , fFunctions(std::move(funcs)) {
  18. #ifdef DEBUG
  19. for (auto func : funcs) {
  20. SkASSERT(func->fName == fName);
  21. }
  22. #endif
  23. }
  24. String description() const override {
  25. return fName;
  26. }
  27. const std::vector<const FunctionDeclaration*> fFunctions;
  28. typedef Symbol INHERITED;
  29. };
  30. } // namespace
  31. #endif