diff options
author | badumbatish <tanghocle456@gmail.com> | 2024-07-29 21:59:13 -0700 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2024-09-02 09:44:55 +0000 |
commit | c00fd2aeaaedbf90c0f7d828a19ffb8a89e93657 (patch) | |
tree | 81c3f7136cecd3e9e56344d44aae8652e79e78e0 /gcc/rust/backend/rust-compile-asm.cc | |
parent | 596bf6946d85bf9b41d1b5479e661111750927a3 (diff) | |
download | gcc-c00fd2aeaaedbf90c0f7d828a19ffb8a89e93657.zip gcc-c00fd2aeaaedbf90c0f7d828a19ffb8a89e93657.tar.gz gcc-c00fd2aeaaedbf90c0f7d828a19ffb8a89e93657.tar.bz2 |
Lower the HIR to tree with CompileExpr
gcc/rust/ChangeLog:
* backend/rust-compile-asm.cc (CompileAsm::asm_construct_outputs):
Lower the HIR to tree with CompileExpr
* backend/rust-compile-asm.h: Remove static from method
Diffstat (limited to 'gcc/rust/backend/rust-compile-asm.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-asm.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/rust/backend/rust-compile-asm.cc b/gcc/rust/backend/rust-compile-asm.cc index 4086088..2b32c99 100644 --- a/gcc/rust/backend/rust-compile-asm.cc +++ b/gcc/rust/backend/rust-compile-asm.cc @@ -1,5 +1,6 @@ #include "rust-compile-asm.h" #include "rust-system.h" +#include "rust-compile-expr.h" namespace Rust { namespace Compile { @@ -82,14 +83,20 @@ tree CompileAsm::asm_construct_outputs (HIR::InlineAsm &expr) { // TODO: Do i need to do this? - int count = 0; + tree head = NULL_TREE; for (auto &output : expr.get_operands ()) { - if (output.register_type == AST::InlineAsmOperand::RegisterType::Out) - count++; + if (output.get_register_type () + == AST::InlineAsmOperand::RegisterType::Out) + { + auto out = output.get_out (); + tree out_tree = CompileExpr::Compile (out.expr.get (), this->ctx); + Backend::debug (out_tree); + /*head = chainon (head, out_tree);*/ + } } - return NULL_TREE; + return head; } tree |