From c2f5634fb3df51622cf74f23b4ae0d4a7d2bbbe9 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 27 Feb 2018 10:00:07 -0500 Subject: another llvm workaround for getelementptr --- src/analyze.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index 26924cc7db..9c5e4ffdde 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -5821,3 +5821,11 @@ bool type_is_global_error_set(TypeTableEntry *err_set_type) { uint32_t get_coro_frame_align_bytes(CodeGen *g) { return g->pointer_size_bytes * 2; } + +uint32_t workaround_struct_gep_hash(WorkaroundStructGEPId x) { + return ptr_hash(x.struct_ptr_type) ^ x.index; +} + +bool workaround_struct_gep_eq(WorkaroundStructGEPId a, WorkaroundStructGEPId b) { + return a.struct_ptr_type == b.struct_ptr_type && a.index == b.index; +} -- cgit v1.2.3