blob: 19eaf8bd6f95e0c7a4aa6488183a7bf34fb5b5f3 [file] [log] [blame]
/*
* Copyright 2020 Google LLC.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "src/sksl/ir/SkSLIRNode.h"
#include "src/sksl/ir/SkSLExpression.h"
namespace SkSL {
IRNode::IRNode(int offset, int kind, const Type* data)
: fOffset(offset)
, fKind(kind)
, fData(data) {}
IRNode::IRNode(int offset, int kind, TypeTokenData data)
: fOffset(offset)
, fKind(kind)
, fData(data) {}
IRNode::IRNode(const IRNode& other)
: fOffset(other.fOffset)
, fKind(other.fKind)
, fData(other.fData) {
// For now, we can't use a default copy constructor because of the std::unique_ptr children.
// Since we never copy nodes containing children, it's easiest just to assert we don't have any
// than bother with cloning them.
SkASSERT(other.fExpressionChildren.empty());
}
IRNode::~IRNode() {}
} // namespace SkSL