13 #ifndef LLVM_CLANG_AST_INTERP_EVALEMITTER_H 14 #define LLVM_CLANG_AST_INTERP_EVALEMITTER_H 23 #include "llvm/Support/Error.h" 75 return F ? F->
getSource(PC) : CurrentSource;
79 llvm::DenseMap<const ParmVarDecl *, unsigned>
Params;
94 llvm::DenseMap<unsigned, std::unique_ptr<char[]>> Locals;
113 bool isActive() {
return CurrentLabel == ActiveLabel; }
121 #define GET_EVAL_PROTO 122 #include "Opcodes.inc" 123 #undef GET_EVAL_PROTO
Represents a function declaration or definition.
SourceInfo getSource(Function *F, CodePtr PC) const override
Returns the source location of the current opcode.
Pointer into the code segment.
Stmt - This represents one statement.
Interface for classes which map locations to sources.
Decl - This represents one declaration (or definition), e.g.
SourceLocation getBeginLoc() const LLVM_READONLY
constexpr XRayInstrMask Function
LabelTy getLabel()
Create a label.
Represents a variable declaration or definition.
bool This(InterpState &S, CodePtr OpPC)
SourceInfo getSource(CodePtr PC) const
Returns the source information at a given PC.
bool jumpFalse(const LabelTy &Label)
Describes the statement/declaration an opcode was generated from.
Holds all information required to evaluate constexpr code in a module.
A pointer to a memory block, live or dead.
EvalEmitter(Context &Ctx, Program &P, State &Parent, InterpStack &Stk, APValue &Result)
SourceLocation getBeginLoc() const LLVM_READONLY
Describes a memory block created by an allocation site.
virtual bool visitDecl(const VarDecl *VD)=0
llvm::Expected< bool > interpretDecl(const VarDecl *VD)
Stack frame storing temporaries and parameters.
llvm::Expected< bool > interpretExpr(const Expr *E)
This represents one expression.
Information about a local's storage.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Local createLocal(Descriptor *D)
Callback for registering a local.
The program contains and links the bytecode for all functions.
Encodes a location in the source.
An emitter which evaluates opcodes as they are emitted.
llvm::DenseMap< const ParmVarDecl *, unsigned > Params
Parameter indices.
void emitLabel(LabelTy Label)
Define a label.
Dataflow Directional Tag Classes.
llvm::SmallVector< SmallVector< Local, 8 >, 2 > Descriptors
Local descriptors.
bool fallthrough(const LabelTy &Label)
bool jump(const LabelTy &Label)
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
Interface for the VM to interact with the AST walker's context.
virtual bool visitExpr(const Expr *E)=0
Methods implemented by the compiler.
bool jumpTrue(const LabelTy &Label)
Emits jumps.