aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbadumbatish <tanghocle456@gmail.com>2024-08-01 16:22:32 -0700
committerCohenArthur <arthur.cohen@embecosm.com>2024-09-02 09:44:55 +0000
commit20db1716d9803f5b2288b2ff32807f152a128630 (patch)
tree5b85344e915b40c4d086202b2f9c2530571962b6
parent43d38bbb18846e8993860bfac951f655266e150f (diff)
downloadgcc-20db1716d9803f5b2288b2ff32807f152a128630.zip
gcc-20db1716d9803f5b2288b2ff32807f152a128630.tar.gz
gcc-20db1716d9803f5b2288b2ff32807f152a128630.tar.bz2
Perform lowering hir output operand to tree
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr): Add debug comment (CompileAsm::asm_construct_outputs): Perform lowering hir output operand to tree
-rw-r--r--gcc/rust/backend/rust-compile-asm.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-compile-asm.cc b/gcc/rust/backend/rust-compile-asm.cc
index 2b32c99..bce49ea 100644
--- a/gcc/rust/backend/rust-compile-asm.cc
+++ b/gcc/rust/backend/rust-compile-asm.cc
@@ -26,6 +26,7 @@ CompileAsm::asm_build_expr (HIR::InlineAsm &expr)
ASM_INPUT_P (asm_expr) = expr.is_simple_asm ();
ASM_VOLATILE_P (asm_expr) = false;
ASM_INLINE_P (asm_expr) = expr.is_inline_asm ();
+ /*Backend::debug (asm_expr);*/
return asm_expr;
}
@@ -91,8 +92,17 @@ CompileAsm::asm_construct_outputs (HIR::InlineAsm &expr)
== AST::InlineAsmOperand::RegisterType::Out)
{
auto out = output.get_out ();
+
tree out_tree = CompileExpr::Compile (out.expr.get (), this->ctx);
- Backend::debug (out_tree);
+ // expects a tree list
+ // TODO: This assumes that the output is a register
+ std::string expr_name = "=r";
+ auto name = build_string (expr_name.size () + 1, expr_name.c_str ());
+ head
+ = chainon (head, build_tree_list (build_tree_list (NULL_TREE, name),
+ out_tree));
+
+ /*Backend::debug (head);*/
/*head = chainon (head, out_tree);*/
}
}