[COMMITTED 049/144] gccrs: Added counting to check for asm_construct_outputs

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Wed Mar 19 14:43:30 GMT 2025


From: badumbatish <tanghocle456@gmail.com>

gcc/rust/ChangeLog:

	* backend/rust-compile-asm.cc (CompileAsm::asm_construct_outputs):
	Set up counting to check
---
 gcc/rust/backend/rust-compile-asm.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/rust/backend/rust-compile-asm.cc b/gcc/rust/backend/rust-compile-asm.cc
index 0dd4f672008..9305a9088bb 100644
--- a/gcc/rust/backend/rust-compile-asm.cc
+++ b/gcc/rust/backend/rust-compile-asm.cc
@@ -96,6 +96,13 @@ tree
 CompileAsm::asm_construct_outputs (HIR::InlineAsm &expr)
 {
   // TODO: Do i need to do this?
+  int count = 0;
+
+  for (auto &output : expr.get_operands ())
+    {
+      if (output.register_type == AST::InlineAsmOperand::RegisterType::Out)
+	count++;
+    }
   return NULL_TREE;
 }
 
-- 
2.45.2



More information about the Gcc-rust mailing list