clang 19.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 | |
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 | 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 *, ParamOffset > | Params |
Parameter indices. | |
llvm::DenseMap< const ValueDecl *, ParamOffset > | LambdaCaptures |
Lambda captures. | |
ParamOffset | LambdaThisCapture {0, false} |
Offset of the This parameter in a lambda record. | |
llvm::SmallVector< SmallVector< Local, 8 >, 2 > | Descriptors |
Local descriptors. | |
An emitter which links the program to bytecode for later use.
Definition at line 26 of file ByteCodeEmitter.h.
|
protected |
Definition at line 29 of file ByteCodeEmitter.h.
|
protected |
Definition at line 28 of file ByteCodeEmitter.h.
|
protected |
Definition at line 30 of file ByteCodeEmitter.h.
Definition at line 37 of file ByteCodeEmitter.h.
References P.
|
inlineprotectedvirtual |
Definition at line 39 of file ByteCodeEmitter.h.
Function * ByteCodeEmitter::compileFunc | ( | const FunctionDecl * | FuncDecl | ) |
Compiles the function into the module.
Definition at line 33 of file ByteCodeEmitter.cpp.
References clang::interp::align(), clang::TemplateArgumentList::asArray(), clang::CXXRecordDecl::captures_begin(), clang::CXXRecordDecl::captures_end(), clang::interp::Context::classify(), clang::interp::Program::createDescriptor(), clang::interp::Program::createFunction(), clang::interp::Record::Field::Decl, Descriptors, clang::FunctionTemplateDecl::findSpecialization(), clang::Func, clang::FunctionDecl::getBuiltinID(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::interp::Record::getField(), clang::interp::Program::getFunction(), clang::CXXRecordDecl::getLambdaCallOperator(), clang::interp::Program::getOrCreateRecord(), clang::DeclContext::getParent(), clang::FieldDecl::getParent(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::FunctionDecl::hasBody(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isDefined(), clang::CXXRecordDecl::isGenericLambda(), clang::isLambdaCallOperator(), clang::Type::isPointerType(), clang::Type::isReferenceType(), isUnevaluatedBuiltin(), clang::Type::isVoidType(), LambdaCaptures, LambdaThisCapture, clang::interp::Record::Field::Offset, clang::FunctionDecl::parameters(), Params, clang::interp::primSize(), clang::interp::PT_Ptr, clang::T, and visitFunc().
|
protected |
Callback for local registration.
Definition at line 182 of file ByteCodeEmitter.cpp.
References clang::interp::align(), and clang::interp::Descriptor::getAllocSize().
|
protected |
Define a label.
Definition at line 189 of file ByteCodeEmitter.cpp.
References clang::interp::align(), clang::interp::aligned(), and Label.
Referenced by fallthrough().
Definition at line 320 of file ByteCodeEmitter.cpp.
References emitLabel(), and Label.
|
inlineprotected |
Create a label.
Definition at line 44 of file ByteCodeEmitter.h.
Definition at line 316 of file ByteCodeEmitter.cpp.
References Label.
Definition at line 312 of file ByteCodeEmitter.cpp.
References Label.
|
protectedpure virtual |
Methods implemented by the compiler.
Referenced by compileFunc().
|
protected |
|
protected |
|
protected |
Offset of the This parameter in a lambda record.
Definition at line 65 of file ByteCodeEmitter.h.
Referenced by compileFunc().
|
protected |