(BuiltinID == AArch64::BI__builtin_arm_irg) {
41 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_pointer)
50 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_integer)
54TheCall->
setType(FirstArgType);
58 if(BuiltinID == AArch64::BI__builtin_arm_addg) {
68 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_pointer)
73TheCall->
setType(FirstArgType);
79 if(BuiltinID == AArch64::BI__builtin_arm_gmi) {
90 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_pointer)
95 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_integer)
97TheCall->
setType(Context.IntTy);
101 if(BuiltinID == AArch64::BI__builtin_arm_ldg ||
102BuiltinID == AArch64::BI__builtin_arm_stg) {
112 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_must_be_pointer)
117 if(BuiltinID == AArch64::BI__builtin_arm_ldg)
118TheCall->
setType(FirstArgType);
122 if(BuiltinID == AArch64::BI__builtin_arm_subp) {
135 autoisNull = [&](
Expr*
E) ->
bool{
136 return E->isNullPointerConstant(Context,
142 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_null_or_pointer)
146 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_arg_null_or_pointer)
154 if(!Context.typesAreCompatible(
155Context.getCanonicalType(pointeeA).getUnqualifiedType(),
156Context.getCanonicalType(pointeeB).getUnqualifiedType())) {
158diag::err_typecheck_sub_ptr_compatible)
166 return Diag(TheCall->
getBeginLoc(), diag::err_memtag_any2arg_pointer)
179TheCall->
setType(Context.LongLongTy);
182assert(
false&&
"Unhandled ARM MTE intrinsic");
189 intArgNum,
unsignedExpectedFieldNum,
191 boolIsARMBuiltin = BuiltinID == ARM::BI__builtin_arm_rsr64 ||
192BuiltinID == ARM::BI__builtin_arm_wsr64 ||
193BuiltinID == ARM::BI__builtin_arm_rsr ||
194BuiltinID == ARM::BI__builtin_arm_rsrp ||
195BuiltinID == ARM::BI__builtin_arm_wsr ||
196BuiltinID == ARM::BI__builtin_arm_wsrp;
197 boolIsAArch64Builtin = BuiltinID == AArch64::BI__builtin_arm_rsr64 ||
198BuiltinID == AArch64::BI__builtin_arm_wsr64 ||
199BuiltinID == AArch64::BI__builtin_arm_rsr128 ||
200BuiltinID == AArch64::BI__builtin_arm_wsr128 ||
201BuiltinID == AArch64::BI__builtin_arm_rsr ||
202BuiltinID == AArch64::BI__builtin_arm_rsrp ||
203BuiltinID == AArch64::BI__builtin_arm_wsr ||
204BuiltinID == AArch64::BI__builtin_arm_wsrp;
205assert((IsARMBuiltin || IsAArch64Builtin) &&
"Unexpected ARM builtin.");
214 return Diag(TheCall->
getBeginLoc(), diag::err_expr_not_string_literal)
220Reg.split(Fields,
":");
222 if(Fields.size() != ExpectedFieldNum && !(AllowName && Fields.size() == 1))
223 return Diag(TheCall->
getBeginLoc(), diag::err_arm_invalid_specialreg)
230 if(Fields.size() > 1) {
231 boolFiveFields = Fields.size() == 5;
233 boolValidString =
true;
235ValidString &= Fields[0].starts_with_insensitive(
"cp") ||
236Fields[0].starts_with_insensitive(
"p");
238Fields[0] = Fields[0].drop_front(
239Fields[0].starts_with_insensitive(
"cp") ? 2 : 1);
241ValidString &= Fields[2].starts_with_insensitive(
"c");
243Fields[2] = Fields[2].drop_front(1);
246ValidString &= Fields[3].starts_with_insensitive(
"c");
248Fields[3] = Fields[3].drop_front(1);
254Ranges.append({IsAArch64Builtin ? 1 : 15, 7, 15, 15, 7});
256Ranges.append({15, 7, 15});
258 for(
unsignedi = 0; i < Fields.size(); ++i) {
260ValidString &= !Fields[i].getAsInteger(10, IntField);
261ValidString &= (IntField >= 0 && IntField <= Ranges[i]);
265 return Diag(TheCall->
getBeginLoc(), diag::err_arm_invalid_specialreg)
267}
else if(IsAArch64Builtin && Fields.size() == 1) {
275 if(BuiltinID == AArch64::BI__builtin_arm_rsr128 ||
276BuiltinID == AArch64::BI__builtin_arm_wsr128)
281 autoMaxLimit = llvm::StringSwitch<std::optional<unsigned>>(Reg)
282.CaseLower(
"spsel", 15)
283.CaseLower(
"daifclr", 15)
284.CaseLower(
"daifset", 15)
285.CaseLower(
"pan", 15)
286.CaseLower(
"uao", 15)
287.CaseLower(
"dit", 15)
288.CaseLower(
"ssbs", 15)
289.CaseLower(
"tco", 15)
290.CaseLower(
"allint", 1)
291.CaseLower(
"pm", 1)
292.Default(std::nullopt);
322 boolIsPolyUnsigned,
boolIsInt64Long) {
356 returnContext.MFloat8Ty;
358llvm_unreachable(
"Invalid NeonTypeFlag!");
376 unsignedArgIdx,
unsignedEltBitWidth,
377 unsignedContainerBitWidth) {
380 autoCheckImmediateInSet = [&](std::initializer_list<int64_t>
Set,
381 intErrDiag) ->
bool{
392 if(std::find(
Set.begin(),
Set.end(), Imm.getSExtValue()) ==
Set.end())
398 caseImmCheckType::ImmCheck0_31:
402 caseImmCheckType::ImmCheck0_13:
406 caseImmCheckType::ImmCheck0_63:
410 caseImmCheckType::ImmCheck1_16:
414 caseImmCheckType::ImmCheck0_7:
418 caseImmCheckType::ImmCheck1_1:
422 caseImmCheckType::ImmCheck1_3:
426 caseImmCheckType::ImmCheck1_7:
430 caseImmCheckType::ImmCheckExtract:
432(2048 / EltBitWidth) - 1))
435 caseImmCheckType::ImmCheckCvt:
436 caseImmCheckType::ImmCheckShiftRight:
440 caseImmCheckType::ImmCheckShiftRightNarrow:
444 caseImmCheckType::ImmCheckShiftLeft:
448 caseImmCheckType::ImmCheckLaneIndex:
450(ContainerBitWidth / EltBitWidth) - 1))
453 caseImmCheckType::ImmCheckLaneIndexCompRotate:
455TheCall, ArgIdx, 0, (ContainerBitWidth / (2 * EltBitWidth)) - 1))
458 caseImmCheckType::ImmCheckLaneIndexDot:
460TheCall, ArgIdx, 0, (ContainerBitWidth / (4 * EltBitWidth)) - 1))
463 caseImmCheckType::ImmCheckComplexRot90_270:
464 if(CheckImmediateInSet({90, 270}, diag::err_rotation_argument_to_cadd))
467 caseImmCheckType::ImmCheckComplexRotAll90:
468 if(CheckImmediateInSet({0, 90, 180, 270},
469diag::err_rotation_argument_to_cmla))
472 caseImmCheckType::ImmCheck0_1:
476 caseImmCheckType::ImmCheck0_2:
480 caseImmCheckType::ImmCheck0_3:
484 caseImmCheckType::ImmCheck0_0:
488 caseImmCheckType::ImmCheck0_15:
492 caseImmCheckType::ImmCheck0_255:
496 caseImmCheckType::ImmCheck1_32:
500 caseImmCheckType::ImmCheck1_64:
504 caseImmCheckType::ImmCheck2_4_Mul2:
517 boolHasError =
false;
519 for(
const auto&I : ImmChecks) {
520 auto[ArgIdx, CheckTy, ElementBitWidth, VecBitWidth] = I;
522 if(OverloadType >= 0)
534 boolHasError =
false;
536 for(
const auto&I : ImmChecks) {
537 auto[ArgIdx, CheckTy, ElementBitWidth] = I;
546 if(FD->
hasAttr<ArmLocallyStreamingAttr>())
550 if(FPT->getAArch64SMEAttributes() &
553 if(FPT->getAArch64SMEAttributes() &
564 unsignedBuiltinID) {
572llvm::StringMap<bool> CallerFeatureMapWithoutSVE;
574CallerFeatureMapWithoutSVE[
"sve"] =
false;
580llvm::StringMap<bool> CallerFeatureMapWithoutSME;
582CallerFeatureMapWithoutSME[
"sme"] =
false;
594StringRef BuiltinTargetGuards(
597BuiltinTargetGuards, CallerFeatureMapWithoutSME);
599BuiltinTargetGuards, CallerFeatureMapWithoutSVE);
601 if((SatisfiesSVE && SatisfiesSME) ||
604 else if(SatisfiesSVE)
606 else if(SatisfiesSME)
615S.
Diag(TheCall->
getBeginLoc(), diag::err_attribute_arm_sm_incompat_builtin)
619S.
Diag(TheCall->
getBeginLoc(), diag::err_attribute_arm_sm_incompat_builtin)
631#define GET_SME_BUILTIN_GET_STATE 632#include "clang/Basic/arm_sme_builtins_za_state.inc" 633#undef GET_SME_BUILTIN_GET_STATE 644#define GET_SME_STREAMING_ATTRS 645#include "clang/Basic/arm_sme_streaming_attrs.inc" 646#undef GET_SME_STREAMING_ATTRS 655diag::warn_attribute_arm_za_builtin_no_za_state)
660diag::warn_attribute_arm_zt0_builtin_no_zt0_state)
670#define GET_SME_IMMEDIATE_CHECK 671#include "clang/Basic/arm_sme_sema_rangechecks.inc" 672#undef GET_SME_IMMEDIATE_CHECK 685#define GET_SVE_STREAMING_ATTRS 686#include "clang/Basic/arm_sve_streaming_attrs.inc" 687#undef GET_SVE_STREAMING_ATTRS 699#define GET_SVE_IMMEDIATE_CHECK 700#include "clang/Basic/arm_sve_sema_rangechecks.inc" 701#undef GET_SVE_IMMEDIATE_CHECK 716#define GET_NEON_BUILTINS 717#define TARGET_BUILTIN(id, ...) case NEON::BI##id: 718#define BUILTIN(id, ...) case NEON::BI##id: 719#include "clang/Basic/arm_neon.inc" 726#undef GET_NEON_BUILTINS 734 boolHasConstPtr =
false;
736#define GET_NEON_OVERLOAD_CHECK 737#include "clang/Basic/arm_fp16.inc" 738#include "clang/Basic/arm_neon.inc" 739#undef GET_NEON_OVERLOAD_CHECK 744 unsignedImmArg = TheCall->
getNumArgs() - 1;
749TV =
Result.getLimitedValue(64);
750 if((TV > 63) || (mask & (1ULL << TV)) == 0)
751 return Diag(TheCall->
getBeginLoc(), diag::err_invalid_neon_type_code)
755 if(PtrArgNum >= 0) {
759Arg = ICE->getSubExpr();
763llvm::Triple::ArchType Arch = TI.
getTriple().getArch();
764 boolIsPolyUnsigned = Arch == llvm::Triple::aarch64 ||
765Arch == llvm::Triple::aarch64_32 ||
766Arch == llvm::Triple::aarch64_be;
769IsPolyUnsigned, IsInt64Long);
789#define GET_NEON_IMMEDIATE_CHECK 790#include "clang/Basic/arm_fp16.inc" 791#include "clang/Basic/arm_neon.inc" 792#undef GET_NEON_IMMEDIATE_CHECK 803#include "clang/Basic/arm_mve_builtin_sema.inc" 814#include "clang/Basic/arm_cde_builtin_sema.inc" 824 const Expr*CoprocArg,
835int64_t CoprocNo = CoprocNoAP.getExtValue();
836assert(CoprocNo >= 0 &&
"Coprocessor immediate must be non-negative");
839 boolIsCDECoproc = CoprocNo <= 7 && (CDECoprocMask & (1 << CoprocNo));
841 if(IsCDECoproc != WantCDE)
851assert((BuiltinID == ARM::BI__builtin_arm_ldrex ||
852BuiltinID == ARM::BI__builtin_arm_ldaex ||
853BuiltinID == ARM::BI__builtin_arm_strex ||
854BuiltinID == ARM::BI__builtin_arm_stlex ||
855BuiltinID == AArch64::BI__builtin_arm_ldrex ||
856BuiltinID == AArch64::BI__builtin_arm_ldaex ||
857BuiltinID == AArch64::BI__builtin_arm_strex ||
858BuiltinID == AArch64::BI__builtin_arm_stlex) &&
859 "unexpected ARM builtin");
860 boolIsLdrex = BuiltinID == ARM::BI__builtin_arm_ldrex ||
861BuiltinID == ARM::BI__builtin_arm_ldaex ||
862BuiltinID == AArch64::BI__builtin_arm_ldrex ||
863BuiltinID == AArch64::BI__builtin_arm_ldaex;
877 Expr*PointerArg = TheCall->
getArg(IsLdrex ? 0 : 1);
882PointerArg = PointerArgRes.
get();
902CastNeeded = CK_BitCast;
903 Diag(DRE->
getBeginLoc(), diag::ext_typecheck_convert_discards_qualifiers)
904<< PointerArg->
getType() << Context.getPointerType(AddrType)
909AddrType = Context.getPointerType(AddrType);
913PointerArg = PointerArgRes.
get();
915TheCall->
setArg(IsLdrex ? 0 : 1, PointerArg);
920 Diag(DRE->
getBeginLoc(), diag::err_atomic_builtin_must_be_pointer_intfltptr)
926 if(Context.getTypeSize(ValType) > MaxWidth) {
927assert(MaxWidth == 64 &&
"Diagnostic unexpectedly inaccurate");
928 Diag(DRE->
getBeginLoc(), diag::err_atomic_exclusive_builtin_pointer_size)
955Context, ValType,
false);
963TheCall->
setType(Context.IntTy);
970 if(BuiltinID == ARM::BI__builtin_arm_ldrex ||
971BuiltinID == ARM::BI__builtin_arm_ldaex ||
972BuiltinID == ARM::BI__builtin_arm_strex ||
973BuiltinID == ARM::BI__builtin_arm_stlex) {
977 if(BuiltinID == ARM::BI__builtin_arm_prefetch) {
982 if(BuiltinID == ARM::BI__builtin_arm_rsr64 ||
983BuiltinID == ARM::BI__builtin_arm_wsr64)
986 if(BuiltinID == ARM::BI__builtin_arm_rsr ||
987BuiltinID == ARM::BI__builtin_arm_rsrp ||
988BuiltinID == ARM::BI__builtin_arm_wsr ||
989BuiltinID == ARM::BI__builtin_arm_wsrp)
1002 switch(BuiltinID) {
1005 caseARM::BI__builtin_arm_ssat:
1007 caseARM::BI__builtin_arm_usat:
1009 caseARM::BI__builtin_arm_ssat16:
1011 caseARM::BI__builtin_arm_usat16:
1013 caseARM::BI__builtin_arm_vcvtr_f:
1014 caseARM::BI__builtin_arm_vcvtr_d:
1016 caseARM::BI__builtin_arm_dmb:
1017 caseARM::BI__builtin_arm_dsb:
1018 caseARM::BI__builtin_arm_isb:
1019 caseARM::BI__builtin_arm_dbg:
1021 caseARM::BI__builtin_arm_cdp:
1022 caseARM::BI__builtin_arm_cdp2:
1023 caseARM::BI__builtin_arm_mcr:
1024 caseARM::BI__builtin_arm_mcr2:
1025 caseARM::BI__builtin_arm_mrc:
1026 caseARM::BI__builtin_arm_mrc2:
1027 caseARM::BI__builtin_arm_mcrr:
1028 caseARM::BI__builtin_arm_mcrr2:
1029 caseARM::BI__builtin_arm_mrrc:
1030 caseARM::BI__builtin_arm_mrrc2:
1031 caseARM::BI__builtin_arm_ldc:
1032 caseARM::BI__builtin_arm_ldcl:
1033 caseARM::BI__builtin_arm_ldc2:
1034 caseARM::BI__builtin_arm_ldc2l:
1035 caseARM::BI__builtin_arm_stc:
1036 caseARM::BI__builtin_arm_stcl:
1037 caseARM::BI__builtin_arm_stc2:
1038 caseARM::BI__builtin_arm_stc2l:
1048 if(BuiltinID == AArch64::BI__builtin_arm_ldrex ||
1049BuiltinID == AArch64::BI__builtin_arm_ldaex ||
1050BuiltinID == AArch64::BI__builtin_arm_strex ||
1051BuiltinID == AArch64::BI__builtin_arm_stlex) {
1055 if(BuiltinID == AArch64::BI__builtin_arm_prefetch) {
1062 if(BuiltinID == AArch64::BI__builtin_arm_rsr64 ||
1063BuiltinID == AArch64::BI__builtin_arm_wsr64 ||
1064BuiltinID == AArch64::BI__builtin_arm_rsr128 ||
1065BuiltinID == AArch64::BI__builtin_arm_wsr128)
1069 if(BuiltinID == AArch64::BI__builtin_arm_irg ||
1070BuiltinID == AArch64::BI__builtin_arm_addg ||
1071BuiltinID == AArch64::BI__builtin_arm_gmi ||
1072BuiltinID == AArch64::BI__builtin_arm_ldg ||
1073BuiltinID == AArch64::BI__builtin_arm_stg ||
1074BuiltinID == AArch64::BI__builtin_arm_subp) {
1078 if(BuiltinID == AArch64::BI__builtin_arm_rsr ||
1079BuiltinID == AArch64::BI__builtin_arm_rsrp ||
1080BuiltinID == AArch64::BI__builtin_arm_wsr ||
1081BuiltinID == AArch64::BI__builtin_arm_wsrp)
1087 if(BuiltinID == AArch64::BI_ReadStatusReg ||
1088BuiltinID == AArch64::BI_WriteStatusReg)
1091 if(BuiltinID == AArch64::BI__getReg)
1094 if(BuiltinID == AArch64::BI__break)
1097 if(BuiltinID == AArch64::BI__hlt)
1111 unsignedi = 0, l = 0, u = 0;
1112 switch(BuiltinID) {
1113 default:
return false;
1114 caseAArch64::BI__builtin_arm_dmb:
1115 caseAArch64::BI__builtin_arm_dsb:
1116 caseAArch64::BI__builtin_arm_isb: l = 0; u = 15;
break;
1117 caseAArch64::BI__builtin_arm_tcancel: l = 0; u = 65535;
break;
1124structIntrinToName {
1133 const char*IntrinNames) {
1134AliasName.consume_front(
"__arm_");
1135 constIntrinToName *It =
1136llvm::lower_bound(Map, BuiltinID, [](
constIntrinToName &L,
unsigned Id) {
1139 if(It == Map.end() || It->Id != BuiltinID)
1141StringRef
FullName(&IntrinNames[It->FullName]);
1144 if(It->ShortName == -1)
1146StringRef
ShortName(&IntrinNames[It->ShortName]);
1151#include "clang/Basic/arm_mve_builtin_aliases.inc" 1159#include "clang/Basic/arm_cde_builtin_aliases.inc" 1180 Diag(AL.
getLoc(), diag::err_attribute_argument_n_type)
1187StringRef AliasName = cast<FunctionDecl>(
D)->getIdentifier()->getName();
1189 boolIsAArch64 = Context.getTargetInfo().getTriple().isAArch64();
1194 Diag(AL.
getLoc(), diag::err_attribute_arm_builtin_alias);
1198 D->addAttr(::new (Context) ArmBuiltinAliasAttr(Context, AL, Ident));
1204 autoCheckForIncompatibleAttr =
1206StringRef IncompatibleStateName) {
1207 if(CurrentState == IncompatibleState) {
1208S.
Diag(AL.
getLoc(), diag::err_attributes_are_not_compatible)
1209<< (std::string(
"'__arm_new(\"") + StateName.str() +
"\")'")
1210<< (std::string(
"'") + IncompatibleStateName.str() +
"(\""+
1211StateName.str() +
"\")'")
1226 Diag(AL.
getLoc(), diag::err_missing_arm_state) << AL;
1231std::vector<StringRef> NewState;
1232 if(
const auto*ExistingAttr =
D->getAttr<ArmNewAttr>()) {
1233 for(StringRef S : ExistingAttr->newArgs())
1234NewState.push_back(S);
1237 boolHasZA =
false;
1238 boolHasZT0 =
false;
1239 for(
unsignedI = 0,
E= AL.
getNumArgs(); I !=
E; ++I) {
1240StringRef StateName;
1245 if(StateName ==
"za")
1247 else if(StateName ==
"zt0")
1250 Diag(LiteralLoc, diag::err_unknown_arm_state) << StateName;
1255 if(!llvm::is_contained(NewState, StateName))
1256NewState.push_back(StateName);
1259 if(
auto*FPT = dyn_cast<FunctionProtoType>(
D->getFunctionType())) {
1272 D->dropAttr<ArmNewAttr>();
1279 Diag(AL.
getLoc(), diag::err_attribute_not_clinkage) << AL;
1283 const auto*FD = cast<FunctionDecl>(
D);
1284 if(!FD->isExternallyVisible()) {
1285 Diag(AL.
getLoc(), diag::warn_attribute_cmse_entry_static);
1295 Diag(AL.
getLoc(), diag::err_attribute_too_many_arguments) << AL << 1;
1307ARMInterruptAttr::InterruptType
Kind;
1308 if(!ARMInterruptAttr::ConvertStrToInterruptType(Str,
Kind)) {
1309 Diag(AL.
getLoc(), diag::warn_attribute_type_not_supported)
1310<< AL << Str << ArgLoc;
1316 Diag(
D->getLocation(), diag::warn_arm_interrupt_vfp_clobber);
1327 boolUsesSM = FD->
hasAttr<ArmLocallyStreamingAttr>();
1328 boolUsesZA =
Attr&&
Attr->isNewZA();
1329 boolUsesZT0 =
Attr&&
Attr->isNewZT0();
1331 if(UsesZA || UsesZT0) {
1339 if(FD->
hasAttr<ArmLocallyStreamingAttr>()) {
1342diag::warn_sme_locally_streaming_has_vl_args_returns)
1345return P->getOriginalType()->isSizelessVectorType();
1348diag::warn_sme_locally_streaming_has_vl_args_returns)
1361 if(UsesSM || UsesZA) {
1362llvm::StringMap<bool> FeatureMap;
1363Context.getFunctionFeatureMap(FeatureMap, FD);
1364 if(!FeatureMap.contains(
"sme")) {
1367diag::err_sme_definition_using_sm_in_non_sme_target);
1370diag::err_sme_definition_using_za_in_non_sme_target);
1374llvm::StringMap<bool> FeatureMap;
1375Context.getFunctionFeatureMap(FeatureMap, FD);
1376 if(!FeatureMap.contains(
"sme2")) {
1378diag::err_sme_definition_using_zt0_in_non_sme2_target);
static constexpr Builtin::Info BuiltinInfo[]
enum clang::sema::@1704::IndirectLocalPathEntry::EntryKind Kind
This file declares semantic analysis functions specific to ARM.
Enumerates target-specific builtins in their own namespaces within namespace clang.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
Builtin::Context & BuiltinInfo
CanQualType UnsignedLongTy
CanQualType UnsignedCharTy
CanQualType UnsignedIntTy
CanQualType UnsignedLongLongTy
CanQualType UnsignedShortTy
const TargetInfo & getTargetInfo() const
void getFunctionFeatureMap(llvm::StringMap< bool > &FeatureMap, const FunctionDecl *) const
Attr - This represents one attribute.
SourceLocation getLoc() const
This class is used for builtin types like 'int'.
unsigned getAuxBuiltinID(unsigned ID) const
Return real builtin ID (i.e.
const char * getRequiredFeatures(unsigned ID) const
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
SourceLocation getBeginLoc() const LLVM_READONLY
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
A reference to a declared variable, function, enum, etc.
SourceLocation getBeginLoc() const LLVM_READONLY
Decl - This represents one declaration (or definition), e.g.
SourceLocation getLocation() const
This represents one expression.
Expr * IgnoreParenCasts() LLVM_READONLY
Skip past any parentheses and casts which might surround this expression until reaching a fixed point...
bool isValueDependent() const
Determines whether the value of this expression depends on.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Expr * IgnoreParenImpCasts() LLVM_READONLY
Skip past any parentheses and implicit casts which might surround this expression until reaching a fi...
@ NPC_ValueDependentIsNotNull
Specifies that a value-dependent expression should be considered to never be a null pointer constant.
std::optional< llvm::APSInt > getIntegerConstantExpr(const ASTContext &Ctx, SourceLocation *Loc=nullptr) const
isIntegerConstantExpr - Return the value if this expression is a valid integer constant expression.
Represents a function declaration or definition.
QualType getReturnType() const
ArrayRef< ParmVarDecl * > parameters() const
Represents a prototype with parameter type info, e.g.
static ArmStateValue getArmZT0State(unsigned AttrBits)
static ArmStateValue getArmZAState(unsigned AttrBits)
@ SME_PStateSMEnabledMask
@ SME_PStateSMCompatibleMask
@ SME_AgnosticZAStateMask
One of these records is kept for each identifier that is lexed.
unsigned getBuiltinID() const
Return a value indicating whether this is a builtin function.
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Describes an entity that is being initialized.
static InitializedEntity InitializeParameter(ASTContext &Context, ParmVarDecl *Parm)
Create the initialization entity for a parameter.
Flags to identify the types for overloaded Neon builtins.
unsigned getEltSizeInBits() const
EltType getEltType() const
Represents a parameter to a function.
ParsedAttr - Represents a syntactic attribute.
IdentifierLoc * getArgAsIdent(unsigned Arg) const
void setInvalid(bool b=true) const
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this attribute.
bool isArgIdent(unsigned Arg) const
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
QualType withConst() const
void addConst()
Add the const type qualifier to this QualType.
QualType withVolatile() const
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
const Type * getTypePtrOrNull() const
bool isAtLeastAsQualifiedAs(QualType Other, const ASTContext &Ctx) const
Determine whether this type is at least as qualified as the other given type, requiring exact equalit...
@ OCL_Strong
Assigning into this object requires the old value to be released and the new value to be retained.
@ OCL_ExplicitNone
This object can be modified without requiring retains or releases.
@ OCL_None
There is no lifetime qualification on this type.
@ OCL_Weak
Reading or writing from this object requires a barrier call.
@ OCL_Autoreleasing
Assigning into this object requires a lifetime extension.
void CheckSMEFunctionDefAttributes(const FunctionDecl *FD)
bool CheckARMBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool CheckSMEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
bool CheckARMCoprocessorImmediate(const TargetInfo &TI, const Expr *CoprocArg, bool WantCDE)
bool CheckSVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
bool CheckNeonBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool CheckCDEBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool PerformNeonImmChecks(CallExpr *TheCall, SmallVectorImpl< std::tuple< int, int, int, int > > &ImmChecks, int OverloadType=-1)
bool CheckMVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
bool PerformSVEImmChecks(CallExpr *TheCall, SmallVectorImpl< std::tuple< int, int, int > > &ImmChecks)
void handleBuiltinAliasAttr(Decl *D, const ParsedAttr &AL)
@ ArmStreaming
Intrinsic is only available in normal mode.
@ VerifyRuntimeMode
Intrinsic is available both in normal and Streaming-SVE mode.
@ ArmStreamingCompatible
Intrinsic is only available in Streaming-SVE mode.
void handleNewAttr(Decl *D, const ParsedAttr &AL)
bool CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall, unsigned MaxWidth)
bool SveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
bool CheckAArch64BuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
bool MveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
bool BuiltinARMMemoryTaggingCall(unsigned BuiltinID, CallExpr *TheCall)
BuiltinARMMemoryTaggingCall - Handle calls of memory tagging extensions.
void handleCmseNSEntryAttr(Decl *D, const ParsedAttr &AL)
bool CheckImmediateArg(CallExpr *TheCall, unsigned CheckTy, unsigned ArgIdx, unsigned EltBitWidth, unsigned VecBitWidth)
bool BuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall, int ArgNum, unsigned ExpectedFieldNum, bool AllowName)
BuiltinARMSpecialReg - Handle a check if argument ArgNum of CallExpr TheCall is an ARM/AArch64 specia...
bool SmeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
bool CdeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
ASTContext & getASTContext() const
const LangOptions & getLangOpts() const
Sema - This implements semantic analysis and AST building for C.
bool BuiltinConstantArgMultiple(CallExpr *TheCall, int ArgNum, unsigned Multiple)
BuiltinConstantArgMultiple - Handle a check if argument ArgNum of CallExpr TheCall is a constant expr...
FunctionDecl * getCurFunctionDecl(bool AllowLambda=false) const
Returns a pointer to the innermost enclosing function, or nullptr if the current context is not insid...
ExprResult DefaultFunctionArrayLvalueConversion(Expr *E, bool Diagnose=true)
ExprResult ImpCastExprToType(Expr *E, QualType Type, CastKind CK, ExprValueKind VK=VK_PRValue, const CXXCastPath *BasePath=nullptr, CheckedConversionKind CCK=CheckedConversionKind::Implicit)
ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast.
AssignConvertType CheckSingleAssignmentConstraints(QualType LHSType, ExprResult &RHS, bool Diagnose=true, bool DiagnoseCFAudited=false, bool ConvertRHS=true)
Check assignment constraints for an assignment of RHS to LHSType.
ExprResult DefaultLvalueConversion(Expr *E)
AssignConvertType
AssignConvertType - All of the 'assignment' semantic checks return this enum to indicate whether the ...
bool BuiltinConstantArg(CallExpr *TheCall, int ArgNum, llvm::APSInt &Result)
BuiltinConstantArg - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression.
bool isConstantEvaluatedContext() const
bool checkArgCount(CallExpr *Call, unsigned DesiredArgCount)
Checks that a call expression's argument count is the desired number.
ExprResult PerformCopyInitialization(const InitializedEntity &Entity, SourceLocation EqualLoc, ExprResult Init, bool TopLevelOfInitList=false, bool AllowExplicit=false)
bool DiagnoseAssignmentResult(AssignConvertType ConvTy, SourceLocation Loc, QualType DstType, QualType SrcType, Expr *SrcExpr, AssignmentAction Action, bool *Complained=nullptr)
DiagnoseAssignmentResult - Emit a diagnostic, if required, for the assignment conversion type specifi...
bool BuiltinConstantArgRange(CallExpr *TheCall, int ArgNum, int Low, int High, bool RangeIsError=true)
BuiltinConstantArgRange - Handle a check if argument ArgNum of CallExpr TheCall is a constant express...
bool checkStringLiteralArgumentAttr(const AttributeCommonInfo &CI, const Expr *E, StringRef &Str, SourceLocation *ArgLocation=nullptr)
Check if the argument E is a ASCII string literal.
Encodes a location in the source.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
SourceLocation getBeginLoc() const LLVM_READONLY
Exposes information about the current target.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
IntType getInt64Type() const
uint32_t getARMCDECoprocMask() const
For ARM targets returns a mask defining which coprocessors are configured as Custom Datapath.
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
The base class of the type hierarchy.
bool isBlockPointerType() const
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isFloatingType() const
bool isAnyPointerType() const
const T * getAs() const
Member-template getAs<specific type>'.
bool isSizelessVectorType() const
Returns true for all scalable vector types.
Defines the clang::TargetInfo interface.
bool evaluateRequiredTargetFeatures(llvm::StringRef RequiredFatures, const llvm::StringMap< bool > &TargetFetureMap)
Returns true if the required target features of a builtin function are enabled.
const AstTypeMatcher< PointerType > pointerType
Matches pointer types, but does not match Objective-C object pointer types.
The JSON file list parser is used to communicate input to InstallAPI.
static bool BuiltinAliasValid(unsigned BuiltinID, StringRef AliasName, ArrayRef< IntrinToName > Map, const char *IntrinNames)
static ArmSMEState getSMEState(unsigned BuiltinID)
static bool checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, const FunctionDecl *FD, SemaARM::ArmStreamingType BuiltinType, unsigned BuiltinID)
SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD)
@ AANT_ArgumentIdentifier
@ Result
The result type of a method or function.
bool hasArmZT0State(const FunctionDecl *FD)
Returns whether the given FunctionDecl has Arm ZT0 state.
CastKind
CastKind - The kind of operation required for a conversion.
static QualType getNeonEltType(NeonTypeFlags Flags, ASTContext &Context, bool IsPolyUnsigned, bool IsInt64Long)
getNeonEltType - Return the QualType corresponding to the elements of the vector type specified by th...
static bool checkNewAttrMutualExclusion(Sema &S, const ParsedAttr &AL, const FunctionProtoType *FPT, FunctionType::ArmStateValue CurrentState, StringRef StateName)
bool hasArmZAState(const FunctionDecl *FD)
Returns whether the given FunctionDecl has Arm ZA state.
Extra information about a function prototype.
unsigned AArch64SMEAttributes
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4