]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ast: Propagate type suffix
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 11 May 2023 14:13:41 +0000 (16:13 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:37:20 +0000 (18:37 +0100)
Propagate back type suffix to created tokens.

gcc/rust/ChangeLog:

* ast/rust-ast-collector.cc (TokenCollector::visit): Propagate
coretype hint.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-collector.cc

index 45a76094499097deb5d4be5fa618220ff14a3773..a09869b7e6dde55d26110c648f50cdd60ceb1a77 100644 (file)
@@ -809,10 +809,12 @@ TokenCollector::visit (Literal &lit, Location locus)
        Rust::Token::make_byte_string (locus, std::move (value)));
       break;
     case Literal::LitType::INT:
-      tokens.push_back (Rust::Token::make_int (locus, std::move (value)));
+      tokens.push_back (
+       Rust::Token::make_int (locus, std::move (value), lit.get_type_hint ()));
       break;
     case Literal::LitType::FLOAT:
-      tokens.push_back (Rust::Token::make_float (locus, std::move (value)));
+      tokens.push_back (Rust::Token::make_float (locus, std::move (value),
+                                                lit.get_type_hint ()));
       break;
       case Literal::LitType::BOOL: {
        if (value == "false")