RegisterInfo is often initialised with a memcpy, and ContextInfo
does not run destructors for anything within it.
This was discussed in https://reviews.llvm.org/
D134041.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/
D136584
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
uint32_t isa;
} info;
+ static_assert(std::is_trivial<ContextInfo>::value,
+ "ContextInfo must be trivial.");
Context() = default;
#include "llvm/ADT/ArrayRef.h"
+#include <type_traits>
+
namespace llvm {
namespace sys {
class DynamicLibrary;
byte_size);
}
};
+static_assert(std::is_trivial<RegisterInfo>::value,
+ "RegisterInfo must be trivial.");
/// Registers are grouped into register sets
struct RegisterSet {