[033/125] gccrs: format-args: Add documentation for future expansion of function

Message ID 20240801145809.366388-35-arthur.cohen@embecosm.com
State Committed
Commit 3f4374ccfaad01cfbe8c37ea8c41cce403e070f9
Headers
Series [001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work |

Commit Message

Arthur Cohen Aug. 1, 2024, 2:56 p.m. UTC
  gcc/rust/ChangeLog:

	* expand/rust-macro-builtins.cc (MacroBuiltin::format_args_handler): Add
	documentation regarding future tasks.
---
 gcc/rust/expand/rust-macro-builtins.cc | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)
  

Patch

diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index b42d1ec9367..e4ca0d8ba3b 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -1052,23 +1052,7 @@  MacroBuiltin::format_args_handler (location_t invoc_locus,
 {
   auto input = format_args_parse_arguments (invoc);
 
-  // auto fmt_arg
-  //   // FIXME: this eneds to be split up into a smaller function
-  //   = parse_single_string_literal (append_newline ?
-  //   BuiltinMacro::FormatArgsNl
-  // 				  : BuiltinMacro::FormatArgs,
-  // 		   invoc.get_delim_tok_tree (), invoc_locus,
-  // 		   invoc.get_expander ());
-
-  //  if (!fmt_arg->is_literal ())
-  //    {
-  //      rust_sorry_at (
-  // invoc_locus,
-  // "cannot yet use eager macro invocations as format strings");
-  //      return AST::Fragment::create_empty ();
-  //    }
-
-  // FIXME: We need to handle this
+  // TODO(Arthur): We need to handle this
   // // if it is not a literal, it's an eager macro invocation - return it
   // if (!fmt_expr->is_literal ())
   //   {
@@ -1077,10 +1061,10 @@  MacroBuiltin::format_args_handler (location_t invoc_locus,
   // 	    token_tree.to_token_stream ());
   //   }
 
-  // auto fmt_str = static_cast<AST::LiteralExpr &> (*fmt_arg.get ());
-
-  // Switch on the format string to know if the string is raw or cooked
-  // switch (fmt_str.get_lit_type ())
+  // TODO(Arthur): Handle this as well - raw strings are special for the
+  // format_args parser auto fmt_str = static_cast<AST::LiteralExpr &>
+  // (*fmt_arg.get ()); Switch on the format string to know if the string is raw
+  // or cooked switch (fmt_str.get_lit_type ())
   //   {
   //   // case AST::Literal::RAW_STRING:
   //   case AST::Literal::STRING: