aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-01-05 17:49:01 +0000
committerPhilip Herron <herron.philip@googlemail.com>2021-01-06 10:13:39 +0000
commit1a97dbc6b54cd77ba7c3f00cb8dd2e870017a83c (patch)
tree8fc0819dcb268ce0a36e63d4947563aca056529b /gcc/rust/backend
parent4d590e5d210492444c4a2b69282970d683cf7c8d (diff)
downloadgcc-1a97dbc6b54cd77ba7c3f00cb8dd2e870017a83c.zip
gcc-1a97dbc6b54cd77ba7c3f00cb8dd2e870017a83c.tar.gz
gcc-1a97dbc6b54cd77ba7c3f00cb8dd2e870017a83c.tar.bz2
Examine the Suffix hint on integers to apply apropriate TyTy type.
This change propagates the PrimitiveCoreType to AST and HIR so the suffix can be examined.
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r--gcc/rust/backend/rust-compile-tyty.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-tyty.h b/gcc/rust/backend/rust-compile-tyty.h
index 66d2472..f4e467a 100644
--- a/gcc/rust/backend/rust-compile-tyty.h
+++ b/gcc/rust/backend/rust-compile-tyty.h
@@ -111,6 +111,18 @@ public:
= backend->named_type ("i32", backend->integer_type (false, 32),
Linemap::predeclared_location ());
return;
+
+ case TyTy::IntType::I64:
+ translated
+ = backend->named_type ("i64", backend->integer_type (false, 64),
+ Linemap::predeclared_location ());
+ return;
+
+ case TyTy::IntType::I128:
+ translated
+ = backend->named_type ("i128", backend->integer_type (false, 128),
+ Linemap::predeclared_location ());
+ return;
}
gcc_unreachable ();
}
@@ -135,6 +147,18 @@ public:
= backend->named_type ("i32", backend->integer_type (true, 32),
Linemap::predeclared_location ());
return;
+
+ case TyTy::UintType::U64:
+ translated
+ = backend->named_type ("u64", backend->integer_type (true, 64),
+ Linemap::predeclared_location ());
+ return;
+
+ case TyTy::UintType::U128:
+ translated
+ = backend->named_type ("u128", backend->integer_type (true, 128),
+ Linemap::predeclared_location ());
+ return;
}
gcc_unreachable ();
}