aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ir/SkSLIRNode.h
blob: 20b901d4a7742b8fba65980e78de0bc428c4a177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SKSL_IRNODE
#define SKSL_IRNODE

#include "../SkSLLexer.h"

namespace SkSL {

/**
 * Represents a node in the intermediate representation (IR) tree. The IR is a fully-resolved
 * version of the program (all types determined, everything validated), ready for code generation.
 */
struct IRNode {
    IRNode(int offset)
    : fOffset(offset) {}

    virtual ~IRNode() {}

    virtual String description() const = 0;

    // character offset of this element within the program being compiled, for error reporting
    // purposes
    int fOffset;
};

} // namespace

#endif