clang 20.0.0git
Namespaces | Macros | Functions
InterpBuiltin.cpp File Reference
#include "../ExprConstShared.h"
#include "Boolean.h"
#include "Compiler.h"
#include "EvalEmitter.h"
#include "Interp.h"
#include "PrimType.h"
#include "clang/AST/OSLog.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/Support/SipHash.h"

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 RET_CASE(X)
 

Functions

static unsigned clang::interp::callArgSize (const InterpState &S, const CallExpr *C)
 
template<typename T >
static T clang::interp::getParam (const InterpFrame *Frame, unsigned Index)
 
PrimType clang::interp::getIntPrimType (const InterpState &S)
 
PrimType clang::interp::getLongPrimType (const InterpState &S)
 
static APSInt clang::interp::peekToAPSInt (InterpStack &Stk, PrimType T, size_t Offset=0)
 Peek an integer value from the stack into an APSInt.
 
static void clang::interp::pushInteger (InterpState &S, const APSInt &Val, QualType QT)
 Pushes Val on the stack as the type given by QT.
 
template<typename T >
static void clang::interp::pushInteger (InterpState &S, T Val, QualType QT)
 
static void clang::interp::assignInteger (Pointer &Dest, PrimType ValueT, const APSInt &Value)
 
static bool clang::interp::retPrimValue (InterpState &S, CodePtr OpPC, APValue &Result, std::optional< PrimType > &T)
 
static bool clang::interp::interp__builtin_is_constant_evaluated (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_strcmp (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_strlen (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_nan (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, bool Signaling)
 
static bool clang::interp::interp__builtin_inf (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F)
 
static bool clang::interp::interp__builtin_copysign (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F)
 
static bool clang::interp::interp__builtin_fmin (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F)
 
static bool clang::interp::interp__builtin_fmax (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func)
 
static bool clang::interp::interp__builtin_isnan (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, const CallExpr *Call)
 Defined as __builtin_isnan(...), to accommodate the fact that it can take a float, double, long double, etc.
 
static bool clang::interp::interp__builtin_issignaling (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_isinf (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, bool CheckSign, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_isfinite (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_isnormal (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_issubnormal (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_iszero (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_signbit (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, const CallExpr *Call)
 
static bool clang::interp::interp_floating_comparison (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *F, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_isfpclass (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 First parameter to __builtin_isfpclass is the floating value, the second one is an integral value.
 
static bool clang::interp::interp__builtin_fpclassify (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 Five int values followed by one floating value.
 
static bool clang::interp::interp__builtin_fabs (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func)
 
static bool clang::interp::interp__builtin_popcount (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_parity (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_clrsb (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_bitreverse (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_classify_type (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_expect (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_rotate (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call, bool Right)
 rotateleft(value, amount)
 
static bool clang::interp::interp__builtin_ffs (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_addressof (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_move (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_eh_return_data_regno (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::noopPointer (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 Just takes the first Argument to the call and puts it on the stack.
 
static bool clang::interp::interp__builtin_overflowop (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_carryop (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 Three integral values followed by a pointer (lhs, rhs, carry, carryOut).
 
static bool clang::interp::interp__builtin_clz (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_ctz (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_bswap (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_atomic_lock_free (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 bool __atomic_always_lock_free(size_t, void const volatile*) bool __atomic_is_lock_free(size_t, void const volatile*) bool __c11_atomic_is_lock_free(size_t)
 
static bool clang::interp::interp__builtin_complex (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 __builtin_complex(Float A, float B);
 
static bool clang::interp::interp__builtin_is_aligned_up_down (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 __builtin_is_aligned() __builtin_align_up() __builtin_align_down() The first parameter is either an integer or a pointer.
 
static bool clang::interp::interp__builtin_os_log_format_buffer_size (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_ptrauth_string_discriminator (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
static bool clang::interp::interp__builtin_constant_p (InterpState &S, CodePtr OpPC, const InterpFrame *Frame, const Function *Func, const CallExpr *Call)
 
bool clang::interp::InterpretBuiltin (InterpState &S, CodePtr OpPC, const Function *F, const CallExpr *Call)
 Interpret a builtin function.
 
bool clang::interp::InterpretOffsetOf (InterpState &S, CodePtr OpPC, const OffsetOfExpr *E, llvm::ArrayRef< int64_t > ArrayIndices, int64_t &Result)
 Interpret an offsetof operation.
 
bool clang::interp::SetThreeWayComparisonField (InterpState &S, CodePtr OpPC, const Pointer &Ptr, const APSInt &IntValue)
 Sets the given integral value to the pointer, which is of a std::{weak,partial,strong}_ordering type.
 
static bool clang::interp::copyComposite (InterpState &S, CodePtr OpPC, const Pointer &Src, Pointer &Dest, bool Activate)
 
static bool clang::interp::copyRecord (InterpState &S, CodePtr OpPC, const Pointer &Src, Pointer &Dest, bool Activate=false)
 
bool clang::interp::DoMemcpy (InterpState &S, CodePtr OpPC, const Pointer &Src, Pointer &Dest)
 Copy the contents of Src into Dest.
 

Macro Definition Documentation

◆ RET_CASE

#define RET_CASE (   X)
Value:
case X: \
return Ret<X>(S, OpPC, Result);
#define X(type, name)
Definition: Value.h:143