mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-09-01 00:10:30 +00:00
This is a minimal effort to fix up the code. There's substantial code cleanup which can now be done, which is done in the next change. Bug: tint:322 Change-Id: Iafcf5e814837d9534889e8c21333de4931a19cfa Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32864 Commit-Queue: dan sinclair <dsinclair@chromium.org> Reviewed-by: dan sinclair <dsinclair@chromium.org>
54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
// Copyright 2020 The Tint Authors.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#include "src/ast/unary_op_expression.h"
|
|
|
|
namespace tint {
|
|
namespace ast {
|
|
|
|
UnaryOpExpression::UnaryOpExpression() : Expression() {}
|
|
|
|
UnaryOpExpression::UnaryOpExpression(UnaryOp op, Expression* expr)
|
|
: Expression(), op_(op), expr_(expr) {}
|
|
|
|
UnaryOpExpression::UnaryOpExpression(const Source& source,
|
|
UnaryOp op,
|
|
Expression* expr)
|
|
: Expression(source), op_(op), expr_(expr) {}
|
|
|
|
UnaryOpExpression::UnaryOpExpression(UnaryOpExpression&&) = default;
|
|
|
|
UnaryOpExpression::~UnaryOpExpression() = default;
|
|
|
|
bool UnaryOpExpression::IsUnaryOp() const {
|
|
return true;
|
|
}
|
|
|
|
bool UnaryOpExpression::IsValid() const {
|
|
return expr_ != nullptr && expr_->IsValid();
|
|
}
|
|
|
|
void UnaryOpExpression::to_str(std::ostream& out, size_t indent) const {
|
|
make_indent(out, indent);
|
|
out << "UnaryOp[" << result_type_str() << "]{" << std::endl;
|
|
make_indent(out, indent + 2);
|
|
out << op_ << std::endl;
|
|
expr_->to_str(out, indent + 2);
|
|
make_indent(out, indent);
|
|
out << "}" << std::endl;
|
|
}
|
|
|
|
} // namespace ast
|
|
} // namespace tint
|