#include "rust-compile-asm.h"
#include "rust-system.h"
+#include "rust-compile-expr.h"
namespace Rust {
namespace Compile {
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
// build_asm_expr (location_t loc, tree string, tree outputs, tree inputs,
// tree clobbers, tree labels, bool simple, bool is_inline)
static const int ASM_TREE_ARRAY_LENGTH = 5;
- static tree asm_build_expr (HIR::InlineAsm &);
- static tree asm_build_stmt (location_t,
- const std::array<tree, ASM_TREE_ARRAY_LENGTH> &);
-
- static tree asm_construct_string_tree (HIR::InlineAsm &);
- static tree asm_construct_outputs (HIR::InlineAsm &);
- static tree asm_construct_inputs (HIR::InlineAsm &);
- static tree asm_construct_clobber_tree (HIR::InlineAsm &);
- static tree asm_construct_label_tree (HIR::InlineAsm &);
+ tree asm_build_expr (HIR::InlineAsm &);
+ tree asm_build_stmt (location_t,
+ const std::array<tree, ASM_TREE_ARRAY_LENGTH> &);
+
+ tree asm_construct_string_tree (HIR::InlineAsm &);
+ tree asm_construct_outputs (HIR::InlineAsm &);
+ tree asm_construct_inputs (HIR::InlineAsm &);
+ tree asm_construct_clobber_tree (HIR::InlineAsm &);
+ tree asm_construct_label_tree (HIR::InlineAsm &);
CompileAsm (Context *ctx);