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;
88 llvm::DenseMap<LabelTy, unsigned> LabelOffsets;
90 llvm::DenseMap<LabelTy, llvm::SmallVector<unsigned, 5>> LabelRelocs;
92 std::vector<char> Code;
97 int32_t getOffset(
LabelTy Label);
100 template <
typename... Tys>
104 #define GET_LINK_PROTO 105 #include "Opcodes.inc" 106 #undef GET_LINK_PROTO Represents a function declaration or definition.
virtual bool visitDecl(const VarDecl *E)=0
Stmt - This represents one statement.
Decl - This represents one declaration (or definition), e.g.
SourceLocation getBeginLoc() const LLVM_READONLY
virtual ~ByteCodeEmitter()
Represents a variable declaration or definition.
Describes the statement/declaration an opcode was generated from.
Holds all information required to evaluate constexpr code in a module.
llvm::DenseMap< const ParmVarDecl *, unsigned > Params
Parameter indices.
SourceLocation getBeginLoc() const LLVM_READONLY
bool bail(const Stmt *S)
Bails out if a given node cannot be compiled.
LabelTy getLabel()
Create a label.
bool jumpTrue(const LabelTy &Label)
Emits jumps.
llvm::Expected< Function * > compileFunc(const FunctionDecl *F)
Compiles the function into the module.
bool fallthrough(const LabelTy &Label)
Describes a memory block created by an allocation site.
bool jumpFalse(const LabelTy &Label)
This represents one expression.
Information about a local's storage.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
bool jump(const LabelTy &Label)
The program contains and links the bytecode for all functions.
Local createLocal(Descriptor *D)
Callback for local registration.
Encodes a location in the source.
void emitLabel(LabelTy Label)
Define a label.
virtual bool visitFunc(const FunctionDecl *E)=0
Methods implemented by the compiler.
Dataflow Directional Tag Classes.
virtual bool visitExpr(const Expr *E)=0
llvm::SmallVector< SmallVector< Local, 8 >, 2 > Descriptors
Local descriptors.
std::vector< std::pair< unsigned, SourceInfo > > SourceMap
ByteCodeEmitter(Context &Ctx, Program &P)
An emitter which links the program to bytecode for later use.