13#ifndef LLVM_CLANG_AST_INTERP_LINKEMITTER_H
14#define LLVM_CLANG_AST_INTERP_LINKEMITTER_H
65 llvm::DenseMap<const ParmVarDecl *, ParamOffset>
Params;
81 unsigned NextLocalOffset = 0;
83 llvm::DenseMap<LabelTy, unsigned> LabelOffsets;
85 llvm::DenseMap<LabelTy, llvm::SmallVector<unsigned, 5>> LabelRelocs;
87 std::vector<std::byte> Code;
95 template <
typename... Tys>
100#include "Opcodes.inc"
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
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.
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 fallthrough(const LabelTy &Label)
Local createLocal(Descriptor *D)
Callback for local registration.
Function * compileFunc(const FunctionDecl *FuncDecl)
Compiles the function into the module.
Function * compileObjCBlock(const BlockExpr *BE)
Compile an ObjC block, i.e.
virtual bool visitExpr(const Expr *E)=0
virtual bool visitFunc(const FunctionDecl *E)=0
Methods implemented by the compiler.
virtual ~ByteCodeEmitter()
bool jumpTrue(const LabelTy &Label)
Emits jumps.
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.
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.