clang  10.0.0svn
Classes | Typedefs | Enumerations | Functions
clang::interp Namespace Reference

Classes

class  Block
 A memory block, either on the stack or in the heap. More...
 
class  BlockScope
 Scope for storage declared in a compound statement. More...
 
class  Boolean
 Wrapper around boolean types. More...
 
class  ByteCodeEmitter
 An emitter which links the program to bytecode for later use. More...
 
class  ByteCodeExprGen
 Compilation context for expressions. More...
 
struct  ByteCodeGenError
 Error thrown by the compiler. More...
 
class  ByteCodeStmtGen
 Compilation context for statements. More...
 
class  CodePtr
 Pointer into the code segment. More...
 
class  Context
 Holds all information required to evaluate constexpr code in a module. More...
 
class  DeadBlock
 Descriptor for a dead block. More...
 
class  DeclScope
 Scope used to handle temporaries in toplevel variable declarations. More...
 
struct  Descriptor
 Describes a memory block created by an allocation site. More...
 
class  EvalEmitter
 An emitter which evaluates opcodes as they are emitted. More...
 
class  ExprScope
 Expression scope which tracks potentially lifetime extended temporaries which are hoisted to the parent scope on exit. More...
 
class  Frame
 Base class for stack frames, shared between VM and walker. More...
 
class  Function
 Bytecode function. More...
 
struct  InitMap
 Bitfield tracking the initialisation status of elements of primitive arrays. More...
 
struct  InlineDescriptor
 Inline descriptor embedded in structures and arrays. More...
 
class  Integral
 Wrapper around numeric types. More...
 
class  InterpFrame
 Frame storing local variables. More...
 
class  InterpStack
 Stack frame storing temporaries and parameters. More...
 
class  InterpState
 Interpreter context. More...
 
class  LabelScope
 Scope managing label targets. More...
 
class  LocalScope
 Scope for local variables. More...
 
class  LoopScope
 Sets the context for break/continue statements. More...
 
class  OptionScope
 Scope used to handle initialization methods. More...
 
class  Pointer
 A pointer to a memory block, live or dead. More...
 
struct  PrimConv
 Mapping from primitive types to their representation. More...
 
struct  PrimConv< PT_Bool >
 
struct  PrimConv< PT_Ptr >
 
struct  PrimConv< PT_Sint16 >
 
struct  PrimConv< PT_Sint32 >
 
struct  PrimConv< PT_Sint64 >
 
struct  PrimConv< PT_Sint8 >
 
struct  PrimConv< PT_Uint16 >
 
struct  PrimConv< PT_Uint32 >
 
struct  PrimConv< PT_Uint64 >
 
struct  PrimConv< PT_Uint8 >
 
class  Program
 The program contains and links the bytecode for all functions. More...
 
class  Record
 Structure/Class descriptor. More...
 
class  RecordScope
 
struct  Repr
 
struct  Repr< 16, false >
 
struct  Repr< 16, true >
 
struct  Repr< 32, false >
 
struct  Repr< 32, true >
 
struct  Repr< 64, false >
 
struct  Repr< 64, true >
 
struct  Repr< 8, false >
 
struct  Repr< 8, true >
 
class  Scope
 Describes a scope block. More...
 
class  SourceInfo
 Describes the statement/declaration an opcode was generated from. More...
 
class  SourceMapper
 Interface for classes which map locations to sources. More...
 
class  State
 Interface for the VM to interact with the AST walker's context. More...
 
class  SwitchScope
 
class  VariableScope
 Scope chain managing the variable lifetimes. More...
 

Typedefs

using DeclTy = unsigned llvm::PointerUnion< const Decl *, const Expr * >
 
using BlockCtorFn = void(*)(Block *Storage, char *FieldPtr, bool IsConst, bool IsMutable, bool IsActive, Descriptor *FieldDesc)
 Invoked whenever a block is created. More...
 
using BlockDtorFn = void(*)(Block *Storage, char *FieldPtr, Descriptor *FieldDesc)
 Invoked when a block is destroyed. More...
 
using BlockMoveFn = void(*)(Block *Storage, char *SrcFieldPtr, char *DstFieldPtr, Descriptor *FieldDesc)
 Invoked when a block with pointers referencing it goes out of scope. More...
 
using InterpSize = unsigned
 Object size as used by the interpreter. More...
 
using APInt = llvm::APInt
 
using APSInt = llvm::APSInt
 
using CompareFn = llvm::function_ref< bool(ComparisonCategoryResult)>
 
using SourceMap = std::vector< std::pair< unsigned, SourceInfo > >
 

Enumerations

enum  InterpResult { InterpResult::Success, InterpResult::Fail, InterpResult::Bail }
 Wrapper around interpreter termination results. More...
 
enum  Opcode : uint32_t
 
enum  PrimType : unsigned {
  PT_Sint8, PT_Uint8, PT_Sint16, PT_Uint16,
  PT_Sint32, PT_Uint32, PT_Sint64, PT_Uint64,
  PT_Bool, PT_Ptr
}
 Enumeration of the primitive types of the VM. More...
 

Functions

llvm::raw_ostream & operator<< (llvm::raw_ostream &OS, const Boolean &B)
 
template<typename T >
ComparisonCategoryResult Compare (const T &X, const T &Y)
 Helper to compare two comparable types. More...
 
template<unsigned Bits, bool Signed>
llvm::raw_ostream & operator<< (llvm::raw_ostream &OS, Integral< Bits, Signed > I)
 
bool CheckExtern (InterpState &S, CodePtr OpPC, const Pointer &Ptr)
 Checks if the variable has externally defined storage. More...
 
bool CheckArray (InterpState &S, CodePtr OpPC, const Pointer &Ptr)
 Checks if the array is offsetable. More...
 
bool CheckLive (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK)
 Checks if a pointer is live and accesible. More...
 
bool CheckNull (InterpState &S, CodePtr OpPC, const Pointer &Ptr, CheckSubobjectKind CSK)
 Checks if a pointer is null. More...
 
bool CheckRange (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK)
 Checks if a pointer is in range. More...
 
bool CheckRange (InterpState &S, CodePtr OpPC, const Pointer &Ptr, CheckSubobjectKind CSK)
 Checks if a field from which a pointer is going to be derived is valid. More...
 
bool CheckConst (InterpState &S, CodePtr OpPC, const Pointer &Ptr)
 Checks if a pointer points to const storage. More...
 
bool CheckMutable (InterpState &S, CodePtr OpPC, const Pointer &Ptr)
 Checks if a pointer points to a mutable field. More...
 
bool CheckLoad (InterpState &S, CodePtr OpPC, const Pointer &Ptr)
 Checks if a value can be loaded from a block. More...
 
bool CheckStore (InterpState &S, CodePtr OpPC, const Pointer &Ptr)
 Checks if a value can be stored in a block. More...
 
bool CheckInvoke (InterpState &S, CodePtr OpPC, const Pointer &Ptr)
 Checks if a method can be invoked on an object. More...
 
bool CheckInit (InterpState &S, CodePtr OpPC, const Pointer &Ptr)
 Checks if a value can be initialized. More...
 
bool CheckCallable (InterpState &S, CodePtr OpPC, Function *F)
 Checks if a method can be called. More...
 
bool CheckThis (InterpState &S, CodePtr OpPC, const Pointer &This)
 Checks the 'this' pointer. More...
 
bool CheckPure (InterpState &S, CodePtr OpPC, const CXXMethodDecl *MD)
 Checks if a method is pure virtual. More...
 
bool Interpret (InterpState &S, APValue &Result)
 Interpreter entry point. More...
 
template<typename T >
bool ReturnValue (const T &V, APValue &R)
 Convers a value to an APValue. More...
 
template<typename T >
bool IsTrue (const T &V)
 
template<typename T , bool(*)(T, T, unsigned, T *) OpFW, template< typename U > class OpAP>
bool AddSubMulHelper (InterpState &S, CodePtr OpPC, unsigned Bits, const T &LHS, const T &RHS)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Add (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Sub (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Mul (InterpState &S, CodePtr OpPC)
 
template<typename T >
bool CmpHelper (InterpState &S, CodePtr OpPC, CompareFn Fn)
 
template<typename T >
bool CmpHelperEQ (InterpState &S, CodePtr OpPC, CompareFn Fn)
 
template<>
bool CmpHelper< Pointer > (InterpState &S, CodePtr OpPC, CompareFn Fn)
 
template<>
bool CmpHelperEQ< Pointer > (InterpState &S, CodePtr OpPC, CompareFn Fn)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool EQ (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool NE (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool LT (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool LE (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool GT (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool GE (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InRange (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Dup (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Pop (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Const (InterpState &S, CodePtr OpPC, const T &Arg)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool GetLocal (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool SetLocal (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool GetParam (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool SetParam (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool GetField (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool SetField (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool GetFieldPop (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool GetThisField (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool SetThisField (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool GetGlobal (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool SetGlobal (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitGlobal (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitThisField (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitThisBitField (InterpState &S, CodePtr OpPC, const Record::Field *F)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitThisFieldActive (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitField (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitBitField (InterpState &S, CodePtr OpPC, const Record::Field *F)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitFieldActive (InterpState &S, CodePtr OpPC, uint32_t I)
 
bool GetPtrLocal (InterpState &S, CodePtr OpPC, uint32_t I)
 
bool GetPtrParam (InterpState &S, CodePtr OpPC, uint32_t I)
 
bool GetPtrGlobal (InterpState &S, CodePtr OpPC, uint32_t I)
 
bool GetPtrField (InterpState &S, CodePtr OpPC, uint32_t Off)
 
bool GetPtrThisField (InterpState &S, CodePtr OpPC, uint32_t Off)
 
bool GetPtrActiveField (InterpState &S, CodePtr OpPC, uint32_t Off)
 
bool GetPtrActiveThisField (InterpState &S, CodePtr OpPC, uint32_t Off)
 
bool GetPtrBase (InterpState &S, CodePtr OpPC, uint32_t Off)
 
bool GetPtrThisBase (InterpState &S, CodePtr OpPC, uint32_t Off)
 
bool VirtBaseHelper (InterpState &S, CodePtr OpPC, const RecordDecl *Decl, const Pointer &Ptr)
 
bool GetPtrVirtBase (InterpState &S, CodePtr OpPC, const RecordDecl *D)
 
bool GetPtrThisVirtBase (InterpState &S, CodePtr OpPC, const RecordDecl *D)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Load (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool LoadPop (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Store (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool StorePop (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool StoreBitField (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool StoreBitFieldPop (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitPop (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitElem (InterpState &S, CodePtr OpPC, uint32_t Idx)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool InitElemPop (InterpState &S, CodePtr OpPC, uint32_t Idx)
 
template<class T , bool Add>
bool OffsetHelper (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool AddOffset (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool SubOffset (InterpState &S, CodePtr OpPC)
 
bool Destroy (InterpState &S, CodePtr OpPC, uint32_t I)
 
template<PrimType TIn, PrimType TOut>
bool Cast (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Zero (InterpState &S, CodePtr OpPC)
 
template<PrimType Name, class T = typename PrimConv<Name>::T>
bool Null (InterpState &S, CodePtr OpPC)
 
bool This (InterpState &S, CodePtr OpPC)
 
template<PrimType TR, PrimType TL, class T = typename PrimConv<TR>::T>
unsigned Trunc (InterpState &S, CodePtr OpPC, unsigned Bits, const T &V)
 
template<PrimType TL, PrimType TR, typename T = typename PrimConv<TL>::T>
bool ShiftRight (InterpState &S, CodePtr OpPC, const T &V, unsigned RHS)
 
template<PrimType TL, PrimType TR, typename T = typename PrimConv<TL>::T>
bool ShiftLeft (InterpState &S, CodePtr OpPC, const T &V, unsigned RHS)
 
template<PrimType TL, PrimType TR>
bool Shr (InterpState &S, CodePtr OpPC)
 
template<PrimType TL, PrimType TR>
bool Shl (InterpState &S, CodePtr OpPC)
 
bool NoRet (InterpState &S, CodePtr OpPC)
 
bool NarrowPtr (InterpState &S, CodePtr OpPC)
 
bool ExpandPtr (InterpState &S, CodePtr OpPC)
 
llvm::raw_ostream & operator<< (llvm::raw_ostream &OS, const Pointer &P)
 
size_t primSize (PrimType Type)
 Returns the size of a primitive type in bytes. More...
 
constexpr size_t align (size_t Size)
 Aligns a size to the pointer alignment. More...
 
bool isPrimitiveIntegral (PrimType Type)
 

Typedef Documentation

◆ APInt

typedef llvm::APInt clang::interp::APInt

Definition at line 27 of file Integral.h.

◆ APSInt

typedef llvm::APSInt clang::interp::APSInt

Definition at line 28 of file Integral.h.

◆ BlockCtorFn

using clang::interp::BlockCtorFn = typedef void (*)(Block *Storage, char *FieldPtr, bool IsConst, bool IsMutable, bool IsActive, Descriptor *FieldDesc)

Invoked whenever a block is created.

The constructor method fills in the inline descriptors of all fields and array elements. It also initializes all the fields which contain non-trivial types.

Definition at line 33 of file Descriptor.h.

◆ BlockDtorFn

using clang::interp::BlockDtorFn = typedef void (*)(Block *Storage, char *FieldPtr, Descriptor *FieldDesc)

Invoked when a block is destroyed.

Invokes the destructors of all non-trivial nested fields of arrays and records.

Definition at line 38 of file Descriptor.h.

◆ BlockMoveFn

using clang::interp::BlockMoveFn = typedef void (*)(Block *Storage, char *SrcFieldPtr, char *DstFieldPtr, Descriptor *FieldDesc)

Invoked when a block with pointers referencing it goes out of scope.

Such blocks are persisted: the move function copies all inline descriptors and non-trivial fields, as existing pointers might need to reference those descriptors. Data is not copied since it cannot be legally read.

Definition at line 45 of file Descriptor.h.

◆ CompareFn

using clang::interp::CompareFn = typedef llvm::function_ref<bool(ComparisonCategoryResult)>

Definition at line 159 of file Interp.h.

◆ DeclTy

using clang::interp::DeclTy = typedef unsigned llvm::PointerUnion<const Decl *, const Expr *>

Definition at line 26 of file Descriptor.h.

◆ InterpSize

using clang::interp::InterpSize = typedef unsigned

Object size as used by the interpreter.

Definition at line 48 of file Descriptor.h.

◆ SourceMap

using clang::interp::SourceMap = typedef std::vector<std::pair<unsigned, SourceInfo> >

Definition at line 99 of file Source.h.

Enumeration Type Documentation

◆ InterpResult

Wrapper around interpreter termination results.

Enumerator
Success 

Interpreter successfully computed a value.

Fail 

Interpreter encountered an error and quit.

Bail 

Interpreter encountered an unimplemented feature, AST fallback.

Definition at line 38 of file Context.h.

◆ Opcode

enum clang::interp::Opcode : uint32_t

Definition at line 21 of file Opcode.h.

◆ PrimType

enum clang::interp::PrimType : unsigned

Enumeration of the primitive types of the VM.

Enumerator
PT_Sint8 
PT_Uint8 
PT_Sint16 
PT_Uint16 
PT_Sint32 
PT_Uint32 
PT_Sint64 
PT_Uint64 
PT_Bool 
PT_Ptr 

Definition at line 27 of file PrimType.h.

Function Documentation

◆ Add()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Add ( InterpState S,
CodePtr  OpPC 
)

◆ AddOffset()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::AddOffset ( InterpState S,
CodePtr  OpPC 
)

◆ AddSubMulHelper()

template<typename T , bool(*)(T, T, unsigned, T *) OpFW, template< typename U > class OpAP>
bool clang::interp::AddSubMulHelper ( InterpState S,
CodePtr  OpPC,
unsigned  Bits,
const T &  LHS,
const T &  RHS 
)

◆ align()

constexpr size_t clang::interp::align ( size_t  Size)

◆ Cast()

template<PrimType TIn, PrimType TOut>
bool clang::interp::Cast ( InterpState S,
CodePtr  OpPC 
)

◆ CheckArray()

bool clang::interp::CheckArray ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr 
)

Checks if the array is offsetable.

Definition at line 194 of file Interp.cpp.

◆ CheckCallable()

bool clang::interp::CheckCallable ( InterpState S,
CodePtr  OpPC,
Function F 
)

Checks if a method can be called.

Definition at line 333 of file Interp.cpp.

◆ CheckConst()

bool clang::interp::CheckConst ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr 
)

Checks if a pointer points to const storage.

Definition at line 258 of file Interp.cpp.

◆ CheckExtern()

bool clang::interp::CheckExtern ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr 
)

Checks if the variable has externally defined storage.

Definition at line 181 of file Interp.cpp.

Referenced by GetPtrField(), and ReturnValue().

◆ CheckInit()

bool clang::interp::CheckInit ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr 
)

Checks if a value can be initialized.

Definition at line 325 of file Interp.cpp.

Referenced by InitElem(), InitElemPop(), and InitPop().

◆ CheckInvoke()

bool clang::interp::CheckInvoke ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr 
)

Checks if a method can be invoked on an object.

Definition at line 315 of file Interp.cpp.

◆ CheckLive()

bool clang::interp::CheckLive ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr,
AccessKinds  AK 
)

Checks if a pointer is live and accesible.

Definition at line 202 of file Interp.cpp.

◆ CheckLoad()

bool clang::interp::CheckLoad ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr 
)

Checks if a value can be loaded from a block.

Definition at line 283 of file Interp.cpp.

Referenced by GetField(), GetFieldPop(), GetThisField(), Load(), and LoadPop().

◆ CheckMutable()

bool clang::interp::CheckMutable ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr 
)

Checks if a pointer points to a mutable field.

Definition at line 270 of file Interp.cpp.

◆ CheckNull()

bool clang::interp::CheckNull ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr,
CheckSubobjectKind  CSK 
)

Checks if a pointer is null.

Definition at line 231 of file Interp.cpp.

Referenced by GetField(), GetFieldPop(), GetPtrActiveField(), GetPtrBase(), GetPtrField(), GetPtrVirtBase(), OffsetHelper(), and SetField().

◆ CheckPure()

bool clang::interp::CheckPure ( InterpState S,
CodePtr  OpPC,
const CXXMethodDecl MD 
)

Checks if a method is pure virtual.

Definition at line 393 of file Interp.cpp.

◆ CheckRange() [1/2]

bool clang::interp::CheckRange ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr,
AccessKinds  AK 
)

Checks if a pointer is in range.

Definition at line 240 of file Interp.cpp.

Referenced by GetField(), GetFieldPop(), GetPtrActiveField(), GetPtrField(), clang::interp::Integral< Bits, Signed >::mul(), OffsetHelper(), and SetField().

◆ CheckRange() [2/2]

bool clang::interp::CheckRange ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr,
CheckSubobjectKind  CSK 
)

Checks if a field from which a pointer is going to be derived is valid.

Definition at line 249 of file Interp.cpp.

◆ CheckStore()

bool clang::interp::CheckStore ( InterpState S,
CodePtr  OpPC,
const Pointer Ptr 
)

Checks if a value can be stored in a block.

Definition at line 301 of file Interp.cpp.

Referenced by SetField(), SetThisField(), Store(), StoreBitField(), StoreBitFieldPop(), and StorePop().

◆ CheckThis()

bool clang::interp::CheckThis ( InterpState S,
CodePtr  OpPC,
const Pointer This 
)

◆ CmpHelper()

template<typename T >
bool clang::interp::CmpHelper ( InterpState S,
CodePtr  OpPC,
CompareFn  Fn 
)

◆ CmpHelper< Pointer >()

template<>
bool clang::interp::CmpHelper< Pointer > ( InterpState S,
CodePtr  OpPC,
CompareFn  Fn 
)
inline

Definition at line 176 of file Interp.h.

◆ CmpHelperEQ()

template<typename T >
bool clang::interp::CmpHelperEQ ( InterpState S,
CodePtr  OpPC,
CompareFn  Fn 
)

Definition at line 171 of file Interp.h.

◆ CmpHelperEQ< Pointer >()

template<>
bool clang::interp::CmpHelperEQ< Pointer > ( InterpState S,
CodePtr  OpPC,
CompareFn  Fn 
)
inline

Definition at line 194 of file Interp.h.

◆ Compare()

template<typename T >
ComparisonCategoryResult clang::interp::Compare ( const T &  X,
const T &  Y 
)

◆ Const()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Const ( InterpState S,
CodePtr  OpPC,
const T &  Arg 
)

◆ Destroy()

bool clang::interp::Destroy ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)
inline

◆ Dup()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Dup ( InterpState S,
CodePtr  OpPC 
)

◆ EQ()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::EQ ( InterpState S,
CodePtr  OpPC 
)

◆ ExpandPtr()

bool clang::interp::ExpandPtr ( InterpState S,
CodePtr  OpPC 
)
inline

◆ GE()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::GE ( InterpState S,
CodePtr  OpPC 
)

Definition at line 255 of file Interp.h.

Referenced by isKnownToHaveUnsignedValue(), and clang::Expr::isNullPointerConstant().

◆ GetField()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::GetField ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ GetFieldPop()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::GetFieldPop ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ GetGlobal()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::GetGlobal ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ GetLocal()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::GetLocal ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ GetParam()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::GetParam ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ GetPtrActiveField()

bool clang::interp::GetPtrActiveField ( InterpState S,
CodePtr  OpPC,
uint32_t  Off 
)
inline

◆ GetPtrActiveThisField()

bool clang::interp::GetPtrActiveThisField ( InterpState S,
CodePtr  OpPC,
uint32_t  Off 
)
inline

◆ GetPtrBase()

bool clang::interp::GetPtrBase ( InterpState S,
CodePtr  OpPC,
uint32_t  Off 
)
inline

◆ GetPtrField()

bool clang::interp::GetPtrField ( InterpState S,
CodePtr  OpPC,
uint32_t  Off 
)
inline

◆ GetPtrGlobal()

bool clang::interp::GetPtrGlobal ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)
inline

◆ GetPtrLocal()

bool clang::interp::GetPtrLocal ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)
inline

◆ GetPtrParam()

bool clang::interp::GetPtrParam ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)
inline

◆ GetPtrThisBase()

bool clang::interp::GetPtrThisBase ( InterpState S,
CodePtr  OpPC,
uint32_t  Off 
)
inline

◆ GetPtrThisField()

bool clang::interp::GetPtrThisField ( InterpState S,
CodePtr  OpPC,
uint32_t  Off 
)
inline

◆ GetPtrThisVirtBase()

bool clang::interp::GetPtrThisVirtBase ( InterpState S,
CodePtr  OpPC,
const RecordDecl D 
)
inline

◆ GetPtrVirtBase()

bool clang::interp::GetPtrVirtBase ( InterpState S,
CodePtr  OpPC,
const RecordDecl D 
)
inline

◆ GetThisField()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::GetThisField ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ GT()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::GT ( InterpState S,
CodePtr  OpPC 
)

◆ InitBitField()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitBitField ( InterpState S,
CodePtr  OpPC,
const Record::Field F 
)

◆ InitElem()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitElem ( InterpState S,
CodePtr  OpPC,
uint32_t  Idx 
)

◆ InitElemPop()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitElemPop ( InterpState S,
CodePtr  OpPC,
uint32_t  Idx 
)

◆ InitField()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitField ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ InitFieldActive()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitFieldActive ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

Definition at line 488 of file Interp.h.

References clang::interp::InterpStack::pop(), and clang::interp::InterpState::Stk.

◆ InitGlobal()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitGlobal ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ InitPop()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitPop ( InterpState S,
CodePtr  OpPC 
)

◆ InitThisBitField()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitThisBitField ( InterpState S,
CodePtr  OpPC,
const Record::Field F 
)

◆ InitThisField()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitThisField ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ InitThisFieldActive()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InitThisFieldActive ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ InRange()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::InRange ( InterpState S,
CodePtr  OpPC 
)

◆ Interpret()

bool clang::interp::Interpret ( InterpState S,
APValue Result 
)

Interpreter entry point.

Definition at line 401 of file Interp.cpp.

Referenced by ExpandPtr().

◆ isPrimitiveIntegral()

bool clang::interp::isPrimitiveIntegral ( PrimType  Type)
inline

Definition at line 61 of file PrimType.h.

References PT_Bool, PT_Sint16, PT_Sint32, PT_Sint64, PT_Sint8, PT_Uint16, PT_Uint32, PT_Uint64, and PT_Uint8.

◆ IsTrue()

template<typename T >
bool clang::interp::IsTrue ( const T &  V)
inline

Definition at line 94 of file Interp.h.

References bool.

◆ LE()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::LE ( InterpState S,
CodePtr  OpPC 
)

◆ Load()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Load ( InterpState S,
CodePtr  OpPC 
)

◆ LoadPop()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::LoadPop ( InterpState S,
CodePtr  OpPC 
)

◆ LT()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::LT ( InterpState S,
CodePtr  OpPC 
)

◆ Mul()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Mul ( InterpState S,
CodePtr  OpPC 
)

◆ NarrowPtr()

bool clang::interp::NarrowPtr ( InterpState S,
CodePtr  OpPC 
)
inline

◆ NE()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::NE ( InterpState S,
CodePtr  OpPC 
)

◆ NoRet()

bool clang::interp::NoRet ( InterpState S,
CodePtr  OpPC 
)
inline

◆ Null()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Null ( InterpState S,
CodePtr  OpPC 
)
inline

◆ OffsetHelper()

template<class T , bool Add>
bool clang::interp::OffsetHelper ( InterpState S,
CodePtr  OpPC 
)

◆ operator<<() [1/3]

llvm::raw_ostream& clang::interp::operator<< ( llvm::raw_ostream &  OS,
const Boolean B 
)
inline

Definition at line 140 of file Boolean.h.

References clang::interp::Boolean::print().

◆ operator<<() [2/3]

template<unsigned Bits, bool Signed>
llvm::raw_ostream& clang::interp::operator<< ( llvm::raw_ostream &  OS,
Integral< Bits, Signed >  I 
)

Definition at line 261 of file Integral.h.

◆ operator<<() [3/3]

llvm::raw_ostream& clang::interp::operator<< ( llvm::raw_ostream &  OS,
const Pointer P 
)
inline

Definition at line 345 of file Pointer.h.

References clang::interp::Pointer::print().

◆ Pop()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Pop ( InterpState S,
CodePtr  OpPC 
)

◆ primSize()

size_t clang::interp::primSize ( PrimType  Type)

Returns the size of a primitive type in bytes.

Definition at line 17 of file PrimType.cpp.

References TYPE_SWITCH.

Referenced by clang::interp::ByteCodeEmitter::compileFunc(), clang::interp::Program::createDescriptor(), and clang::interp::InterpFrame::describe().

◆ ReturnValue()

template<typename T >
bool clang::interp::ReturnValue ( const T &  V,
APValue R 
)

◆ SetField()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::SetField ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ SetGlobal()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::SetGlobal ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

Definition at line 415 of file Interp.h.

◆ SetLocal()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::SetLocal ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ SetParam()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::SetParam ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ SetThisField()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::SetThisField ( InterpState S,
CodePtr  OpPC,
uint32_t  I 
)

◆ ShiftLeft()

template<PrimType TL, PrimType TR, typename T = typename PrimConv<TL>::T>
bool clang::interp::ShiftLeft ( InterpState S,
CodePtr  OpPC,
const T &  V,
unsigned  RHS 
)
inline

◆ ShiftRight()

template<PrimType TL, PrimType TR, typename T = typename PrimConv<TL>::T>
bool clang::interp::ShiftRight ( InterpState S,
CodePtr  OpPC,
const T &  V,
unsigned  RHS 
)
inline

◆ Shl()

template<PrimType TL, PrimType TR>
bool clang::interp::Shl ( InterpState S,
CodePtr  OpPC 
)
inline

◆ Shr()

template<PrimType TL, PrimType TR>
bool clang::interp::Shr ( InterpState S,
CodePtr  OpPC 
)
inline

◆ Store()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Store ( InterpState S,
CodePtr  OpPC 
)

◆ StoreBitField()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::StoreBitField ( InterpState S,
CodePtr  OpPC 
)

◆ StoreBitFieldPop()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::StoreBitFieldPop ( InterpState S,
CodePtr  OpPC 
)

◆ StorePop()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::StorePop ( InterpState S,
CodePtr  OpPC 
)

◆ Sub()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Sub ( InterpState S,
CodePtr  OpPC 
)

◆ SubOffset()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::SubOffset ( InterpState S,
CodePtr  OpPC 
)

Definition at line 785 of file Interp.h.

◆ This()

bool clang::interp::This ( InterpState S,
CodePtr  OpPC 
)
inline

Definition at line 830 of file Interp.h.

References clang::interp::InterpState::checkingPotentialConstantExpression(), CheckThis(), clang::interp::InterpState::Current, clang::interp::InterpFrame::getThis(), clang::interp::InterpStack::push(), and clang::interp::InterpState::Stk.

Referenced by clang::CodeGen::CGCXXABI::adjustThisArgumentForVirtualFunctionCall(), clang::Sema::BuildCXXThisExpr(), clang::Sema::CheckDestructor(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitLambdaToBlockPointerConversion(), clang::Sema::DefineImplicitMoveAssignment(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CodeGenFunction::EmitDelegateCXXConstructorCall(), emitRTtypeidCall(), EvaluateComplex(), EvaluateMemberPointer(), EvaluateVector(), clang::CodeGen::CodeGenFunction::FieldConstructionScope::FieldConstructionScope(), forConstantArrayExpansion(), clang::CodeGen::CodeGenFunction::GetAddressOfDirectBaseInCompleteClass(), getBadTypeidFn(), clang::Sema::ImplicitExceptionSpecification::getExceptionSpec(), getPrettyTypeName(), HandleConstructorCall(), HandleDestruction(), HandleDestructionImpl(), hasDefaultCXXMethodCC(), llvm::DenseMapInfo< ObjCSummaryKey >::isEqual(), clang::Expr::isImplicitCXXThis(), clang::CodeGen::CGCXXABI::isSRetParameterAfterThis(), clang::Module::isSubModuleOf(), clang::CodeGen::CodeGenFunction::LoadCXXVTT(), clang::ComparisonCategories::lookupInfo(), MaybeElementDependentArrayFiller(), clang::ento::ExprEngine::processCallExit(), and clang::TreeTransform< Derived >::TransformFunctionProtoType().

◆ Trunc()

template<PrimType TR, PrimType TL, class T = typename PrimConv<TR>::T>
unsigned clang::interp::Trunc ( InterpState S,
CodePtr  OpPC,
unsigned  Bits,
const T &  V 
)

◆ VirtBaseHelper()

bool clang::interp::VirtBaseHelper ( InterpState S,
CodePtr  OpPC,
const RecordDecl Decl,
const Pointer Ptr 
)
inline

◆ Zero()

template<PrimType Name, class T = typename PrimConv<Name>::T>
bool clang::interp::Zero ( InterpState S,
CodePtr  OpPC 
)