clang 17.0.0git
|
An emitter which links the program to bytecode for later use. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/ByteCodeEmitter.h"
Public Member Functions | |
llvm::Expected< Function * > | compileFunc (const FunctionDecl *FuncDecl) |
Compiles the function into the module. | |
Protected Types | |
using | LabelTy = uint32_t |
using | AddrTy = uintptr_t |
using | Local = Scope::Local |
Protected Member Functions | |
ByteCodeEmitter (Context &Ctx, Program &P) | |
virtual | ~ByteCodeEmitter () |
void | emitLabel (LabelTy Label) |
Define a label. | |
LabelTy | getLabel () |
Create a label. | |
virtual bool | visitFunc (const FunctionDecl *E)=0 |
Methods implemented by the compiler. | |
virtual bool | visitExpr (const Expr *E)=0 |
virtual bool | visitDecl (const VarDecl *E)=0 |
bool | bail (const Stmt *S) |
Bails out if a given node cannot be compiled. | |
bool | bail (const Decl *D) |
bool | bail (const SourceLocation &Loc) |
bool | jumpTrue (const LabelTy &Label) |
Emits jumps. | |
bool | jumpFalse (const LabelTy &Label) |
bool | jump (const LabelTy &Label) |
bool | fallthrough (const LabelTy &Label) |
Local | createLocal (Descriptor *D) |
Callback for local registration. | |
Protected Attributes | |
llvm::DenseMap< const ParmVarDecl *, unsigned > | Params |
Parameter indices. | |
llvm::SmallVector< SmallVector< Local, 8 >, 2 > | Descriptors |
Local descriptors. | |
An emitter which links the program to bytecode for later use.
Definition at line 32 of file ByteCodeEmitter.h.
|
protected |
Definition at line 35 of file ByteCodeEmitter.h.
|
protected |
Definition at line 34 of file ByteCodeEmitter.h.
|
protected |
Definition at line 36 of file ByteCodeEmitter.h.
Definition at line 43 of file ByteCodeEmitter.h.
References P.
|
inlineprotectedvirtual |
Definition at line 45 of file ByteCodeEmitter.h.
Definition at line 59 of file ByteCodeEmitter.h.
References bail(), and clang::Decl::getBeginLoc().
Referenced by bail().
|
protected |
Definition at line 143 of file ByteCodeEmitter.cpp.
Bails out if a given node cannot be compiled.
Definition at line 58 of file ByteCodeEmitter.h.
References bail().
Referenced by bail().
Expected< Function * > ByteCodeEmitter::compileFunc | ( | const FunctionDecl * | FuncDecl | ) |
Compiles the function into the module.
Definition at line 24 of file ByteCodeEmitter.cpp.
References clang::interp::align(), clang::interp::Context::classify(), clang::interp::Program::createDescriptor(), clang::interp::Program::createFunction(), Descriptors, clang::interp::Program::getFunction(), clang::FunctionDecl::getReturnType(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isDefined(), clang::Type::isVoidType(), clang::FunctionDecl::parameters(), Params, clang::interp::primSize(), clang::interp::PT_Ptr, and visitFunc().
|
protected |
Callback for local registration.
Definition at line 101 of file ByteCodeEmitter.cpp.
References clang::interp::align(), and clang::interp::Descriptor::getAllocSize().
|
protected |
Define a label.
Rewrite the operand of all jumps to this label.
Definition at line 108 of file ByteCodeEmitter.cpp.
References clang::interp::align(), clang::interp::aligned(), Label, Offset, and clang::Target.
Referenced by fallthrough().
Definition at line 209 of file ByteCodeEmitter.cpp.
References emitLabel(), and Label.
|
inlineprotected |
Create a label.
Definition at line 50 of file ByteCodeEmitter.h.
Definition at line 205 of file ByteCodeEmitter.cpp.
References Label.
Definition at line 201 of file ByteCodeEmitter.cpp.
References Label.
|
protectedpure virtual |
Methods implemented by the compiler.
Referenced by compileFunc().
|
protected |
|
protected |