|
clang 23.0.0git
|
An emitter which links the program to bytecode for later use. More...
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/ByteCodeEmitter.h"
Public Types | |
| using | LabelTy = uint32_t |
Public Member Functions | |
| void | compileFunc (const FunctionDecl *FuncDecl, Function *Func=nullptr) |
| Compiles the function into the module. | |
Protected Types | |
| 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, bool DestroyToplevelScope)=0 |
| virtual bool | visitDeclAndReturn (const VarDecl *VD, const Expr *Init, bool ConstantContext)=0 |
| virtual bool | visit (const Expr *E)=0 |
| virtual bool | emitBool (bool V, const Expr *E)=0 |
| bool | jumpTrue (const LabelTy &Label, SourceInfo SI) |
| Emits jumps. | |
| bool | jumpFalse (const LabelTy &Label, SourceInfo SI) |
| bool | jump (const LabelTy &Label, SourceInfo SI) |
| bool | fallthrough (const LabelTy &Label) |
| bool | speculate (const CallExpr *E, const LabelTy &EndLabel) |
| Speculative execution. | |
| bool | isActive () const |
| We're always emitting bytecode. | |
| bool | checkingForUndefinedBehavior () const |
| Local | createLocal (Descriptor *D) |
| Callback for local registration. | |
Protected Attributes | |
| llvm::DenseMap< const ParmVarDecl *, FuncParam > | 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. | |
| std::optional< SourceInfo > | LocOverride = std::nullopt |
An emitter which links the program to bytecode for later use.
Definition at line 26 of file ByteCodeEmitter.h.
|
protected |
Definition at line 28 of file ByteCodeEmitter.h.
| using clang::interp::ByteCodeEmitter::LabelTy = uint32_t |
Definition at line 32 of file ByteCodeEmitter.h.
|
protected |
Definition at line 29 of file ByteCodeEmitter.h.
Definition at line 37 of file ByteCodeEmitter.h.
|
inlineprotectedvirtual |
Definition at line 39 of file ByteCodeEmitter.h.
|
inlineprotected |
Definition at line 64 of file ByteCodeEmitter.h.
| void ByteCodeEmitter::compileFunc | ( | const FunctionDecl * | FuncDecl, |
| Function * | Func = nullptr ) |
Compiles the function into the module.
Definition at line 23 of file ByteCodeEmitter.cpp.
References Descriptors, clang::Func, clang::CXXRecordDecl::getCaptureFields(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::FunctionDecl::hasBody(), clang::FunctionDecl::isConstexpr(), clang::Decl::isInvalidDecl(), clang::Type::isPointerOrReferenceType(), clang::FunctionDecl::isThisDeclarationADefinition(), LambdaCaptures, LambdaThisCapture, clang::FunctionDecl::param_begin(), clang::FunctionDecl::param_empty(), Params, and visitFunc().
|
protected |
Callback for local registration.
Definition at line 92 of file ByteCodeEmitter.cpp.
References clang::interp::align(), and clang::interp::Descriptor::getAllocSize().
|
protectedpure virtual |
References V.
|
protected |
Define a label.
Definition at line 99 of file ByteCodeEmitter.cpp.
References clang::interp::align(), clang::interp::aligned(), and clang::Target.
Referenced by fallthrough().
Definition at line 236 of file ByteCodeEmitter.cpp.
References emitLabel().
|
inlineprotected |
Create a label.
Definition at line 44 of file ByteCodeEmitter.h.
|
inlineprotected |
We're always emitting bytecode.
Definition at line 63 of file ByteCodeEmitter.h.
|
protected |
Definition at line 232 of file ByteCodeEmitter.cpp.
|
protected |
Definition at line 228 of file ByteCodeEmitter.cpp.
|
protected |
Emits jumps.
Definition at line 224 of file ByteCodeEmitter.cpp.
Speculative execution.
Definition at line 241 of file ByteCodeEmitter.cpp.
References clang::CallExpr::getArg(), clang::Expr::getType(), clang::interp::PT_Ptr, and visit().
Referenced by speculate().
|
protectedpure virtual |
References clang::interp::Init().
|
protectedpure virtual |
|
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 74 of file ByteCodeEmitter.h.
Referenced by compileFunc().
|
protected |
Definition at line 77 of file ByteCodeEmitter.h.
|
protected |