14#ifndef LLVM_CLANG_LIB_AST_EXPRCONSTSHARED_H
15#define LLVM_CLANG_LIB_AST_EXPRCONSTSHARED_H
79 llvm::APFloat D, llvm::APFloat &ResR,
82 llvm::APFloat D, llvm::APFloat &ResR,
86 UnaryExprOrTypeTrait ExprKind);
111 const llvm::APSInt &Imm,
bool Inverse =
false);
113 const llvm::APSInt &Amount);
115std::optional<llvm::APFloat>
117 std::optional<llvm::APSInt> RoundingMode,
bool IsMin);
128 case ConstantExprKind::Normal:
129 case ConstantExprKind::ClassTemplateArgument:
130 case ConstantExprKind::ImmediateInvocation:
131 case ConstantExprKind::Initializer:
136 case ConstantExprKind::NonClassTemplateArgument:
139 llvm_unreachable(
"unknown ConstantExprKind");
144 case ConstantExprKind::Normal:
145 case ConstantExprKind::ImmediateInvocation:
146 case ConstantExprKind::Initializer:
149 case ConstantExprKind::ClassTemplateArgument:
150 case ConstantExprKind::NonClassTemplateArgument:
153 llvm_unreachable(
"unknown ConstantExprKind");
159 return (
Builtin == Builtin::BI__builtin___CFStringMakeConstantString ||
160 Builtin == Builtin::BI__builtin___NSStringMakeConstantString ||
161 Builtin == Builtin::BI__builtin_ptrauth_sign_constant ||
162 Builtin == Builtin::BI__builtin_function_start);
Defines enumerations for traits support.
const Expr * ignorePointerCastsAndParens(const Expr *E)
A more selective version of E->IgnoreParenCasts for tryEvaluateBuiltinObjectSize. This ignores some c...
bool isReadByLvalueToRvalueConversion(const CXXRecordDecl *RD)
Determine whether a type would actually be read by an lvalue-to-rvalue conversion.
bool isTemplateArgument(ConstantExprKind Kind)
unsigned ConvertBuiltinIDToX86BuiltinID(const ASTContext &Ctx, unsigned BuiltinID)
Convert a builtin ID to the canonical x86 builtin ID the constant evaluators dispatch on in their x86...
uint8_t GFNIAffine(uint8_t XByte, const llvm::APInt &AQword, const llvm::APSInt &Imm, bool Inverse=false)
CharUnits GetAlignOfExpr(const ASTContext &Ctx, const Expr *E, UnaryExprOrTypeTrait ExprKind)
bool isOpaqueConstantCall(const CallExpr *E)
Should this call expression be treated as forming an opaque constant?
bool isForManglingOnly(ConstantExprKind Kind)
Determines whether the given kind of constant expression is only ever used for name mangling.
llvm::APSInt NormalizeRotateAmount(const llvm::APSInt &Value, const llvm::APSInt &Amount)
bool isGlobalLValue(const ValueDecl *D, const Expr *E)
bool FunctionDefinitionCanBeLazilyInstantiated(const FunctionDecl *FD)
Whether we can instantiate FD during constant evaluation.
GCCTypeClass EvaluateBuiltinClassifyType(QualType T, const LangOptions &LangOpts)
EvaluateBuiltinClassifyType - Evaluate __builtin_classify_type the same way as GCC.
void HandleComplexComplexMul(llvm::APFloat A, llvm::APFloat B, llvm::APFloat C, llvm::APFloat D, llvm::APFloat &ResR, llvm::APFloat &ResI)
std::optional< llvm::APFloat > EvalScalarMinMaxFp(const llvm::APFloat &A, const llvm::APFloat &B, std::optional< llvm::APSInt > RoundingMode, bool IsMin)
GCCTypeClass
Values returned by __builtin_classify_type, chosen to match the values produced by GCC's builtin.
@ PointerToMemberFunction
uint8_t GFNIMul(uint8_t AByte, uint8_t BByte)
void HandleComplexComplexDiv(llvm::APFloat A, llvm::APFloat B, llvm::APFloat C, llvm::APFloat D, llvm::APFloat &ResR, llvm::APFloat &ResI)
uint8_t GFNIMultiplicativeInverse(uint8_t Byte)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a C++ struct/union/class.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
unsigned getBuiltinCallee() const
getBuiltinCallee - If this is a call to a builtin, return the builtin ID of the callee.
This is an opaque type for sizes expressed in character units.
This represents one expression.
Represents a function declaration or definition.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
A (possibly-)qualified type.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Top level wrappers for InstallAPI frontend operations.
DynAllocKind
Kind of source for a dynamic allocation.
Expr::ConstantExprKind ConstantExprKind
@ Vector
'vector' clause, allowed on 'loop', Combined, and 'routine' directives.
const FunctionProtoType * T
@ Union
The "union" keyword introduces the elaborated-type-specifier.
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
CharUnits GetAlignOfDynamicAlloc(const ASTContext &Ctx, QualType AllocType, DynAllocKind AllocKind)
Diagnostic wrappers for TextAPI types for error reporting.
__builtin_bitreverse32 uint32_t __builtin_riscv_aaddu_u32 __builtin_riscv_asubu_u32 __builtin_elementwise_add_sat __builtin_elementwise_sub_sat int32_t uint32_t uint32_t __builtin_riscv_mhacc_i32 __builtin_riscv_mhaccu_u32 __builtin_riscv_mhaccsu_i32 __builtin_riscv_mulq_i32 __builtin_riscv_mqwacc_i64 uint8_t