clang
10.0.0git
|
An emitter which links the program to bytecode for later use. More...
#include "/work/www-prereleases/10.0.0/rc2/docsbuild/clang/lib/AST/Interp/ByteCodeEmitter.h"
Public Member Functions | |
llvm::Expected< Function * > | compileFunc (const FunctionDecl *F) |
Compiles the function into the module. More... | |
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. More... | |
LabelTy | getLabel () |
Create a label. More... | |
virtual bool | visitFunc (const FunctionDecl *E)=0 |
Methods implemented by the compiler. More... | |
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. More... | |
bool | bail (const Decl *D) |
bool | bail (const SourceLocation &Loc) |
bool | jumpTrue (const LabelTy &Label) |
Emits jumps. More... | |
bool | jumpFalse (const LabelTy &Label) |
bool | jump (const LabelTy &Label) |
bool | fallthrough (const LabelTy &Label) |
Local | createLocal (Descriptor *D) |
Callback for local registration. More... | |
Protected Attributes | |
llvm::DenseMap< const ParmVarDecl *, unsigned > | Params |
Parameter indices. More... | |
llvm::SmallVector< SmallVector< Local, 8 >, 2 > | Descriptors |
Local descriptors. More... | |
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.
|
inlineprotectedvirtual |
Definition at line 45 of file ByteCodeEmitter.h.
References emitLabel(), and Label.
Bails out if a given node cannot be compiled.
Definition at line 58 of file ByteCodeEmitter.h.
Referenced by bail().
Definition at line 59 of file ByteCodeEmitter.h.
References bail(), createLocal(), fallthrough(), clang::Decl::getBeginLoc(), jump(), jumpFalse(), and jumpTrue().
Referenced by bail().
|
protected |
Definition at line 119 of file ByteCodeEmitter.cpp.
References max().
Expected< Function * > ByteCodeEmitter::compileFunc | ( | const FunctionDecl * | F | ) |
Compiles the function into the module.
Definition at line 21 of file ByteCodeEmitter.cpp.
References clang::interp::align(), clang::interp::Context::classify(), clang::interp::Program::createDescriptor(), clang::interp::Program::createFunction(), Descriptors, clang::FunctionDecl::getReturnType(), clang::FunctionDecl::hasBody(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isDefined(), clang::Type::isVoidType(), clang::FunctionDecl::parameters(), Params, clang::interp::primSize(), clang::interp::PT_Ptr, visitFunc(), and clang::FunctionDecl::willHaveBody().
|
protected |
Callback for local registration.
Definition at line 80 of file ByteCodeEmitter.cpp.
References clang::interp::align(), and clang::interp::Descriptor::getAllocSize().
Referenced by bail().
|
protected |
Define a label.
Rewrite the operand of all jumps to this label.
Definition at line 87 of file ByteCodeEmitter.cpp.
References Label, Offset, and clang::Target.
Referenced by fallthrough(), and ~ByteCodeEmitter().
|
inlineprotected |
Create a label.
Definition at line 50 of file ByteCodeEmitter.h.
References visitDecl(), visitExpr(), and visitFunc().
Definition at line 160 of file ByteCodeEmitter.cpp.
Referenced by bail().
Definition at line 156 of file ByteCodeEmitter.cpp.
Referenced by bail().
Referenced by getLabel().
Referenced by getLabel().
|
protectedpure virtual |
Methods implemented by the compiler.
Referenced by compileFunc(), and getLabel().
|
protected |
|
protected |