diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2024-07-27 23:34:35 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2024-10-23 18:26:01 +0000 |
commit | 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583 (patch) | |
tree | 6cf5ab1f05330c6773b1f3f64799d56a9c7a1faa /contrib/llvm-project/clang/lib/AST/Interp/ByteCodeEmitter.h | |
parent | 6b9f7133aba44189d9625c352bc2c2a59baf18ef (diff) | |
parent | ac9a064cb179f3425b310fa2847f8764ac970a4d (diff) |
Diffstat (limited to 'contrib/llvm-project/clang/lib/AST/Interp/ByteCodeEmitter.h')
-rw-r--r-- | contrib/llvm-project/clang/lib/AST/Interp/ByteCodeEmitter.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/llvm-project/clang/lib/AST/Interp/ByteCodeEmitter.h b/contrib/llvm-project/clang/lib/AST/Interp/ByteCodeEmitter.h index 03de286582c9..a19a25c2f9e8 100644 --- a/contrib/llvm-project/clang/lib/AST/Interp/ByteCodeEmitter.h +++ b/contrib/llvm-project/clang/lib/AST/Interp/ByteCodeEmitter.h @@ -1,4 +1,4 @@ -//===--- ByteCodeEmitter.h - Instruction emitter for the VM ---------*- C++ -*-===// +//===--- ByteCodeEmitter.h - Instruction emitter for the VM -----*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -46,7 +46,7 @@ protected: /// Methods implemented by the compiler. virtual bool visitFunc(const FunctionDecl *E) = 0; virtual bool visitExpr(const Expr *E) = 0; - virtual bool visitDecl(const VarDecl *E) = 0; + virtual bool visitDeclAndReturn(const VarDecl *E, bool ConstantContext) = 0; /// Emits jumps. bool jumpTrue(const LabelTy &Label); @@ -54,6 +54,9 @@ protected: bool jump(const LabelTy &Label); bool fallthrough(const LabelTy &Label); + /// We're always emitting bytecode. + bool isActive() const { return true; } + /// Callback for local registration. Local createLocal(Descriptor *D); @@ -62,7 +65,7 @@ protected: /// Lambda captures. llvm::DenseMap<const ValueDecl *, ParamOffset> LambdaCaptures; /// Offset of the This parameter in a lambda record. - unsigned LambdaThisCapture = 0; + ParamOffset LambdaThisCapture{0, false}; /// Local descriptors. llvm::SmallVector<SmallVector<Local, 8>, 2> Descriptors; |