13#ifndef LLVM_CLANG_AST_INTERP_LINKEMITTER_H
14#define LLVM_CLANG_AST_INTERP_LINKEMITTER_H
23#include "llvm/Support/Error.h"
72 llvm::DenseMap<const ParmVarDecl *, unsigned>
Params;
84 unsigned NextLocalOffset = 0;
86 std::optional<SourceLocation> BailLocation;
88 llvm::DenseMap<LabelTy, unsigned> LabelOffsets;
90 llvm::DenseMap<LabelTy, llvm::SmallVector<unsigned, 5>> LabelRelocs;
92 std::vector<char> Code;
100 template <
typename... Tys>
104#define GET_LINK_PROTO
105#include "Opcodes.inc"
Decl - This represents one declaration (or definition), e.g.
SourceLocation getBeginLoc() const LLVM_READONLY
This represents one expression.
Represents a function declaration or definition.
Encodes a location in the source.
Stmt - This represents one statement.
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.
ByteCodeEmitter(Context &Ctx, Program &P)
llvm::DenseMap< const ParmVarDecl *, unsigned > Params
Parameter indices.
bool fallthrough(const LabelTy &Label)
Local createLocal(Descriptor *D)
Callback for local registration.
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.
bool bail(const Stmt *S)
Bails out if a given node cannot be compiled.
llvm::Expected< Function * > compileFunc(const FunctionDecl *FuncDecl)
Compiles the function into the module.
bool jumpFalse(const LabelTy &Label)
LabelTy getLabel()
Create a label.
virtual bool visitDecl(const VarDecl *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
__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.