13#ifndef LLVM_CLANG_AST_INTERP_LINKEMITTER_H
14#define LLVM_CLANG_AST_INTERP_LINKEMITTER_H
69 llvm::DenseMap<const ParmVarDecl *, ParamOffset>
Params;
86 unsigned NextLocalOffset = 0;
88 llvm::DenseMap<LabelTy, unsigned> LabelOffsets;
90 llvm::DenseMap<LabelTy, llvm::SmallVector<unsigned, 5>> LabelRelocs;
100 template <
typename... Tys>
104#define GET_LINK_PROTO
105#include "Opcodes.inc"
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
This represents one expression.
Represents a function declaration or definition.
Represents a variable declaration or definition.
An emitter which links the program to bytecode for later use.
virtual bool visitExpr(const Expr *E, bool DestroyToplevelScope)=0
bool checkingForUndefinedBehavior() const
bool jump(const LabelTy &Label)
void emitLabel(LabelTy Label)
Define a label.
ParamOffset LambdaThisCapture
Offset of the This parameter in a lambda record.
ByteCodeEmitter(Context &Ctx, Program &P)
llvm::DenseMap< const ParmVarDecl *, ParamOffset > Params
Parameter indices.
llvm::DenseMap< const ValueDecl *, ParamOffset > LambdaCaptures
Lambda captures.
bool speculate(const CallExpr *E, const LabelTy &EndLabel)
Speculative execution.
void compileFunc(const FunctionDecl *FuncDecl, Function *Func=nullptr)
Compiles the function into the module.
bool fallthrough(const LabelTy &Label)
Local createLocal(Descriptor *D)
Callback for local registration.
virtual bool visitFunc(const FunctionDecl *E)=0
Methods implemented by the compiler.
virtual bool emitBool(bool V, const Expr *E)=0
virtual ~ByteCodeEmitter()
bool jumpTrue(const LabelTy &Label)
Emits jumps.
std::optional< SourceInfo > LocOverride
virtual bool visitDeclAndReturn(const VarDecl *E, bool ConstantContext)=0
bool jumpFalse(const LabelTy &Label)
LabelTy getLabel()
Create a label.
bool isActive() const
We're always emitting bytecode.
virtual bool visit(const Expr *E)=0
llvm::SmallVector< SmallVector< Local, 8 >, 2 > Descriptors
Local descriptors.
Holds all information required to evaluate constexpr code in a module.
The program contains and links the bytecode for all functions.
Describes the statement/declaration an opcode was generated from.
std::vector< std::pair< unsigned, SourceInfo > > SourceMap
The JSON file list parser is used to communicate input to InstallAPI.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Describes a memory block created by an allocation site.
Information about a local's storage.