Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>, Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>, Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>, Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>, Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>, Timm =?utf-8?q?Bäder?= <tbae...@redhat.com>, Timm =?utf-8?q?Bäder?= <tbae...@redhat.com> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/68...@github.com>
================ @@ -1561,6 +1576,59 @@ template <PrimType TIn, PrimType TOut> bool Cast(InterpState &S, CodePtr OpPC) { return true; } +template <PrimType Name, class ToT = typename PrimConv<Name>::T> +bool BitCast(InterpState &S, CodePtr OpPC, bool TargetIsUCharOrByte) { + const Pointer &FromPtr = S.Stk.pop<Pointer>(); + + size_t BuffSize = ToT::valueReprBytes(S.getCtx()); + std::vector<std::byte> Buff(BuffSize); ---------------- cor3ntin wrote: an llvm small vector (with a buffer of ~8) would avoid almost all allocation here https://github.com/llvm/llvm-project/pull/68288 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits