aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-stmt.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-03-29 09:01:23 -0700
committerIan Lance Taylor <iant@golang.org>2023-03-29 09:01:23 -0700
commit6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced (patch)
tree1deecdcfbf185c7044bc861d0ace51285c96cb62 /gcc/rust/backend/rust-compile-stmt.h
parent795cffe109e28b248a54b8ee583cbae48368c2a7 (diff)
parentaa8f4242efc99f24de73c59d53996f28db28c13f (diff)
downloadgcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.zip
gcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.tar.gz
gcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.tar.bz2
Merge from trunk revision aa8f4242efc99f24de73c59d53996f28db28c13f.
Diffstat (limited to 'gcc/rust/backend/rust-compile-stmt.h')
-rw-r--r--gcc/rust/backend/rust-compile-stmt.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-stmt.h b/gcc/rust/backend/rust-compile-stmt.h
new file mode 100644
index 0000000..1f06d54
--- /dev/null
+++ b/gcc/rust/backend/rust-compile-stmt.h
@@ -0,0 +1,69 @@
+// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_COMPILE_STMT
+#define RUST_COMPILE_STMT
+
+#include "rust-compile-base.h"
+
+namespace Rust {
+namespace Compile {
+
+class CompileStmt : private HIRCompileBase, protected HIR::HIRStmtVisitor
+{
+public:
+ static tree Compile (HIR::Stmt *stmt, Context *ctx);
+
+ void visit (HIR::ExprStmtWithBlock &stmt) override;
+ void visit (HIR::ExprStmtWithoutBlock &stmt) override;
+ void visit (HIR::LetStmt &stmt) override;
+
+ // Empty visit for unused Stmt HIR nodes.
+ void visit (HIR::TupleStruct &) override {}
+ void visit (HIR::EnumItem &) override {}
+ void visit (HIR::EnumItemTuple &) override {}
+ void visit (HIR::EnumItemStruct &) override {}
+ void visit (HIR::EnumItemDiscriminant &) override {}
+ void visit (HIR::TypePathSegmentFunction &) override {}
+ void visit (HIR::TypePath &) override {}
+ void visit (HIR::QualifiedPathInType &) override {}
+ void visit (HIR::Module &) override {}
+ void visit (HIR::ExternCrate &) override {}
+ void visit (HIR::UseDeclaration &) override {}
+ void visit (HIR::Function &) override {}
+ void visit (HIR::TypeAlias &) override {}
+ void visit (HIR::StructStruct &) override {}
+ void visit (HIR::Enum &) override {}
+ void visit (HIR::Union &) override {}
+ void visit (HIR::ConstantItem &) override {}
+ void visit (HIR::StaticItem &) override {}
+ void visit (HIR::Trait &) override {}
+ void visit (HIR::ImplBlock &) override {}
+ void visit (HIR::ExternBlock &) override {}
+ void visit (HIR::EmptyStmt &) override {}
+
+private:
+ CompileStmt (Context *ctx);
+
+ tree translated;
+};
+
+} // namespace Compile
+} // namespace Rust
+
+#endif // RUST_COMPILE_STMT