Path: blob/main/contrib/llvm-project/clang/lib/AST/ByteCode/InterpBuiltinBitCast.h
213799 views
//===------------------ InterpBuiltinBitCast.h ------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_CLANG_AST_INTERP_BUILTIN_BIT_CAST_H9#define LLVM_CLANG_AST_INTERP_BUILTIN_BIT_CAST_H1011#include "BitcastBuffer.h"12#include <cstddef>1314namespace clang {15namespace interp {16class Pointer;17class InterpState;18class CodePtr;19class Context;2021inline static void swapBytes(std::byte *M, size_t N) {22for (size_t I = 0; I != (N / 2); ++I)23std::swap(M[I], M[N - 1 - I]);24}2526bool DoBitCast(InterpState &S, CodePtr OpPC, const Pointer &Ptr,27std::byte *Buff, Bits BitWidth, Bits FullBitWidth,28bool &HasIndeterminateBits);29bool DoBitCastPtr(InterpState &S, CodePtr OpPC, const Pointer &FromPtr,30Pointer &ToPtr);31bool DoBitCastPtr(InterpState &S, CodePtr OpPC, const Pointer &FromPtr,32Pointer &ToPtr, size_t Size);33bool readPointerToBuffer(const Context &Ctx, const Pointer &FromPtr,34BitcastBuffer &Buffer, bool ReturnOnUninit);3536bool DoMemcpy(InterpState &S, CodePtr OpPC, const Pointer &SrcPtr,37const Pointer &DestPtr, Bits Size);3839} // namespace interp40} // namespace clang4142#endif434445