clang 22.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"
23#include "clang/Sema/Sema.h"
24#include "llvm/ADT/APSInt.h"
25
26namespace clang {
27
29
31 const auto *ICE = dyn_cast<ImplicitCastExpr>(Arg->IgnoreParens());
32 if (!ICE)
33 return;
34
35 const auto *DR = dyn_cast<DeclRefExpr>(ICE->getSubExpr());
36 if (!DR)
37 return;
38
39 const auto *PD = dyn_cast<ParmVarDecl>(DR->getDecl());
40 if (!PD || !PD->getType()->isRecordType())
41 return;
42
43 QualType ArgType = Arg->getType();
44 for (const FieldDecl *FD : ArgType->castAsRecordDecl()->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 case PPC::BI__builtin_amo_lwat:
91 case PPC::BI__builtin_amo_ldat:
92 return true;
93 }
94 return false;
95}
96
98 unsigned BuiltinID,
99 CallExpr *TheCall) {
100 ASTContext &Context = getASTContext();
101 bool IsTarget64Bit = TI.getTypeWidth(TI.getIntPtrType()) == 64;
102
103 if (isPPC_64Builtin(BuiltinID) && !IsTarget64Bit)
104 return Diag(TheCall->getBeginLoc(), diag::err_64_bit_builtin_32_bit_tgt)
105 << TheCall->getSourceRange();
106
107 switch (BuiltinID) {
108 default:
109 return false;
110 case PPC::BI__builtin_ppc_bcdsetsign:
111 case PPC::BI__builtin_ppc_national2packed:
112 case PPC::BI__builtin_ppc_packed2zoned:
113 case PPC::BI__builtin_ppc_zoned2packed:
114 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1);
115 case PPC::BI__builtin_altivec_crypto_vshasigmaw:
116 case PPC::BI__builtin_altivec_crypto_vshasigmad:
117 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1) ||
118 SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 15);
119 case PPC::BI__builtin_altivec_dss:
120 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 3);
121 case PPC::BI__builtin_tbegin:
122 case PPC::BI__builtin_tend:
123 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 1);
124 case PPC::BI__builtin_tsr:
125 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 7);
126 case PPC::BI__builtin_tabortwc:
127 case PPC::BI__builtin_tabortdc:
128 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 31);
129 case PPC::BI__builtin_tabortwci:
130 case PPC::BI__builtin_tabortdci:
131 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 31) ||
132 SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 31);
133 // According to GCC 'Basic PowerPC Built-in Functions Available on ISA 2.05',
134 // __builtin_(un)pack_longdouble are available only if long double uses IBM
135 // extended double representation.
136 case PPC::BI__builtin_unpack_longdouble:
137 if (SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1))
138 return true;
139 [[fallthrough]];
140 case PPC::BI__builtin_pack_longdouble:
141 if (&TI.getLongDoubleFormat() != &llvm::APFloat::PPCDoubleDouble())
142 return Diag(TheCall->getBeginLoc(), diag::err_ppc_builtin_requires_abi)
143 << "ibmlongdouble";
144 return false;
145 case PPC::BI__builtin_altivec_dst:
146 case PPC::BI__builtin_altivec_dstt:
147 case PPC::BI__builtin_altivec_dstst:
148 case PPC::BI__builtin_altivec_dststt:
149 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 3);
150 case PPC::BI__builtin_vsx_xxpermdi:
151 case PPC::BI__builtin_vsx_xxsldwi:
152 return BuiltinVSX(TheCall);
153 case PPC::BI__builtin_unpack_vector_int128:
154 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1);
155 case PPC::BI__builtin_altivec_vgnb:
156 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 2, 7);
157 case PPC::BI__builtin_vsx_xxeval:
158 return SemaRef.BuiltinConstantArgRange(TheCall, 3, 0, 255);
159 case PPC::BI__builtin_altivec_vsldbi:
160 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 7);
161 case PPC::BI__builtin_altivec_vsrdbi:
162 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 7);
163 case PPC::BI__builtin_vsx_xxpermx:
164 return SemaRef.BuiltinConstantArgRange(TheCall, 3, 0, 7);
165 case PPC::BI__builtin_ppc_tw:
166 case PPC::BI__builtin_ppc_tdw:
167 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 1, 31);
168 case PPC::BI__builtin_ppc_cmprb:
169 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 1);
170 // For __rlwnm, __rlwimi and __rldimi, the last parameter mask must
171 // be a constant that represents a contiguous bit field.
172 case PPC::BI__builtin_ppc_rlwnm:
173 return SemaRef.ValueIsRunOfOnes(TheCall, 2);
174 case PPC::BI__builtin_ppc_rlwimi:
175 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 31) ||
176 SemaRef.ValueIsRunOfOnes(TheCall, 3);
177 case PPC::BI__builtin_ppc_rldimi:
178 return SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 63) ||
179 SemaRef.ValueIsRunOfOnes(TheCall, 3);
180 case PPC::BI__builtin_ppc_addex: {
181 if (SemaRef.BuiltinConstantArgRange(TheCall, 2, 0, 3))
182 return true;
183 // Output warning for reserved values 1 to 3.
184 int ArgValue =
185 TheCall->getArg(2)->getIntegerConstantExpr(Context)->getSExtValue();
186 if (ArgValue != 0)
187 Diag(TheCall->getBeginLoc(), diag::warn_argument_undefined_behaviour)
188 << ArgValue;
189 return false;
190 }
191 case PPC::BI__builtin_ppc_mtfsb0:
192 case PPC::BI__builtin_ppc_mtfsb1:
193 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 31);
194 case PPC::BI__builtin_ppc_mtfsf:
195 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 255);
196 case PPC::BI__builtin_ppc_mtfsfi:
197 return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 7) ||
198 SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 15);
199 case PPC::BI__builtin_ppc_alignx:
200 return SemaRef.BuiltinConstantArgPower2(TheCall, 0);
201 case PPC::BI__builtin_ppc_rdlam:
202 return SemaRef.ValueIsRunOfOnes(TheCall, 2);
203 case PPC::BI__builtin_vsx_ldrmb:
204 case PPC::BI__builtin_vsx_strmb:
205 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 1, 16);
206 case PPC::BI__builtin_altivec_vcntmbb:
207 case PPC::BI__builtin_altivec_vcntmbh:
208 case PPC::BI__builtin_altivec_vcntmbw:
209 case PPC::BI__builtin_altivec_vcntmbd:
210 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1);
211 case PPC::BI__builtin_vsx_xxgenpcvbm:
212 case PPC::BI__builtin_vsx_xxgenpcvhm:
213 case PPC::BI__builtin_vsx_xxgenpcvwm:
214 case PPC::BI__builtin_vsx_xxgenpcvdm:
215 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 3);
216 case PPC::BI__builtin_ppc_test_data_class: {
217 // Check if the first argument of the __builtin_ppc_test_data_class call is
218 // valid. The argument must be 'float' or 'double' or '__float128'.
219 QualType ArgType = TheCall->getArg(0)->getType();
220 if (ArgType != QualType(Context.FloatTy) &&
221 ArgType != QualType(Context.DoubleTy) &&
222 ArgType != QualType(Context.Float128Ty))
223 return Diag(TheCall->getBeginLoc(),
224 diag::err_ppc_invalid_test_data_class_type);
225 return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 127);
226 }
227 case PPC::BI__builtin_ppc_maxfe:
228 case PPC::BI__builtin_ppc_minfe:
229 case PPC::BI__builtin_ppc_maxfl:
230 case PPC::BI__builtin_ppc_minfl:
231 case PPC::BI__builtin_ppc_maxfs:
232 case PPC::BI__builtin_ppc_minfs: {
233 if (Context.getTargetInfo().getTriple().isOSAIX() &&
234 (BuiltinID == PPC::BI__builtin_ppc_maxfe ||
235 BuiltinID == PPC::BI__builtin_ppc_minfe))
236 return Diag(TheCall->getBeginLoc(), diag::err_target_unsupported_type)
237 << "builtin" << true << 128 << QualType(Context.LongDoubleTy)
238 << false << Context.getTargetInfo().getTriple().str();
239 // Argument type should be exact.
240 QualType ArgType = QualType(Context.LongDoubleTy);
241 if (BuiltinID == PPC::BI__builtin_ppc_maxfl ||
242 BuiltinID == PPC::BI__builtin_ppc_minfl)
243 ArgType = QualType(Context.DoubleTy);
244 else if (BuiltinID == PPC::BI__builtin_ppc_maxfs ||
245 BuiltinID == PPC::BI__builtin_ppc_minfs)
246 ArgType = QualType(Context.FloatTy);
247 for (unsigned I = 0, E = TheCall->getNumArgs(); I < E; ++I)
248 if (TheCall->getArg(I)->getType() != ArgType)
249 return Diag(TheCall->getBeginLoc(),
250 diag::err_typecheck_convert_incompatible)
251 << TheCall->getArg(I)->getType() << ArgType << 1 << 0 << 0;
252 return false;
253 }
254#define CUSTOM_BUILTIN(Name, Intr, Types, Acc, Feature) \
255 case PPC::BI__builtin_##Name: \
256 return BuiltinPPCMMACall(TheCall, BuiltinID, Types);
257#include "clang/Basic/BuiltinsPPC.def"
258 case PPC::BI__builtin_amo_lwat:
259 case PPC::BI__builtin_amo_ldat: {
260 llvm::APSInt Result;
261 if (SemaRef.BuiltinConstantArg(TheCall, 2, Result))
262 return true;
263 unsigned Val = Result.getZExtValue();
264 static constexpr unsigned ValidFC[] = {0, 1, 2, 3, 4, 6, 8};
265 if (llvm::is_contained(ValidFC, Val))
266 return false;
267 Expr *Arg = TheCall->getArg(2);
268 return SemaRef.Diag(Arg->getBeginLoc(), diag::err_argument_invalid_range)
269 << toString(Result, 10) << "0-4, 6" << "8" << Arg->getSourceRange();
270 }
271 }
272 llvm_unreachable("must return from switch");
273}
274
275// Check if the given type is a non-pointer PPC MMA type. This function is used
276// in Sema to prevent invalid uses of restricted PPC MMA types.
278 ASTContext &Context = getASTContext();
279 if (Type->isPointerType() || Type->isArrayType())
280 return false;
281
282 QualType CoreType = Type.getCanonicalType().getUnqualifiedType();
283#define PPC_VECTOR_TYPE(Name, Id, Size) || CoreType == Context.Id##Ty
284 if (false
285#include "clang/Basic/PPCTypes.def"
286 ) {
287 Diag(TypeLoc, diag::err_ppc_invalid_use_mma_type);
288 return true;
289 }
290 return false;
291}
292
293/// DecodePPCMMATypeFromStr - This decodes one PPC MMA type descriptor from Str,
294/// advancing the pointer over the consumed characters. The decoded type is
295/// returned. If the decoded type represents a constant integer with a
296/// constraint on its value then Mask is set to that value. The type descriptors
297/// used in Str are specific to PPC MMA builtins and are documented in the file
298/// defining the PPC builtins.
299static QualType DecodePPCMMATypeFromStr(ASTContext &Context, const char *&Str,
300 unsigned &Mask) {
301 bool RequireICE = false;
303 switch (*Str++) {
304 case 'V':
305 return Context.getVectorType(Context.UnsignedCharTy, 16,
307 case 'i': {
308 char *End;
309 unsigned size = strtoul(Str, &End, 10);
310 assert(End != Str && "Missing constant parameter constraint");
311 Str = End;
312 Mask = size;
313 return Context.IntTy;
314 }
315 case 'W': {
316 char *End;
317 unsigned size = strtoul(Str, &End, 10);
318 assert(End != Str && "Missing PowerPC MMA type size");
319 Str = End;
321 switch (size) {
322#define PPC_VECTOR_TYPE(typeName, Id, size) \
323 case size: \
324 Type = Context.Id##Ty; \
325 break;
326#include "clang/Basic/PPCTypes.def"
327 default:
328 llvm_unreachable("Invalid PowerPC MMA vector type");
329 }
330 bool CheckVectorArgs = false;
331 while (!CheckVectorArgs) {
332 switch (*Str++) {
333 case '*':
334 Type = Context.getPointerType(Type);
335 break;
336 case 'C':
337 Type = Type.withConst();
338 break;
339 default:
340 CheckVectorArgs = true;
341 --Str;
342 break;
343 }
344 }
345 return Type;
346 }
347 default:
348 return Context.DecodeTypeStr(--Str, Context, Error, RequireICE, true);
349 }
350}
351
352bool SemaPPC::BuiltinPPCMMACall(CallExpr *TheCall, unsigned BuiltinID,
353 const char *TypeStr) {
354
355 assert((TypeStr[0] != '\0') &&
356 "Invalid types in PPC MMA builtin declaration");
357
358 ASTContext &Context = getASTContext();
359 unsigned Mask = 0;
360 unsigned ArgNum = 0;
361
362 // The first type in TypeStr is the type of the value returned by the
363 // builtin. So we first read that type and change the type of TheCall.
364 QualType type = DecodePPCMMATypeFromStr(Context, TypeStr, Mask);
365 TheCall->setType(type);
366
367 while (*TypeStr != '\0') {
368 Mask = 0;
369 QualType ExpectedType = DecodePPCMMATypeFromStr(Context, TypeStr, Mask);
370 if (ArgNum >= TheCall->getNumArgs()) {
371 ArgNum++;
372 break;
373 }
374
375 Expr *Arg = TheCall->getArg(ArgNum);
376 QualType PassedType = Arg->getType();
377 QualType StrippedRVType = PassedType.getCanonicalType();
378
379 // Strip Restrict/Volatile qualifiers.
380 if (StrippedRVType.isRestrictQualified() ||
381 StrippedRVType.isVolatileQualified())
382 StrippedRVType = StrippedRVType.getCanonicalType().getUnqualifiedType();
383
384 // The only case where the argument type and expected type are allowed to
385 // mismatch is if the argument type is a non-void pointer (or array) and
386 // expected type is a void pointer.
387 if (StrippedRVType != ExpectedType)
388 if (!(ExpectedType->isVoidPointerType() &&
389 (StrippedRVType->isPointerType() || StrippedRVType->isArrayType())))
390 return Diag(Arg->getBeginLoc(),
391 diag::err_typecheck_convert_incompatible)
392 << PassedType << ExpectedType << 1 << 0 << 0;
393
394 // If the value of the Mask is not 0, we have a constraint in the size of
395 // the integer argument so here we ensure the argument is a constant that
396 // is in the valid range.
397 if (Mask != 0 &&
398 SemaRef.BuiltinConstantArgRange(TheCall, ArgNum, 0, Mask, true))
399 return true;
400
401 ArgNum++;
402 }
403
404 // In case we exited early from the previous loop, there are other types to
405 // read from TypeStr. So we need to read them all to ensure we have the right
406 // number of arguments in TheCall and if it is not the case, to display a
407 // better error message.
408 while (*TypeStr != '\0') {
409 (void)DecodePPCMMATypeFromStr(Context, TypeStr, Mask);
410 ArgNum++;
411 }
412 if (SemaRef.checkArgCount(TheCall, ArgNum))
413 return true;
414
415 return false;
416}
417
419 unsigned ExpectedNumArgs = 3;
420 if (SemaRef.checkArgCount(TheCall, ExpectedNumArgs))
421 return true;
422
423 // Check the third argument is a compile time constant
424 if (!TheCall->getArg(2)->isIntegerConstantExpr(getASTContext()))
425 return Diag(TheCall->getBeginLoc(),
426 diag::err_vsx_builtin_nonconstant_argument)
427 << 3 /* argument index */ << TheCall->getDirectCallee()
428 << SourceRange(TheCall->getArg(2)->getBeginLoc(),
429 TheCall->getArg(2)->getEndLoc());
430
431 QualType Arg1Ty = TheCall->getArg(0)->getType();
432 QualType Arg2Ty = TheCall->getArg(1)->getType();
433
434 // Check the type of argument 1 and argument 2 are vectors.
435 SourceLocation BuiltinLoc = TheCall->getBeginLoc();
436 if ((!Arg1Ty->isVectorType() && !Arg1Ty->isDependentType()) ||
437 (!Arg2Ty->isVectorType() && !Arg2Ty->isDependentType())) {
438 return Diag(BuiltinLoc, diag::err_vec_builtin_non_vector)
439 << TheCall->getDirectCallee() << /*isMorethantwoArgs*/ false
440 << SourceRange(TheCall->getArg(0)->getBeginLoc(),
441 TheCall->getArg(1)->getEndLoc());
442 }
443
444 // Check the first two arguments are the same type.
445 if (!getASTContext().hasSameUnqualifiedType(Arg1Ty, Arg2Ty)) {
446 return Diag(BuiltinLoc, diag::err_vec_builtin_incompatible_vector)
447 << TheCall->getDirectCallee() << /*isMorethantwoArgs*/ false
448 << SourceRange(TheCall->getArg(0)->getBeginLoc(),
449 TheCall->getArg(1)->getEndLoc());
450 }
451
452 // When default clang type checking is turned off and the customized type
453 // checking is used, the returning type of the function must be explicitly
454 // set. Otherwise it is _Bool by default.
455 TheCall->setType(Arg1Ty);
456
457 return false;
458}
459
460} // namespace clang
Defines the clang::ASTContext interface.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
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:220
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
@ GE_None
No error.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2877
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
Definition Expr.h:3081
SourceLocation getBeginLoc() const
Definition Expr.h:3211
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
Definition Expr.h:3060
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3068
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:112
bool isIntegerConstantExpr(const ASTContext &Ctx) const
void setType(QualType t)
Definition Expr.h:145
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
Definition Expr.cpp:3082
std::optional< llvm::APSInt > getIntegerConstantExpr(const ASTContext &Ctx) const
isIntegerConstantExpr - Return the value if this expression is a valid integer constant expression.
QualType getType() const
Definition Expr.h:144
Represents a member of a struct/union/class.
Definition Decl.h:3160
A (possibly-)qualified type.
Definition TypeBase.h:937
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
Definition TypeBase.h:8362
bool isRestrictQualified() const
Determine whether this type is restrict-qualified.
Definition TypeBase.h:8356
QualType getCanonicalType() const
Definition TypeBase.h:8330
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
Definition TypeBase.h:8372
SemaBase(Sema &S)
Definition SemaBase.cpp:7
ASTContext & getASTContext() const
Definition SemaBase.cpp:9
Sema & SemaRef
Definition SemaBase.h:40
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Definition SemaBase.cpp:61
bool CheckPPCBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition SemaPPC.cpp:97
void checkAIXMemberAlignment(SourceLocation Loc, const Expr *Arg)
Definition SemaPPC.cpp:30
SemaPPC(Sema &S)
Definition SemaPPC.cpp:28
bool BuiltinPPCMMACall(CallExpr *TheCall, unsigned BuiltinID, const char *TypeDesc)
BuiltinPPCMMACall - Check the call to a PPC MMA builtin for validity.
Definition SemaPPC.cpp:352
bool BuiltinVSX(CallExpr *TheCall)
Definition SemaPPC.cpp:418
bool CheckPPCMMAType(QualType Type, SourceLocation TypeLoc)
Definition SemaPPC.cpp:277
Sema - This implements semantic analysis and AST building for C.
Definition Sema.h:854
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEndLoc() const LLVM_READONLY
Definition Stmt.cpp:362
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition Stmt.cpp:338
SourceLocation getBeginLoc() const LLVM_READONLY
Definition Stmt.cpp:350
Exposes information about the current target.
Definition TargetInfo.h:226
unsigned getTypeWidth(IntType T) const
Return the width (in bits) of the specified integer type enum.
IntType getIntPtrType() const
Definition TargetInfo.h:412
const llvm::fltSemantics & getLongDoubleFormat() const
Definition TargetInfo.h:807
Base wrapper for a particular "section" of type source info.
Definition TypeLoc.h:59
The base class of the type hierarchy.
Definition TypeBase.h:1833
bool isArrayType() const
Definition TypeBase.h:8614
bool isPointerType() const
Definition TypeBase.h:8515
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition TypeBase.h:2782
bool isVectorType() const
Definition TypeBase.h:8654
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)
Definition SemaPPC.cpp:56
@ Result
The result type of a method or function.
Definition TypeBase.h:905
llvm::Expected< QualType > ExpectedType
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:299
@ AltiVecVector
is AltiVec vector
Definition TypeBase.h:4139