diff --git a/lldb/include/lldb/Core/EmulateInstruction.h b/lldb/include/lldb/Core/EmulateInstruction.h --- a/lldb/include/lldb/Core/EmulateInstruction.h +++ b/lldb/include/lldb/Core/EmulateInstruction.h @@ -189,7 +189,7 @@ public: enum InfoType GetInfoType() const { return info_type; } - union { + union ContextInfo { struct RegisterPlusOffset { RegisterInfo reg; // base register int64_t signed_offset; // signed offset added to base register @@ -241,6 +241,8 @@ uint32_t isa; } info; + static_assert(std::is_trivial::value, + "ContextInfo must be trivial."); Context() = default; diff --git a/lldb/include/lldb/lldb-private-types.h b/lldb/include/lldb/lldb-private-types.h --- a/lldb/include/lldb/lldb-private-types.h +++ b/lldb/include/lldb/lldb-private-types.h @@ -15,6 +15,8 @@ #include "llvm/ADT/ArrayRef.h" +#include + namespace llvm { namespace sys { class DynamicLibrary; @@ -70,6 +72,8 @@ byte_size); } }; +static_assert(std::is_trivial::value, + "RegisterInfo must be trivial."); /// Registers are grouped into register sets struct RegisterSet {