================
@@ -29,40 +44,57 @@ class InterpStack final {
/// Destroys the stack, freeing up storage.
~InterpStack();
+ template <class T> struct alignas(void *) StackFrame {
+ static_assert(alignof(T) <= alignof(void *),
+ "Unexpected overaligned object");
+
+ template <class... Args>
+ StackFrame(Args &&...args)
+ : v(std::forward<Args>(args)...), type(toPrimType<T>()) {}
+
+ static constexpr size_t getPaddingSize() {
+ if constexpr (sizeof(T) < sizeof(void*))
+ return sizeof(void*) - datasizeof_v<T> - 1;
+ else if constexpr (sizeof(T) == datasizeof_v<T>)
+ return sizeof(void*) - 1;
+ else
+ return sizeof(T) - datasizeof_v<T> - 1;
+ }
+
+ LLVM_NO_UNIQUE_ADDRESS T v;
+ LLVM_NO_UNIQUE_ADDRESS Padding<getPaddingSize()> padding;
+ PrimType type;
----------------
tbaederr wrote:
Ah, right. In that case either `PrimT` or `PT` is fine I think.
https://github.com/llvm/llvm-project/pull/224903
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits