]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use's array type when constring string tree
authorbadumbatish <tanghocle456@gmail.com>
Thu, 8 Aug 2024 21:22:05 +0000 (14:22 -0700)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 2 Sep 2024 09:44:55 +0000 (09:44 +0000)
gcc/rust/ChangeLog:

* backend/rust-compile-asm.cc (CompileAsm::asm_build_expr):
Use's array type when constring string tree
(CompileAsm::asm_construct_string_tree):
Use's array type when constring string tree

gcc/rust/backend/rust-compile-asm.cc

index bce49ead28f7f30d902a5067bc584df850c69c46..4e0124740b4723b096fe77c831bcfebab5372abb 100644 (file)
@@ -26,7 +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);*/
+  Backend::debug (asm_expr);
   return asm_expr;
 }
 
@@ -74,10 +74,10 @@ CompileAsm::asm_construct_string_tree (HIR::InlineAsm &expr)
   // debugging and reading)
   std::stringstream ss;
   for (const auto &template_str : expr.template_strs)
-    ss << template_str.symbol << "\n\t";
+    ss << template_str.symbol << "\n";
 
   std::string result = ss.str ();
-  return build_string (result.size () + 1, result.c_str ());
+  return Backend::string_constant_expression (result);
 }
 
 tree