aboutsummaryrefslogtreecommitdiff
path: root/src/all_types.hpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-02-21 14:44:14 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-02-21 14:44:14 -0500
commit1066004b79d014b4c3d10da19c84c679e21b88e5 (patch)
treedb8c1c83788a624d1fab720073255e8c556d59a0 /src/all_types.hpp
parent2bb795dc455823e76ef3e0c9b3fcee6bcb15fddb (diff)
downloadzig-1066004b79d014b4c3d10da19c84c679e21b88e5.tar.gz
zig-1066004b79d014b4c3d10da19c84c679e21b88e5.zip
better handling of arrays in packed structs
* Separate LoadPtr IR instructions into pass1 and pass2 variants. * Define `type_size_bits` for extern structs to be the same as their `@sizeOf(T) * 8` and allow them in packed structs. * More helpful error messages when trying to use types in packed structs that are not allowed. * Support arrays in packed structs even when they are not byte-aligned. * Add compile error for using arrays in packed structs when the padding bits would be problematic. This is necessary since we do not have packed arrays. closes #677
Diffstat (limited to 'src/all_types.hpp')
-rw-r--r--src/all_types.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/all_types.hpp b/src/all_types.hpp
index 0ee0fef2ca..fe36eb3a5d 100644
--- a/src/all_types.hpp
+++ b/src/all_types.hpp
@@ -2119,6 +2119,7 @@ enum IrInstructionId {
IrInstructionIdUnOp,
IrInstructionIdBinOp,
IrInstructionIdLoadPtr,
+ IrInstructionIdLoadPtrGen,
IrInstructionIdStorePtr,
IrInstructionIdFieldPtr,
IrInstructionIdStructFieldPtr,
@@ -2414,6 +2415,13 @@ struct IrInstructionLoadPtr {
IrInstruction *ptr;
};
+struct IrInstructionLoadPtrGen {
+ IrInstruction base;
+
+ IrInstruction *ptr;
+ LLVMValueRef tmp_ptr;
+};
+
struct IrInstructionStorePtr {
IrInstruction base;