aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir
diff options
context:
space:
mode:
authorjjasmine <tanghocle456@gmail.com>2024-06-22 11:56:50 -0700
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-19 15:32:05 +0100
commit51f430a4642339af721dbc09af8db39aef8c744c (patch)
tree2da5d1654ea0e5f20d8e1676504b5d9f802223e3 /gcc/rust/hir
parent9996b8ef849cb5626e14d0747dd45f10541807d0 (diff)
downloadgcc-51f430a4642339af721dbc09af8db39aef8c744c.zip
gcc-51f430a4642339af721dbc09af8db39aef8c744c.tar.gz
gcc-51f430a4642339af721dbc09af8db39aef8c744c.tar.bz2
gccrs: Scaffolding asm codegen
gcc/rust/ChangeLog: * backend/rust-compile-block.h: Scaffolding asm codegen * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise. * backend/rust-compile-expr.h: Likewise. * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Likewise. * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Likewise. * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Likewise. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise. * checks/errors/privacy/rust-privacy-reporter.h: Likewise. * hir/tree/rust-hir-expr.h: Likewise. * hir/tree/rust-hir-visitor.h: Likewise. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise. * typecheck/rust-hir-type-check-expr.h: Likewise.
Diffstat (limited to 'gcc/rust/hir')
-rw-r--r--gcc/rust/hir/tree/rust-hir-expr.h10
-rw-r--r--gcc/rust/hir/tree/rust-hir-visitor.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h
index 5d2cdd1..7b2e32e 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -4162,6 +4162,16 @@ public:
options (std::move (options))
{}
+
+ // This function checks if the assembly macro is "simple" or not, according to
+ // the tree defition (tree.h) of the
+ bool is_simple ()
+ {
+ return operands.size () == 0 && clobber_abi.size () == 0
+ && options.size () == 0;
+ }
+
+ bool is_inline_asm () { return !is_global_asm; }
};
} // namespace HIR
} // namespace Rust
diff --git a/gcc/rust/hir/tree/rust-hir-visitor.h b/gcc/rust/hir/tree/rust-hir-visitor.h
index 72609f4..e69e951 100644
--- a/gcc/rust/hir/tree/rust-hir-visitor.h
+++ b/gcc/rust/hir/tree/rust-hir-visitor.h
@@ -450,6 +450,7 @@ public:
virtual void visit (IfExprConseqElse &expr) = 0;
virtual void visit (IfLetExpr &expr) = 0;
virtual void visit (IfLetExprConseqElse &expr) = 0;
+ virtual void visit (InlineAsm &expr) = 0;
virtual void visit (MatchExpr &expr) = 0;
virtual void visit (AwaitExpr &expr) = 0;
virtual void visit (AsyncBlockExpr &expr) = 0;