clang 22.0.0git
|
#include "InterpBuiltinBitCast.h"
#include "BitcastBuffer.h"
#include "Boolean.h"
#include "Context.h"
#include "Floating.h"
#include "Integral.h"
#include "InterpState.h"
#include "MemberPointer.h"
#include "Pointer.h"
#include "Record.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Basic/TargetInfo.h"
#include <variant>
Go to the source code of this file.
Macros | |
#define | BITCAST_TYPE_SWITCH(Expr, B) |
#define | BITCAST_TYPE_SWITCH_FIXED_SIZE(Expr, B) |
Typedefs | |
using | DataFunc |
Implement __builtin_bit_cast and related operations. | |
using | PrimTypeVariant |
Functions | |
static bool | enumerateData (const Pointer &P, const Context &Ctx, Bits Offset, Bits BitsToRead, DataFunc F) |
We use this to recursively iterate over all fields and elements of a pointer and extract relevant data for a bitcast. | |
static bool | enumeratePointerFields (const Pointer &P, const Context &Ctx, Bits BitsToRead, DataFunc F) |
static bool | CheckBitcastType (InterpState &S, CodePtr OpPC, QualType T, bool IsToType) |
#define BITCAST_TYPE_SWITCH | ( | Expr, | |
B ) |
Definition at line 42 of file InterpBuiltinBitCast.cpp.
Referenced by clang::interp::readPointerToBuffer().
#define BITCAST_TYPE_SWITCH_FIXED_SIZE | ( | Expr, | |
B ) |
Definition at line 61 of file InterpBuiltinBitCast.cpp.
Referenced by clang::interp::DoBitCastPtr().
using DataFunc |
Implement __builtin_bit_cast and related operations.
Since our internal representation for data is more complex than something we can simply memcpy or memcmp, we first bitcast all the data into a buffer, which we then later use to copy the data into the target. Used to iterate over pointer fields.
Definition at line 38 of file InterpBuiltinBitCast.cpp.
using PrimTypeVariant |
Definition at line 458 of file InterpBuiltinBitCast.cpp.
|
static |
Definition at line 173 of file InterpBuiltinBitCast.cpp.
References CheckBitcastType(), clang::interp::InterpState::Current, clang::interp::State::FFDiag(), clang::interp::InterpState::getASTContext(), clang::ASTContext::getBaseElementType(), clang::ASTContext::getCharWidth(), clang::interp::InterpFrame::getExpr(), clang::ASTContext::getFloatTypeSemantics(), clang::Stmt::getSourceRange(), clang::ASTContext::getTypeSize(), clang::Type::isPackedVectorBoolType(), clang::Type::isRealFloatingType(), clang::interp::State::Note(), and clang::T.
Referenced by CheckBitcastType(), clang::interp::DoBitCast(), and clang::interp::DoBitCastPtr().
|
static |
We use this to recursively iterate over all fields and elements of a pointer and extract relevant data for a bitcast.
Definition at line 80 of file InterpBuiltinBitCast.cpp.
References clang::interp::Pointer::atField(), clang::interp::Pointer::atIndex(), clang::interp::Record::bases(), clang::cast(), clang::interp::Context::classify(), clang::interp::Descriptor::ElemRecord, enumerateData(), clang::interp::Record::fields(), clang::interp::Context::getASTContext(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::interp::Record::getDecl(), clang::interp::Descriptor::getElemQualType(), clang::interp::Pointer::getFieldDesc(), clang::ASTRecordLayout::getFieldOffset(), clang::interp::Pointer::getIndex(), clang::interp::Descriptor::getNumElems(), clang::interp::Descriptor::getPrimType(), clang::interp::Descriptor::getType(), clang::ASTContext::getTypeSize(), clang::interp::Pointer::initialize(), clang::interp::Descriptor::isCompositeArray(), clang::Type::isPackedVectorBoolType(), clang::interp::Descriptor::isPrimitive(), clang::interp::Descriptor::isPrimitiveArray(), clang::interp::Descriptor::isRecord(), clang::interp::Pointer::narrow(), Ok, and clang::ASTContext::toBits().
Referenced by enumerateData(), and enumeratePointerFields().
|
static |
Definition at line 158 of file InterpBuiltinBitCast.cpp.
References enumerateData(), and clang::interp::Bits::zero().
Referenced by clang::interp::DoBitCastPtr(), clang::interp::DoMemcpy(), and clang::interp::readPointerToBuffer().