clang 20.0.0git
|
#include "Interp.h"
#include "Function.h"
#include "InterpFrame.h"
#include "InterpShared.h"
#include "InterpStack.h"
#include "Opcode.h"
#include "PrimType.h"
#include "Program.h"
#include "State.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/StringExtras.h"
#include <limits>
#include <vector>
#include "Opcodes.inc"
Go to the source code of this file.
Namespaces | |
namespace | clang |
The JSON file list parser is used to communicate input to InstallAPI. | |
namespace | clang::interp |
Macros | |
#define | GET_INTERP |
Functions | |
static bool | RetValue (InterpState &S, CodePtr &Pt, APValue &Result) |
static bool | Jmp (InterpState &S, CodePtr &PC, int32_t Offset) |
static bool | Jt (InterpState &S, CodePtr &PC, int32_t Offset) |
static bool | Jf (InterpState &S, CodePtr &PC, int32_t Offset) |
static void | diagnoseMissingInitializer (InterpState &S, CodePtr OpPC, const ValueDecl *VD) |
static void | diagnoseNonConstVariable (InterpState &S, CodePtr OpPC, const ValueDecl *VD) |
static bool | diagnoseUnknownDecl (InterpState &S, CodePtr OpPC, const ValueDecl *D) |
static bool | CheckActive (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) |
static bool | CheckTemporary (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) |
static bool | CheckGlobal (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
static void | clang::interp::popArg (InterpState &S, const Expr *Arg) |
void | clang::interp::cleanupAfterFunctionCall (InterpState &S, CodePtr OpPC) |
bool | clang::interp::CheckExtern (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
Checks if the variable has externally defined storage. | |
bool | clang::interp::CheckArray (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
Checks if the array is offsetable. | |
bool | clang::interp::CheckLive (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) |
Checks if a pointer is live and accessible. | |
bool | clang::interp::CheckConstant (InterpState &S, CodePtr OpPC, const Descriptor *Desc) |
Checks if the Descriptor is of a constexpr or const global variable. | |
static bool | clang::interp::CheckConstant (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
bool | clang::interp::CheckNull (InterpState &S, CodePtr OpPC, const Pointer &Ptr, CheckSubobjectKind CSK) |
Checks if a pointer is null. | |
bool | clang::interp::CheckRange (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) |
Checks if a pointer is in range. | |
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. | |
bool | clang::interp::CheckSubobject (InterpState &S, CodePtr OpPC, const Pointer &Ptr, CheckSubobjectKind CSK) |
Checks if Ptr is a one-past-the-end pointer. | |
bool | clang::interp::CheckDowncast (InterpState &S, CodePtr OpPC, const Pointer &Ptr, uint32_t Offset) |
Checks if the dowcast using the given offset is possible with the given pointer. | |
bool | clang::interp::CheckConst (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
Checks if a pointer points to const storage. | |
bool | clang::interp::CheckMutable (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
Checks if a pointer points to a mutable field. | |
bool | clang::interp::CheckVolatile (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) |
bool | clang::interp::CheckInitialized (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) |
bool | clang::interp::CheckGlobalInitialized (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
Check if a global variable is initialized. | |
bool | clang::interp::CheckLoad (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK=AK_Read) |
Checks if a value can be loaded from a block. | |
bool | clang::interp::CheckFinalLoad (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
This is not used by any of the opcodes directly. | |
bool | clang::interp::CheckStore (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
Checks if a value can be stored in a block. | |
bool | clang::interp::CheckInvoke (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
Checks if a method can be invoked on an object. | |
bool | clang::interp::CheckInit (InterpState &S, CodePtr OpPC, const Pointer &Ptr) |
Checks if a value can be initialized. | |
bool | clang::interp::CheckCallable (InterpState &S, CodePtr OpPC, const Function *F) |
Checks if a method can be called. | |
bool | clang::interp::CheckCallDepth (InterpState &S, CodePtr OpPC) |
Checks if calling the currently active function would exceed the allowed call depth. | |
bool | clang::interp::CheckThis (InterpState &S, CodePtr OpPC, const Pointer &This) |
Checks the 'this' pointer. | |
bool | clang::interp::CheckPure (InterpState &S, CodePtr OpPC, const CXXMethodDecl *MD) |
Checks if a method is pure virtual. | |
bool | clang::interp::CheckFloatResult (InterpState &S, CodePtr OpPC, const Floating &Result, APFloat::opStatus Status) |
Checks if the result of a floating-point operation is valid in the current context. | |
bool | clang::interp::CheckDynamicMemoryAllocation (InterpState &S, CodePtr OpPC) |
Checks if dynamic memory allocation is available in the current language mode. | |
bool | clang::interp::CheckNewDeleteForms (InterpState &S, CodePtr OpPC, bool NewWasArray, bool DeleteIsArray, const Descriptor *D, const Expr *NewExpr) |
Diagnose mismatched new[]/delete or new/delete[] pairs. | |
bool | clang::interp::CheckDeleteSource (InterpState &S, CodePtr OpPC, const Expr *Source, const Pointer &Ptr) |
Check the source of the pointer passed to delete/delete[] has actually been heap allocated by us. | |
bool | clang::interp::CheckDeclRef (InterpState &S, CodePtr OpPC, const DeclRefExpr *DR) |
We aleady know the given DeclRefExpr is invalid for some reason, now figure out why and print appropriate diagnostics. | |
bool | clang::interp::CheckDummy (InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) |
Checks if a pointer is a dummy pointer. | |
bool | clang::interp::CheckNonNullArgs (InterpState &S, CodePtr OpPC, const Function *F, const CallExpr *CE, unsigned ArgSize) |
Checks if all the arguments annotated as 'nonnull' are in fact not null. | |
static bool | clang::interp::runRecordDestructor (InterpState &S, CodePtr OpPC, const Pointer &BasePtr, const Descriptor *Desc) |
bool | clang::interp::RunDestructors (InterpState &S, CodePtr OpPC, const Block *B) |
void | clang::interp::diagnoseEnumValue (InterpState &S, CodePtr OpPC, const EnumDecl *ED, const APSInt &Value) |
bool | clang::interp::Interpret (InterpState &S, APValue &Result) |
Interpreter entry point. | |
#define GET_INTERP |
|
static |
Definition at line 123 of file Interp.cpp.
References clang::C, clang::interp::Record::fields(), clang::interp::Pointer::getBase(), clang::interp::Pointer::getField(), clang::interp::Pointer::inUnion(), clang::interp::Pointer::isActive(), clang::interp::Pointer::isField(), clang::interp::Record::isUnion(), and Loc.
Referenced by clang::interp::CheckFinalLoad(), and clang::interp::CheckLoad().
|
static |
Definition at line 198 of file Interp.cpp.
References clang::interp::Pointer::getDeclID(), and clang::interp::Pointer::isStatic().
Referenced by clang::interp::CheckStore().
|
static |
Definition at line 178 of file Interp.cpp.
References E, clang::interp::Pointer::getDeclDesc(), clang::interp::Pointer::getDeclID(), clang::interp::Pointer::getDeclLoc(), clang::interp::Descriptor::getType(), clang::QualType::isConstQualified(), and clang::interp::Pointer::isStaticTemporary().
Referenced by clang::interp::CheckFinalLoad(), and clang::interp::CheckLoad().
|
static |
Definition at line 59 of file Interp.cpp.
References E, clang::Decl::getLocation(), and clang::Decl::getSourceRange().
Referenced by clang::interp::CheckInitialized(), diagnoseNonConstVariable(), and diagnoseUnknownDecl().
|
static |
Definition at line 91 of file Interp.cpp.
References diagnoseMissingInitializer(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Type::isIntegralOrEnumerationType(), and Loc.
Referenced by clang::interp::CheckConstant(), clang::interp::CheckExtern(), and diagnoseUnknownDecl().
|
static |
Definition at line 68 of file Interp.cpp.
References D, diagnoseMissingInitializer(), diagnoseNonConstVariable(), E, clang::Sema::getLangOpts(), clang::Decl::getLocation(), and clang::Decl::getSourceRange().
Referenced by clang::interp::CheckDeclRef(), and clang::interp::CheckDummy().
|
static |
Definition at line 52 of file Interp.cpp.
|
static |
Definition at line 40 of file Interp.cpp.
|
static |
Definition at line 45 of file Interp.cpp.
|
static |
Definition at line 32 of file Interp.cpp.
Referenced by clang::ast_matchers::AST_MATCHER_P().