clang 20.0.0git
SemaPPC.cpp
Go to the documentation of this file.
1//===------ SemaPPC.cpp ------ PowerPC target-specific routines -----------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements semantic analysis functions specific to PowerPC.
10//
11//===----------------------------------------------------------------------===//
12
13#include "clang/Sema/SemaPPC.h"
15#include "clang/AST/Attr.h"
16#include "clang/AST/CharUnits.h"
17#include "clang/AST/Decl.h"
18#include "clang/AST/Type.h"
22#include "clang/Sema/Sema.h"
23#include "llvm/ADT/APSInt.h"
24
25namespace clang {
26
28
30 const auto *ICE = dyn_cast<ImplicitCastExpr>(Arg->IgnoreParens());
31 if (!ICE)
32 return;
33
34 const auto *DR = dyn_cast<DeclRefExpr>(ICE->getSubExpr());
35 if (!DR)
36 return;
37
38 const auto *PD = dyn_cast<ParmVarDecl>(DR->getDecl());
39 if (!PD || !PD->getType()->isRecordType())
40 return;
41
42 QualType ArgType = Arg->getType();
43 for (const FieldDecl *FD :
44 ArgType->castAs<RecordType>()->getDecl()->fields()) {
45 if (const auto *AA = FD->getAttr<AlignedAttr>()) {
47 AA->getAlignment(getASTContext()));
48 if (Alignment.getQuantity() == 16) {
49 Diag(FD->getLocation(), diag::warn_not_xl_compatible) << FD;
50 Diag(Loc, diag::note_misaligned_member_used_here) << PD;
51 }
52 }
53 }
54}
55
56static bool isPPC_64Builtin(unsigned BuiltinID) {
57 // These builtins only work on PPC 64bit targets.
58 switch (BuiltinID) {
59 case PPC::BI__builtin_divde:
60 case PPC::BI__builtin_divdeu:
61 case PPC::BI__builtin_bpermd:
62 case PPC::BI__builtin_pdepd:
63 case PPC::BI__builtin_pextd:
64 case PPC::BI__builtin_ppc_cdtbcd:
65 case PPC::BI__builtin_ppc_cbcdtd:
66 case PPC::BI__builtin_ppc_addg6s:
67 case PPC::BI__builtin_ppc_ldarx:
68 case PPC::BI__builtin_ppc_stdcx:
69 case PPC::BI__builtin_ppc_tdw:
70 case PPC::BI__builtin_ppc_trapd:
71 case PPC::BI__builtin_ppc_cmpeqb:
72 case PPC::BI__builtin_ppc_setb:
73 case PPC::BI__builtin_ppc_mulhd:
74 case PPC::BI__builtin_ppc_mulhdu:
75 case PPC::BI__builtin_ppc_maddhd:
76 case PPC::BI__builtin_ppc_maddhdu:
77 case PPC::BI__builtin_ppc_maddld:
78 case PPC::BI__builtin_ppc_load8r:
79 case PPC::BI__builtin_ppc_store8r:
80 case PPC::BI__builtin_ppc_insert_exp:
81 case PPC::BI__builtin_ppc_extract_sig:
82 case PPC::BI__builtin_ppc_addex:
83 case PPC::BI__builtin_darn:
84 case PPC::BI__builtin_darn_raw:
85 case PPC::BI__builtin_ppc_compare_and_swaplp:
86 case PPC::BI__builtin_ppc_fetch_and_addlp:
87 case PPC::BI__builtin_ppc_fetch_and_andlp:
88 case PPC::BI__builtin_ppc_fetch_and_orlp:
89 case PPC::BI__builtin_ppc_fetch_and_swaplp:
90 return true;
91 }
92 return false;
93}
94
96 unsigned BuiltinID,
97 CallExpr *TheCall) {
98 ASTContext &Context = getASTContext();
99 bool IsTarget64Bit = TI.getTypeWidth(TI.getIntPtrType()) == 64;
100 llvm::APSInt Result;
101
102 if (isPPC_64Builtin(BuiltinID) && !IsTarget64Bit)
103 return Diag(TheCall->getBeginLoc(), diag::err_64_bit_builtin_32_bit_tgt)
104 << TheCall->getSourceRange();
105
106 switch (BuiltinID) {
107 default:
108 return false;
109 case PPC::BI__builtin_altivec_crypto_vshasigmaw:
110 case PPC::BI__builtin_altivec_crypto_vshasigmad:
111 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1) ||
112 SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 15);
113 case PPC::BI__builtin_altivec_dss:
114 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 3);
115 case PPC::BI__builtin_tbegin:
116 case PPC::BI__builtin_tend:
117 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 1);
118 case PPC::BI__builtin_tsr:
119 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 7);
120 case PPC::BI__builtin_tabortwc:
121 case PPC::BI__builtin_tabortdc:
122 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 31);
123 case PPC::BI__builtin_tabortwci:
124 case PPC::BI__builtin_tabortdci:
125 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 31) ||
126 SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 31);
127 // According to GCC 'Basic PowerPC Built-in Functions Available on ISA 2.05',
128 // __builtin_(un)pack_longdouble are available only if long double uses IBM
129 // extended double representation.
130 case PPC::BI__builtin_unpack_longdouble:
131 if (SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1))
132 return true;
133 [[fallthrough]];
134 case PPC::BI__builtin_pack_longdouble:
135 if (&TI.getLongDoubleFormat() != &llvm::APFloat::PPCDoubleDouble())
136 return Diag(TheCall->getBeginLoc(), diag::err_ppc_builtin_requires_abi)
137 << "ibmlongdouble";
138 return false;
139 case PPC::BI__builtin_altivec_dst:
140 case PPC::BI__builtin_altivec_dstt:
141 case PPC::BI__builtin_altivec_dstst:
142 case PPC::BI__builtin_altivec_dststt:
143 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 3);
144 case PPC::BI__builtin_vsx_xxpermdi:
145 case PPC::BI__builtin_vsx_xxsldwi:
146 return BuiltinVSX(TheCall);
147 case PPC::BI__builtin_unpack_vector_int128:
148 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1);
149 case PPC::BI__builtin_altivec_vgnb:
150 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 2, 7);
151 case PPC::BI__builtin_vsx_xxeval:
152 return SemaRef.BuiltinConstantArgRange(TheCall, 3, 0, 255);
153 case PPC::BI__builtin_altivec_vsldbi:
154 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 7);
155 case PPC::BI__builtin_altivec_vsrdbi:
156 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 7);
157 case PPC::BI__builtin_vsx_xxpermx:
158 return SemaRef.BuiltinConstantArgRange(TheCall, 3, 0, 7);
159 case PPC::BI__builtin_ppc_tw:
160 case PPC::BI__builtin_ppc_tdw:
161 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 1, 31);
162 case PPC::BI__builtin_ppc_cmprb:
163 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 1);
164 // For __rlwnm, __rlwimi and __rldimi, the last parameter mask must
165 // be a constant that represents a contiguous bit field.
166 case PPC::BI__builtin_ppc_rlwnm:
167 return SemaRef.ValueIsRunOfOnes(TheCall, 2);
168 case PPC::BI__builtin_ppc_rlwimi:
169 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 31) ||
170 SemaRef.ValueIsRunOfOnes(TheCall, 3);
171 case PPC::BI__builtin_ppc_rldimi:
172 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 63) ||
173 SemaRef.ValueIsRunOfOnes(TheCall, 3);
174 case PPC::BI__builtin_ppc_addex: {
175 if (SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 3))
176 return true;
177 // Output warning for reserved values 1 to 3.
178 int ArgValue =
179 TheCall->getArg(2)->getIntegerConstantExpr(Context)->getSExtValue();
180 if (ArgValue != 0)
181 Diag(TheCall->getBeginLoc(), diag::warn_argument_undefined_behaviour)
182 << ArgValue;
183 return false;
184 }
185 case PPC::BI__builtin_ppc_mtfsb0:
186 case PPC::BI__builtin_ppc_mtfsb1:
187 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 31);
188 case PPC::BI__builtin_ppc_mtfsf:
189 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 255);
190 case PPC::BI__builtin_ppc_mtfsfi:
191 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 7) ||
192 SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 15);
193 case PPC::BI__builtin_ppc_alignx:
194 return SemaRef.BuiltinConstantArgPower2(TheCall, 0);
195 case PPC::BI__builtin_ppc_rdlam:
196 return SemaRef.ValueIsRunOfOnes(TheCall, 2);
197 case PPC::BI__builtin_vsx_ldrmb:
198 case PPC::BI__builtin_vsx_strmb:
199 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 1, 16);
200 case PPC::BI__builtin_altivec_vcntmbb:
201 case PPC::BI__builtin_altivec_vcntmbh:
202 case PPC::BI__builtin_altivec_vcntmbw:
203 case PPC::BI__builtin_altivec_vcntmbd:
204 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1);
205 case PPC::BI__builtin_vsx_xxgenpcvbm:
206 case PPC::BI__builtin_vsx_xxgenpcvhm:
207 case PPC::BI__builtin_vsx_xxgenpcvwm:
208 case PPC::BI__builtin_vsx_xxgenpcvdm:
209 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 3);
210 case PPC::BI__builtin_ppc_test_data_class: {
211 // Check if the first argument of the __builtin_ppc_test_data_class call is
212 // valid. The argument must be 'float' or 'double' or '__float128'.
213 QualType ArgType = TheCall->getArg(0)->getType();
214 if (ArgType != QualType(Context.FloatTy) &&
215 ArgType != QualType(Context.DoubleTy) &&
216 ArgType != QualType(Context.Float128Ty))
217 return Diag(TheCall->getBeginLoc(),
218 diag::err_ppc_invalid_test_data_class_type);
219 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 127);
220 }
221 case PPC::BI__builtin_ppc_maxfe:
222 case PPC::BI__builtin_ppc_minfe:
223 case PPC::BI__builtin_ppc_maxfl:
224 case PPC::BI__builtin_ppc_minfl:
225 case PPC::BI__builtin_ppc_maxfs:
226 case PPC::BI__builtin_ppc_minfs: {
227 if (Context.getTargetInfo().getTriple().isOSAIX() &&
228 (BuiltinID == PPC::BI__builtin_ppc_maxfe ||
229 BuiltinID == PPC::BI__builtin_ppc_minfe))
230 return Diag(TheCall->getBeginLoc(), diag::err_target_unsupported_type)
231 << "builtin" << true << 128 << QualType(Context.LongDoubleTy)
232 << false << Context.getTargetInfo().getTriple().str();
233 // Argument type should be exact.
234 QualType ArgType = QualType(Context.LongDoubleTy);
235 if (BuiltinID == PPC::BI__builtin_ppc_maxfl ||
236 BuiltinID == PPC::BI__builtin_ppc_minfl)
237 ArgType = QualType(Context.DoubleTy);
238 else if (BuiltinID == PPC::BI__builtin_ppc_maxfs ||
239 BuiltinID == PPC::BI__builtin_ppc_minfs)
240 ArgType = QualType(Context.FloatTy);
241 for (unsigned I = 0, E = TheCall->getNumArgs(); I < E; ++I)
242 if (TheCall->getArg(I)->getType() != ArgType)
243 return Diag(TheCall->getBeginLoc(),
244 diag::err_typecheck_convert_incompatible)
245 << TheCall->getArg(I)->getType() << ArgType << 1 << 0 << 0;
246 return false;
247 }
248#define CUSTOM_BUILTIN(Name, Intr, Types, Acc, Feature) \
249 case PPC::BI__builtin_##Name: \
250 return BuiltinPPCMMACall(TheCall, BuiltinID, Types);
251#include "clang/Basic/BuiltinsPPC.def"
252 }
253 llvm_unreachable("must return from switch");
254}
255
256// Check if the given type is a non-pointer PPC MMA type. This function is used
257// in Sema to prevent invalid uses of restricted PPC MMA types.
259 ASTContext &Context = getASTContext();
260 if (Type->isPointerType() || Type->isArrayType())
261 return false;
262
263 QualType CoreType = Type.getCanonicalType().getUnqualifiedType();
264#define PPC_VECTOR_TYPE(Name, Id, Size) || CoreType == Context.Id##Ty
265 if (false
266#include "clang/Basic/PPCTypes.def"
267 ) {
268 Diag(TypeLoc, diag::err_ppc_invalid_use_mma_type);
269 return true;
270 }
271 return false;
272}
273
274/// DecodePPCMMATypeFromStr - This decodes one PPC MMA type descriptor from Str,
275/// advancing the pointer over the consumed characters. The decoded type is
276/// returned. If the decoded type represents a constant integer with a
277/// constraint on its value then Mask is set to that value. The type descriptors
278/// used in Str are specific to PPC MMA builtins and are documented in the file
279/// defining the PPC builtins.
280static QualType DecodePPCMMATypeFromStr(ASTContext &Context, const char *&Str,
281 unsigned &Mask) {
282 bool RequireICE = false;
284 switch (*Str++) {
285 case 'V':
286 return Context.getVectorType(Context.UnsignedCharTy, 16,
288 case 'i': {
289 char *End;
290 unsigned size = strtoul(Str, &End, 10);
291 assert(End != Str && "Missing constant parameter constraint");
292 Str = End;
293 Mask = size;
294 return Context.IntTy;
295 }
296 case 'W': {
297 char *End;
298 unsigned size = strtoul(Str, &End, 10);
299 assert(End != Str && "Missing PowerPC MMA type size");
300 Str = End;
302 switch (size) {
303#define PPC_VECTOR_TYPE(typeName, Id, size) \
304 case size: \
305 Type = Context.Id##Ty; \
306 break;
307#include "clang/Basic/PPCTypes.def"
308 default:
309 llvm_unreachable("Invalid PowerPC MMA vector type");
310 }
311 bool CheckVectorArgs = false;
312 while (!CheckVectorArgs) {
313 switch (*Str++) {
314 case '*':
315 Type = Context.getPointerType(Type);
316 break;
317 case 'C':
318 Type = Type.withConst();
319 break;
320 default:
321 CheckVectorArgs = true;
322 --Str;
323 break;
324 }
325 }
326 return Type;
327 }
328 default:
329 return Context.DecodeTypeStr(--Str, Context, Error, RequireICE, true);
330 }
331}
332
333bool SemaPPC::BuiltinPPCMMACall(CallExpr *TheCall, unsigned BuiltinID,
334 const char *TypeStr) {
335
336 assert((TypeStr[0] != '\0') &&
337 "Invalid types in PPC MMA builtin declaration");
338
339 ASTContext &Context = getASTContext();
340 unsigned Mask = 0;
341 unsigned ArgNum = 0;
342
343 // The first type in TypeStr is the type of the value returned by the
344 // builtin. So we first read that type and change the type of TheCall.
345 QualType type = DecodePPCMMATypeFromStr(Context, TypeStr, Mask);
346 TheCall->setType(type);
347
348 while (*TypeStr != '\0') {
349 Mask = 0;
350 QualType ExpectedType = DecodePPCMMATypeFromStr(Context, TypeStr, Mask);
351 if (ArgNum >= TheCall->getNumArgs()) {
352 ArgNum++;
353 break;
354 }
355
356 Expr *Arg = TheCall->getArg(ArgNum);
357 QualType PassedType = Arg->getType();
358 QualType StrippedRVType = PassedType.getCanonicalType();
359
360 // Strip Restrict/Volatile qualifiers.
361 if (StrippedRVType.isRestrictQualified() ||
362 StrippedRVType.isVolatileQualified())
363 StrippedRVType = StrippedRVType.getCanonicalType().getUnqualifiedType();
364
365 // The only case where the argument type and expected type are allowed to
366 // mismatch is if the argument type is a non-void pointer (or array) and
367 // expected type is a void pointer.
368 if (StrippedRVType != ExpectedType)
369 if (!(ExpectedType->isVoidPointerType() &&
370 (StrippedRVType->isPointerType() || StrippedRVType->isArrayType())))
371 return Diag(Arg->getBeginLoc(),
372 diag::err_typecheck_convert_incompatible)
373 << PassedType << ExpectedType << 1 << 0 << 0;
374
375 // If the value of the Mask is not 0, we have a constraint in the size of
376 // the integer argument so here we ensure the argument is a constant that
377 // is in the valid range.
378 if (Mask != 0 &&
379 SemaRef.BuiltinConstantArgRange(TheCall, ArgNum, 0, Mask, true))
380 return true;
381
382 ArgNum++;
383 }
384
385 // In case we exited early from the previous loop, there are other types to
386 // read from TypeStr. So we need to read them all to ensure we have the right
387 // number of arguments in TheCall and if it is not the case, to display a
388 // better error message.
389 while (*TypeStr != '\0') {
390 (void)DecodePPCMMATypeFromStr(Context, TypeStr, Mask);
391 ArgNum++;
392 }
393 if (SemaRef.checkArgCount(TheCall, ArgNum))
394 return true;
395
396 return false;
397}
398
400 unsigned ExpectedNumArgs = 3;
401 if (SemaRef.checkArgCount(TheCall, ExpectedNumArgs))
402 return true;
403
404 // Check the third argument is a compile time constant
405 if (!TheCall->getArg(2)->isIntegerConstantExpr(getASTContext()))
406 return Diag(TheCall->getBeginLoc(),
407 diag::err_vsx_builtin_nonconstant_argument)
408 << 3 /* argument index */ << TheCall->getDirectCallee()
409 << SourceRange(TheCall->getArg(2)->getBeginLoc(),
410 TheCall->getArg(2)->getEndLoc());
411
412 QualType Arg1Ty = TheCall->getArg(0)->getType();
413 QualType Arg2Ty = TheCall->getArg(1)->getType();
414
415 // Check the type of argument 1 and argument 2 are vectors.
416 SourceLocation BuiltinLoc = TheCall->getBeginLoc();
417 if ((!Arg1Ty->isVectorType() && !Arg1Ty->isDependentType()) ||
418 (!Arg2Ty->isVectorType() && !Arg2Ty->isDependentType())) {
419 return Diag(BuiltinLoc, diag::err_vec_builtin_non_vector)
420 << TheCall->getDirectCallee() << /*isMorethantwoArgs*/ false
421 << SourceRange(TheCall->getArg(0)->getBeginLoc(),
422 TheCall->getArg(1)->getEndLoc());
423 }
424
425 // Check the first two arguments are the same type.
426 if (!getASTContext().hasSameUnqualifiedType(Arg1Ty, Arg2Ty)) {
427 return Diag(BuiltinLoc, diag::err_vec_builtin_incompatible_vector)
428 << TheCall->getDirectCallee() << /*isMorethantwoArgs*/ false
429 << SourceRange(TheCall->getArg(0)->getBeginLoc(),
430 TheCall->getArg(1)->getEndLoc());
431 }
432
433 // When default clang type checking is turned off and the customized type
434 // checking is used, the returning type of the function must be explicitly
435 // set. Otherwise it is _Bool by default.
436 TheCall->setType(Arg1Ty);
437
438 return false;
439}
440
441} // namespace clang
Defines the clang::ASTContext interface.
Expr * E
SourceLocation Loc
Definition: SemaObjC.cpp:758
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 ...
Definition: ASTContext.h:187
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 IntTy
Definition: ASTContext.h:1128
CanQualType UnsignedCharTy
Definition: ASTContext.h:1129
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
@ GE_None
No error.
Definition: ASTContext.h:2296
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2830
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
Definition: Expr.h:3021
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Expr.cpp:1638
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
Definition: Expr.h:3000
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:3008
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Definition: CharUnits.h:185
This represents one expression.
Definition: Expr.h:110
void setType(QualType t)
Definition: Expr.h:143
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
Definition: Expr.cpp:3066
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.
QualType getType() const
Definition: Expr.h:142
Represents a member of a struct/union/class.
Definition: Decl.h:3030
A (possibly-)qualified type.
Definition: Type.h:941
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
Definition: Type.h:7834
bool isRestrictQualified() const
Determine whether this type is restrict-qualified.
Definition: Type.h:7828
QualType getCanonicalType() const
Definition: Type.h:7802
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
Definition: Type.h:7844
field_range fields() const
Definition: Decl.h:4351
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:5965
RecordDecl * getDecl() const
Definition: Type.h:5975
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
Definition: SemaBase.cpp:60
ASTContext & getASTContext() const
Definition: SemaBase.cpp:9
Sema & SemaRef
Definition: SemaBase.h:40
bool CheckPPCBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaPPC.cpp:95
void checkAIXMemberAlignment(SourceLocation Loc, const Expr *Arg)
Definition: SemaPPC.cpp:29
SemaPPC(Sema &S)
Definition: SemaPPC.cpp:27
bool BuiltinPPCMMACall(CallExpr *TheCall, unsigned BuiltinID, const char *TypeDesc)
BuiltinPPCMMACall - Check the call to a PPC MMA builtin for validity.
Definition: SemaPPC.cpp:333
bool BuiltinVSX(CallExpr *TheCall)
Definition: SemaPPC.cpp:399
bool CheckPPCMMAType(QualType Type, SourceLocation TypeLoc)
Definition: SemaPPC.cpp:258
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:535
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
Definition: Stmt.cpp:350
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition: Stmt.cpp:326
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Stmt.cpp:338
Exposes information about the current target.
Definition: TargetInfo.h:218
unsigned getTypeWidth(IntType T) const
Return the width (in bits) of the specified integer type enum.
Definition: TargetInfo.cpp:270
IntType getIntPtrType() const
Definition: TargetInfo.h:397
const llvm::fltSemantics & getLongDoubleFormat() const
Definition: TargetInfo.h:785
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:59
The base class of the type hierarchy.
Definition: Type.h:1829
bool isArrayType() const
Definition: Type.h:8075
bool isPointerType() const
Definition: Type.h:8003
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:8607
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2695
bool isVectorType() const
Definition: Type.h:8115
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)
Definition: SemaPPC.cpp:56
@ 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...
Definition: SemaPPC.cpp:280
@ AltiVecVector
is AltiVec vector