aboutsummaryrefslogtreecommitdiff
path: root/src/all_types.hpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-02-27 10:00:07 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-02-27 14:57:49 -0500
commitc2f5634fb3df51622cf74f23b4ae0d4a7d2bbbe9 (patch)
tree18dec1e751c7383933b9fca4ddb435ae739c6a49 /src/all_types.hpp
parent4e43bde924694a640cfec13141df1f3f611ffe0f (diff)
downloadzig-c2f5634fb3df51622cf74f23b4ae0d4a7d2bbbe9.tar.gz
zig-c2f5634fb3df51622cf74f23b4ae0d4a7d2bbbe9.zip
another llvm workaround for getelementptr
Diffstat (limited to 'src/all_types.hpp')
-rw-r--r--src/all_types.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/all_types.hpp b/src/all_types.hpp
index 4220523126..52be88496b 100644
--- a/src/all_types.hpp
+++ b/src/all_types.hpp
@@ -1461,6 +1461,14 @@ struct LinkLib {
bool provided_explicitly;
};
+struct WorkaroundStructGEPId {
+ LLVMTypeRef struct_ptr_type;
+ uint32_t index;
+};
+
+uint32_t workaround_struct_gep_hash(WorkaroundStructGEPId x);
+bool workaround_struct_gep_eq(WorkaroundStructGEPId a, WorkaroundStructGEPId b);
+
struct CodeGen {
LLVMModuleRef module;
ZigList<ErrorMsg*> errors;
@@ -1491,7 +1499,7 @@ struct CodeGen {
HashMap<Buf *, AstNode *, buf_hash, buf_eql_buf> exported_symbol_names;
HashMap<Buf *, Tld *, buf_hash, buf_eql_buf> external_prototypes;
HashMap<Buf *, ConstExprValue *, buf_hash, buf_eql_buf> string_literals_table;
-
+ HashMap<WorkaroundStructGEPId, LLVMValueRef, workaround_struct_gep_hash, workaround_struct_gep_eq> workaround_struct_gep_table;
ZigList<ImportTableEntry *> import_queue;
size_t import_queue_index;
@@ -1603,6 +1611,7 @@ struct CodeGen {
LLVMValueRef cur_ret_ptr;
LLVMValueRef cur_fn_val;
LLVMValueRef cur_err_ret_trace_val;
+ bool cur_workaround_gep_on;
bool c_want_stdint;
bool c_want_stdbool;
AstNode *root_export_decl;