This revision was automatically updated to reflect the committed changes. Closed by commit rG8d06ef565818: [LLDB] Check that RegisterInfo and ContextInfo are trivial (authored by DavidSpickett).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136584/new/ https://reviews.llvm.org/D136584 Files: lldb/include/lldb/Core/EmulateInstruction.h lldb/include/lldb/lldb-private-types.h Index: lldb/include/lldb/lldb-private-types.h =================================================================== --- lldb/include/lldb/lldb-private-types.h +++ lldb/include/lldb/lldb-private-types.h @@ -15,6 +15,8 @@ #include "llvm/ADT/ArrayRef.h" +#include <type_traits> + namespace llvm { namespace sys { class DynamicLibrary; @@ -70,6 +72,8 @@ byte_size); } }; +static_assert(std::is_trivial<RegisterInfo>::value, + "RegisterInfo must be trivial."); /// Registers are grouped into register sets struct RegisterSet { Index: lldb/include/lldb/Core/EmulateInstruction.h =================================================================== --- lldb/include/lldb/Core/EmulateInstruction.h +++ 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<ContextInfo>::value, + "ContextInfo must be trivial."); Context() = default;
Index: lldb/include/lldb/lldb-private-types.h =================================================================== --- lldb/include/lldb/lldb-private-types.h +++ lldb/include/lldb/lldb-private-types.h @@ -15,6 +15,8 @@ #include "llvm/ADT/ArrayRef.h" +#include <type_traits> + namespace llvm { namespace sys { class DynamicLibrary; @@ -70,6 +72,8 @@ byte_size); } }; +static_assert(std::is_trivial<RegisterInfo>::value, + "RegisterInfo must be trivial."); /// Registers are grouped into register sets struct RegisterSet { Index: lldb/include/lldb/Core/EmulateInstruction.h =================================================================== --- lldb/include/lldb/Core/EmulateInstruction.h +++ 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<ContextInfo>::value, + "ContextInfo must be trivial."); Context() = default;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits