Flutter Engine
The Flutter Engine
SkSLFunctionPrototype.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google LLC
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_FUNCTIONPROTOTYPE
9#define SKSL_FUNCTIONPROTOTYPE
10
14
15namespace SkSL {
16
17/**
18 * A function prototype (a function declaration as a top-level program element)
19 */
20class FunctionPrototype final : public ProgramElement {
21public:
22 inline static constexpr Kind kIRNodeKind = Kind::kFunctionPrototype;
23
26 , fDeclaration(declaration)
27 , fBuiltin(builtin) {}
28
30 return *fDeclaration;
31 }
32
33 bool isBuiltin() const {
34 return fBuiltin;
35 }
36
37 std::string description() const override {
38 return this->declaration().description() + ";";
39 }
40
41private:
42 const FunctionDeclaration* fDeclaration;
43 bool fBuiltin;
44
45 using INHERITED = ProgramElement;
46};
47
48} // namespace SkSL
49
50#endif
SkPoint pos
std::string description() const override
const FunctionDeclaration & declaration() const
std::string description() const override
static constexpr Kind kIRNodeKind
FunctionPrototype(Position pos, const FunctionDeclaration *declaration, bool builtin)
ProgramElement(Position pos, Kind kind)
ProgramElementKind
Definition: SkSLIRNode.h:19