From 9a99bd3a71f1b20afd155f440c8dedd69273e8cb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 24 Oct 2017 02:14:55 -0400 Subject: [PATCH] use llvm named structs for const values when possible normally we want to use llvm types for constants. but union constants (which are found inside enums) when they are initialized with the non-most-aligned-member must be unnamed structs. these bubble up to all aggregate types. if a constant of an aggregate type contains, recursively, a union constant with a non-most-aligned-member initialized, the aggregate typed constant must be unnamed too. this fixes all the asserts that were coming in from llvm master branch. --- src/target.cpp | 1 + src/zig_llvm.hpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/target.cpp b/src/target.cpp index 6d424aaacf0665f765e7204d5e47451bf5083274..38421a8921fb2ec1246a4286b4fff76ebe4f86b7 100644 --- a/src/target.cpp +++ b/src/target.cpp @@ -183,6 +183,7 @@ static const ZigLLVM_EnvironmentType environ_list[] = { ZigLLVM_AMDOpenCL, ZigLLVM_CoreCLR, ZigLLVM_OpenCL, + ZigLLVM_Simulator, }; static const ZigLLVM_ObjectFormatType oformat_list[] = { diff --git a/src/zig_llvm.hpp b/src/zig_llvm.hpp index 8c05b60d16e6985ff552040a45078002a9c86027..93ae462a28fbf812b3bd84b67caed6fb1790f423 100644 --- a/src/zig_llvm.hpp +++ b/src/zig_llvm.hpp @@ -339,8 +339,9 @@ enum ZigLLVM_EnvironmentType { ZigLLVM_AMDOpenCL, ZigLLVM_CoreCLR, ZigLLVM_OpenCL, + ZigLLVM_Simulator, // Simulator variants of other systems, e.g., Apple's iOS - ZigLLVM_LastEnvironmentType = ZigLLVM_OpenCL + ZigLLVM_LastEnvironmentType = ZigLLVM_Simulator }; enum ZigLLVM_ObjectFormatType { -- 2.54.0