aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-07-06 09:26:19 +0000
committerGitHub <noreply@github.com>2021-07-06 09:26:19 +0000
commit3670b0ef05041b8a1defb755804ef36e029d20db (patch)
tree8b14fea7a5b5b7b69aa7572bcc59e155303ae17b /gcc/rust/backend
parent32c9b09fdb5470dda05375878032c9c7d1fd91f1 (diff)
parentdc5e01832772304e2a988406e78d3d83fe83f278 (diff)
downloadgcc-3670b0ef05041b8a1defb755804ef36e029d20db.zip
gcc-3670b0ef05041b8a1defb755804ef36e029d20db.tar.gz
gcc-3670b0ef05041b8a1defb755804ef36e029d20db.tar.bz2
Merge #548
548: Fix bad naming of primitive types such as u64 which ended up as usize r=philberty a=philberty In #547 it was found that u64's ended up as usize in gimple which confuses debugging sessions. This take the original implementation of named type from gccgo showing it was the TYPE_NAME tree getting confused. Addresses #547 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r--gcc/rust/backend/rust-compile-context.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h
index e0c9352..5d19099 100644
--- a/gcc/rust/backend/rust-compile-context.h
+++ b/gcc/rust/backend/rust-compile-context.h
@@ -58,8 +58,9 @@ public:
TyTy::BaseType *lookup;
rust_assert (tyctx->lookup_type (ref, &lookup));
- auto compiled = TyTyCompile::compile (backend, lookup);
- compiled_type_map[ref] = compiled;
+ Btype *compiled = TyTyCompile::compile (backend, lookup);
+ compiled_type_map.insert (std::pair<HirId, Btype *> (ref, compiled));
+ builtin_range.insert (ref);
}
}
@@ -94,7 +95,8 @@ public:
void insert_compiled_type (HirId id, ::Btype *type,
const TyTy::BaseType *ref = nullptr)
{
- compiled_type_map[id] = type;
+ rust_assert (builtin_range.find (id) == builtin_range.end ());
+ compiled_type_map.insert (std::pair<HirId, Btype *> (id, type));
if (ref != nullptr)
{
std::pair<HirId, ::Btype *> elem (id, type);
@@ -297,6 +299,7 @@ private:
Resolver::TypeCheckContext *tyctx;
Analysis::Mappings *mappings;
ConstFold::Context *const_ctx;
+ std::set<HirId> builtin_range;
// state
std::vector<fncontext> fn_stack;