*ICE = dyn_cast<ImplicitCastExpr>(Arg->
IgnoreParens());
35 const auto*DR = dyn_cast<DeclRefExpr>(ICE->getSubExpr());
39 const auto*PD = dyn_cast<ParmVarDecl>(DR->getDecl());
40 if(!PD || !PD->getType()->isRecordType())
46 if(
const auto*AA = FD->getAttr<AlignedAttr>()) {
50 Diag(FD->getLocation(), diag::warn_not_xl_compatible) << FD;
51 Diag(
Loc, diag::note_misaligned_member_used_here) << PD;
60 casePPC::BI__builtin_divde:
61 casePPC::BI__builtin_divdeu:
62 casePPC::BI__builtin_bpermd:
63 casePPC::BI__builtin_pdepd:
64 casePPC::BI__builtin_pextd:
65 casePPC::BI__builtin_ppc_cdtbcd:
66 casePPC::BI__builtin_ppc_cbcdtd:
67 casePPC::BI__builtin_ppc_addg6s:
68 casePPC::BI__builtin_ppc_ldarx:
69 casePPC::BI__builtin_ppc_stdcx:
70 casePPC::BI__builtin_ppc_tdw:
71 casePPC::BI__builtin_ppc_trapd:
72 casePPC::BI__builtin_ppc_cmpeqb:
73 casePPC::BI__builtin_ppc_setb:
74 casePPC::BI__builtin_ppc_mulhd:
75 casePPC::BI__builtin_ppc_mulhdu:
76 casePPC::BI__builtin_ppc_maddhd:
77 casePPC::BI__builtin_ppc_maddhdu:
78 casePPC::BI__builtin_ppc_maddld:
79 casePPC::BI__builtin_ppc_load8r:
80 casePPC::BI__builtin_ppc_store8r:
81 casePPC::BI__builtin_ppc_insert_exp:
82 casePPC::BI__builtin_ppc_extract_sig:
83 casePPC::BI__builtin_ppc_addex:
84 casePPC::BI__builtin_darn:
85 casePPC::BI__builtin_darn_raw:
86 casePPC::BI__builtin_ppc_compare_and_swaplp:
87 casePPC::BI__builtin_ppc_fetch_and_addlp:
88 casePPC::BI__builtin_ppc_fetch_and_andlp:
89 casePPC::BI__builtin_ppc_fetch_and_orlp:
90 casePPC::BI__builtin_ppc_fetch_and_swaplp:
104 return Diag(TheCall->
getBeginLoc(), diag::err_64_bit_builtin_32_bit_tgt)
110 casePPC::BI__builtin_altivec_crypto_vshasigmaw:
111 casePPC::BI__builtin_altivec_crypto_vshasigmad:
114 casePPC::BI__builtin_altivec_dss:
116 casePPC::BI__builtin_tbegin:
117 casePPC::BI__builtin_tend:
119 casePPC::BI__builtin_tsr:
121 casePPC::BI__builtin_tabortwc:
122 casePPC::BI__builtin_tabortdc:
124 casePPC::BI__builtin_tabortwci:
125 casePPC::BI__builtin_tabortdci:
131 casePPC::BI__builtin_unpack_longdouble:
135 casePPC::BI__builtin_pack_longdouble:
137 return Diag(TheCall->
getBeginLoc(), diag::err_ppc_builtin_requires_abi)
140 casePPC::BI__builtin_altivec_dst:
141 casePPC::BI__builtin_altivec_dstt:
142 casePPC::BI__builtin_altivec_dstst:
143 casePPC::BI__builtin_altivec_dststt:
145 casePPC::BI__builtin_vsx_xxpermdi:
146 casePPC::BI__builtin_vsx_xxsldwi:
148 casePPC::BI__builtin_unpack_vector_int128:
150 casePPC::BI__builtin_altivec_vgnb:
152 casePPC::BI__builtin_vsx_xxeval:
154 casePPC::BI__builtin_altivec_vsldbi:
156 casePPC::BI__builtin_altivec_vsrdbi:
158 casePPC::BI__builtin_vsx_xxpermx:
160 casePPC::BI__builtin_ppc_tw:
161 casePPC::BI__builtin_ppc_tdw:
163 casePPC::BI__builtin_ppc_cmprb:
167 casePPC::BI__builtin_ppc_rlwnm:
169 casePPC::BI__builtin_ppc_rlwimi:
172 casePPC::BI__builtin_ppc_rldimi:
175 casePPC::BI__builtin_ppc_addex: {
182 Diag(TheCall->
getBeginLoc(), diag::warn_argument_undefined_behaviour)
186 casePPC::BI__builtin_ppc_mtfsb0:
187 casePPC::BI__builtin_ppc_mtfsb1:
189 casePPC::BI__builtin_ppc_mtfsf:
191 casePPC::BI__builtin_ppc_mtfsfi:
194 casePPC::BI__builtin_ppc_alignx:
196 casePPC::BI__builtin_ppc_rdlam:
198 casePPC::BI__builtin_vsx_ldrmb:
199 casePPC::BI__builtin_vsx_strmb:
201 casePPC::BI__builtin_altivec_vcntmbb:
202 casePPC::BI__builtin_altivec_vcntmbh:
203 casePPC::BI__builtin_altivec_vcntmbw:
204 casePPC::BI__builtin_altivec_vcntmbd:
206 casePPC::BI__builtin_vsx_xxgenpcvbm:
207 casePPC::BI__builtin_vsx_xxgenpcvhm:
208 casePPC::BI__builtin_vsx_xxgenpcvwm:
209 casePPC::BI__builtin_vsx_xxgenpcvdm:
211 casePPC::BI__builtin_ppc_test_data_class: {
215 if(ArgType !=
QualType(Context.FloatTy) &&
216ArgType !=
QualType(Context.DoubleTy) &&
217ArgType !=
QualType(Context.Float128Ty))
219diag::err_ppc_invalid_test_data_class_type);
222 casePPC::BI__builtin_ppc_maxfe:
223 casePPC::BI__builtin_ppc_minfe:
224 casePPC::BI__builtin_ppc_maxfl:
225 casePPC::BI__builtin_ppc_minfl:
226 casePPC::BI__builtin_ppc_maxfs:
227 casePPC::BI__builtin_ppc_minfs: {
228 if(Context.getTargetInfo().getTriple().isOSAIX() &&
229(BuiltinID == PPC::BI__builtin_ppc_maxfe ||
230BuiltinID == PPC::BI__builtin_ppc_minfe))
231 return Diag(TheCall->
getBeginLoc(), diag::err_target_unsupported_type)
232<<
"builtin"<<
true<< 128 <<
QualType(Context.LongDoubleTy)
233<<
false<< Context.getTargetInfo().getTriple().str();
236 if(BuiltinID == PPC::BI__builtin_ppc_maxfl ||
237BuiltinID == PPC::BI__builtin_ppc_minfl)
238ArgType =
QualType(Context.DoubleTy);
239 else if(BuiltinID == PPC::BI__builtin_ppc_maxfs ||
240BuiltinID == PPC::BI__builtin_ppc_minfs)
241ArgType =
QualType(Context.FloatTy);
242 for(
unsignedI = 0,
E= TheCall->
getNumArgs(); I <
E; ++I)
245diag::err_typecheck_convert_incompatible)
246<< TheCall->
getArg(I)->
getType() << ArgType << 1 << 0 << 0;
249#define CUSTOM_BUILTIN(Name, Intr, Types, Acc, Feature) \ 250 case PPC::BI__builtin_##Name: \ 251 return BuiltinPPCMMACall(TheCall, BuiltinID, Types); 252#include "clang/Basic/BuiltinsPPC.def" 254llvm_unreachable(
"must return from switch");
264 QualTypeCoreType =
Type.getCanonicalType().getUnqualifiedType();
265#define PPC_VECTOR_TYPE(Name, Id, Size) || CoreType == Context.Id##Ty 267#include
"clang/Basic/PPCTypes.def" 269 Diag(
TypeLoc, diag::err_ppc_invalid_use_mma_type);
283 boolRequireICE =
false;
291 unsignedsize = strtoul(Str, &End, 10);
292assert(End != Str &&
"Missing constant parameter constraint");
295 returnContext.
IntTy;
299 unsignedsize = strtoul(Str, &End, 10);
300assert(End != Str &&
"Missing PowerPC MMA type size");
304#define PPC_VECTOR_TYPE(typeName, Id, size) \ 306 Type = Context.Id##Ty; \ 308#include "clang/Basic/PPCTypes.def" 310llvm_unreachable(
"Invalid PowerPC MMA vector type");
312 boolCheckVectorArgs =
false;
313 while(!CheckVectorArgs) {
322CheckVectorArgs =
true;
330 returnContext.
DecodeTypeStr(--Str, Context, Error, RequireICE,
true);
335 const char*TypeStr) {
337assert((TypeStr[0] !=
'\0') &&
338 "Invalid types in PPC MMA builtin declaration");
349 while(*TypeStr !=
'\0') {
373diag::err_typecheck_convert_incompatible)
390 while(*TypeStr !=
'\0') {
401 unsignedExpectedNumArgs = 3;
408diag::err_vsx_builtin_nonconstant_argument)
420 return Diag(BuiltinLoc, diag::err_vec_builtin_non_vector)
427 if(!
getASTContext().hasSameUnqualifiedType(Arg1Ty, Arg2Ty)) {
428 return Diag(BuiltinLoc, diag::err_vec_builtin_incompatible_vector)
Defines the clang::ASTContext interface.
This file declares semantic analysis functions specific to PowerPC.
Defines the clang::SourceLocation class and associated facilities.
Enumerates target-specific builtins in their own namespaces within namespace clang.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
CanQualType UnsignedCharTy
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
QualType DecodeTypeStr(const char *&Str, const ASTContext &Context, ASTContext::GetBuiltinTypeError &Error, bool &RequireICE, bool AllowTypeModifiers) const
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
SourceLocation getBeginLoc() const LLVM_READONLY
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
CharUnits - This is an opaque type for sizes expressed in character units.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
This represents one expression.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
bool isIntegerConstantExpr(const ASTContext &Ctx, SourceLocation *Loc=nullptr) const
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 member of a struct/union/class.
A (possibly-)qualified type.
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
bool isRestrictQualified() const
Determine whether this type is restrict-qualified.
QualType getCanonicalType() const
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
field_range fields() const
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
RecordDecl * getDecl() const
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
ASTContext & getASTContext() const
bool CheckPPCBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
void checkAIXMemberAlignment(SourceLocation Loc, const Expr *Arg)
bool BuiltinPPCMMACall(CallExpr *TheCall, unsigned BuiltinID, const char *TypeDesc)
BuiltinPPCMMACall - Check the call to a PPC MMA builtin for validity.
bool BuiltinVSX(CallExpr *TheCall)
bool CheckPPCMMAType(QualType Type, SourceLocation TypeLoc)
Sema - This implements semantic analysis and AST building for C.
bool ValueIsRunOfOnes(CallExpr *TheCall, unsigned ArgNum)
Returns true if the argument consists of one contiguous run of 1s with any number of 0s on either sid...
bool BuiltinConstantArgPower2(CallExpr *TheCall, int ArgNum)
BuiltinConstantArgPower2 - Check if argument ArgNum of TheCall is a constant expression representing ...
bool checkArgCount(CallExpr *Call, unsigned DesiredArgCount)
Checks that a call expression's argument count is the desired number.
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...
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEndLoc() const LLVM_READONLY
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.
unsigned getTypeWidth(IntType T) const
Return the width (in bits) of the specified integer type enum.
IntType getIntPtrType() const
const llvm::fltSemantics & getLongDoubleFormat() const
Base wrapper for a particular "section" of type source info.
The base class of the type hierarchy.
bool isPointerType() const
const T * castAs() const
Member-template castAs<specific type>.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isVectorType() const
Defines the clang::TargetInfo interface.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
The JSON file list parser is used to communicate input to InstallAPI.
static bool isPPC_64Builtin(unsigned BuiltinID)
@ Result
The result type of a method or function.
static QualType DecodePPCMMATypeFromStr(ASTContext &Context, const char *&Str, unsigned &Mask)
DecodePPCMMATypeFromStr - This decodes one PPC MMA type descriptor from Str, advancing the pointer ov...
@ AltiVecVector
is AltiVec vector
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