clang  10.0.0svn
Public Member Functions | List of all members
clang::interp::Context Class Reference

Holds all information required to evaluate constexpr code in a module. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/AST/Interp/Context.h"

Public Member Functions

 Context (ASTContext &Ctx)
 Initialises the constexpr VM. More...
 
 ~Context ()
 Cleans up the constexpr VM. More...
 
InterpResult isPotentialConstantExpr (State &Parent, const FunctionDecl *FnDecl)
 Checks if a function is a potential constant expression. More...
 
InterpResult evaluateAsRValue (State &Parent, const Expr *E, APValue &Result)
 Evaluates a toplevel expression as an rvalue. More...
 
InterpResult evaluateAsInitializer (State &Parent, const VarDecl *VD, APValue &Result)
 Evaluates a toplevel initializer. More...
 
ASTContextgetASTContext () const
 Returns the AST context. More...
 
const LangOptionsgetLangOpts () const
 Returns the language options. More...
 
InterpStackgetStack ()
 Returns the interpreter stack. More...
 
unsigned getCharBit () const
 Returns CHAR_BIT. More...
 
llvm::Optional< PrimTypeclassify (QualType T)
 Classifies an expression. More...
 

Detailed Description

Holds all information required to evaluate constexpr code in a module.

Definition at line 48 of file Context.h.

Constructor & Destructor Documentation

◆ Context()

Context::Context ( ASTContext Ctx)

Initialises the constexpr VM.

Definition at line 24 of file Context.cpp.

◆ ~Context()

Context::~Context ( )

Cleans up the constexpr VM.

Definition at line 28 of file Context.cpp.

Member Function Documentation

◆ classify()

llvm::Optional< PrimType > Context::classify ( QualType  T)

◆ evaluateAsInitializer()

InterpResult Context::evaluateAsInitializer ( State Parent,
const VarDecl VD,
APValue Result 
)

Evaluates a toplevel initializer.

Definition at line 60 of file Context.cpp.

◆ evaluateAsRValue()

InterpResult Context::evaluateAsRValue ( State Parent,
const Expr E,
APValue Result 
)

Evaluates a toplevel expression as an rvalue.

Definition at line 54 of file Context.cpp.

◆ getASTContext()

ASTContext& clang::interp::Context::getASTContext ( ) const
inline

◆ getCharBit()

unsigned Context::getCharBit ( ) const

Returns CHAR_BIT.

Definition at line 115 of file Context.cpp.

References clang::TargetInfo::getCharWidth(), clang::ASTContext::getTargetInfo(), and Parent.

◆ getLangOpts()

const LangOptions & Context::getLangOpts ( ) const

Returns the language options.

Definition at line 66 of file Context.cpp.

References clang::ASTContext::getLangOpts().

◆ getStack()

InterpStack& clang::interp::Context::getStack ( )
inline

Returns the interpreter stack.

Definition at line 72 of file Context.h.

References P.

◆ isPotentialConstantExpr()

InterpResult Context::isPotentialConstantExpr ( State Parent,
const FunctionDecl FnDecl 
)

Checks if a function is a potential constant expression.

Definition at line 30 of file Context.cpp.

References clang::interp::Bail, clang::interp::Fail, clang::interp::State::FFDiag(), clang::interp::Function::isConstexpr(), P, and Parent.


The documentation for this class was generated from the following files: