aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-05-11 16:13:41 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:37:20 +0100
commitde8eed9b8efea12d5b7987206e8e9fb0109966ca (patch)
tree3baa3d82801cf6eb383099c0cd6dd2efeae16e2d
parent4a71a18da8a1ea731ad69c34771bd6ee1085cc64 (diff)
downloadgcc-de8eed9b8efea12d5b7987206e8e9fb0109966ca.zip
gcc-de8eed9b8efea12d5b7987206e8e9fb0109966ca.tar.gz
gcc-de8eed9b8efea12d5b7987206e8e9fb0109966ca.tar.bz2
gccrs: ast: Propagate type suffix
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>
-rw-r--r--gcc/rust/ast/rust-ast-collector.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc
index 45a7609..a09869b 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -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")