aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-05-11 16:13:41 +0200
committerCohenArthur <arthur.cohen@embecosm.com>2023-05-18 20:39:00 +0000
commit4ddb7d143bc30fe65b29954ff8c911f7ed38b6fb (patch)
tree8e7b1df53597a373ddc68bb7f963fdaba84576b0 /gcc
parentcc661d8a33eb3612e7ce33528faf787409bee758 (diff)
downloadgcc-4ddb7d143bc30fe65b29954ff8c911f7ed38b6fb.zip
gcc-4ddb7d143bc30fe65b29954ff8c911f7ed38b6fb.tar.gz
gcc-4ddb7d143bc30fe65b29954ff8c911f7ed38b6fb.tar.bz2
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>
Diffstat (limited to 'gcc')
-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")