clang 24.0.0git
ByteCodeEmitter.cpp File Reference
#include "ByteCodeEmitter.h"
#include "Context.h"
#include "Floating.h"
#include "IntegralAP.h"
#include "Opcode.h"
#include "Program.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include <type_traits>
#include "Opcodes.inc"

Go to the source code of this file.

Macros

#define GET_LINK_IMPL

Functions

template<typename T>
static bool emit (llvm::SmallVectorImpl< std::byte > &Code, const T &Val)
 Helper to write bytecode and bail out if 32-bit offsets become invalid.
template<typename T>
static bool emitSerialized (llvm::SmallVectorImpl< std::byte > &Code, const T &Val)
 Emits a serializable value.
template<>
bool emit (llvm::SmallVectorImpl< std::byte > &Code, const Floating &Val)
template<>
bool emit (llvm::SmallVectorImpl< std::byte > &Code, const IntegralAP< false > &Val)
template<>
bool emit (llvm::SmallVectorImpl< std::byte > &Code, const IntegralAP< true > &Val)
template<>
bool emit (llvm::SmallVectorImpl< std::byte > &Code, const FixedPoint &Val)

Macro Definition Documentation

◆ GET_LINK_IMPL

#define GET_LINK_IMPL

Definition at line 242 of file ByteCodeEmitter.cpp.

Function Documentation

◆ emit() [1/5]

template<>
bool emit ( llvm::SmallVectorImpl< std::byte > & Code,
const FixedPoint & Val )

Definition at line 194 of file ByteCodeEmitter.cpp.

References emitSerialized().

◆ emit() [2/5]

template<>
bool emit ( llvm::SmallVectorImpl< std::byte > & Code,
const Floating & Val )

Definition at line 178 of file ByteCodeEmitter.cpp.

References emitSerialized().

◆ emit() [3/5]

template<>
bool emit ( llvm::SmallVectorImpl< std::byte > & Code,
const IntegralAP< false > & Val )

Definition at line 183 of file ByteCodeEmitter.cpp.

References emitSerialized().

◆ emit() [4/5]

template<>
bool emit ( llvm::SmallVectorImpl< std::byte > & Code,
const IntegralAP< true > & Val )

Definition at line 189 of file ByteCodeEmitter.cpp.

References emitSerialized().

◆ emit() [5/5]

template<typename T>
bool emit ( llvm::SmallVectorImpl< std::byte > & Code,
const T & Val )
static

Helper to write bytecode and bail out if 32-bit offsets become invalid.

Definition at line 133 of file ByteCodeEmitter.cpp.

References clang::interp::align(), clang::interp::aligned(), and clang::T.

Referenced by clang::interp::Compiler< Emitter >::VisitCXXThisExpr().

◆ emitSerialized()

template<typename T>
bool emitSerialized ( llvm::SmallVectorImpl< std::byte > & Code,
const T & Val )
static

Emits a serializable value.

These usually (potentially) contain heap-allocated memory and aren't trivially copyable.

Definition at line 160 of file ByteCodeEmitter.cpp.

References clang::interp::align(), clang::interp::aligned(), and clang::T.

Referenced by emit(), emit(), emit(), and emit().