21 using namespace clang;
35 Parent.
FFDiag(Err.getLoc(), diag::err_experimental_clang_interp_failed);
45 return Run(Parent, Func, Dummy);
50 return Check(Parent, C.interpretExpr(E));
56 return Check(Parent, C.interpretDecl(VD));
102 if (
auto *AT = dyn_cast<AtomicType>(T))
103 return classify(AT->getValueType());
125 Parent.
FFDiag(Err.getLoc(), diag::err_experimental_clang_interp_failed);
void clear()
Clears the stack without calling any destructors.
Represents a function declaration or definition.
Context(ASTContext &Ctx)
Initialises the constexpr VM.
A (possibly-)qualified type.
bool isUnsignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is unsigned or an enumeration types whose underlying ...
InterpFrame * Current
The current frame.
Frame storing local variables.
const TargetInfo & getTargetInfo() const
unsigned getCharWidth() const
Represents a variable declaration or definition.
bool evaluateAsInitializer(State &Parent, const VarDecl *VD, APValue &Result)
Evaluates a toplevel initializer.
bool evaluateAsRValue(State &Parent, const Expr *E, APValue &Result)
Evaluates a toplevel expression as an rvalue.
llvm::Optional< PrimType > classify(QualType T)
Classifies an expression.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Compilation context for statements.
bool Interpret(InterpState &S, APValue &Result)
Interpreter entry point.
bool isReferenceType() const
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool isPotentialConstantExpr(State &Parent, const FunctionDecl *FnDecl)
Checks if a function is a potential constant expression.
unsigned getCharBit() const
Returns CHAR_BIT.
This represents one expression.
bool isNullPtrType() const
OptionalDiagnostic FFDiag(SourceLocation Loc, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
The program contains and links the bytecode for all functions.
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
~Context()
Cleans up the constexpr VM.
Dataflow Directional Tag Classes.
bool isBooleanType() const
unsigned getIntWidth(QualType T) const
Error thrown by the compiler.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
bool isConstexpr() const
Checks if the function is valid to call in constexpr.
Compilation context for expressions.
Interface for the VM to interact with the AST walker's context.
const LangOptions & getLangOpts() const
Returns the language options.
bool isPointerType() const
const LangOptions & getLangOpts() const