clang: lib/Sema/SemaSPIRV.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
14
16
18
21 switch (BuiltinID) {
22 case SPIRV::BI__builtin_spirv_distance: {
24 return true;
25
29 if (VTyA == nullptr) {
31 diag::err_typecheck_convert_incompatible)
32 << ArgTyA
34 << 0 << 0;
35 return true;
36 }
37
41 if (VTyB == nullptr) {
43 diag::err_typecheck_convert_incompatible)
44 << ArgTyB
46 << 0 << 0;
47 return true;
48 }
49
50 QualType RetTy = VTyA->getElementType();
52 break;
53 }
54 case SPIRV::BI__builtin_spirv_length: {
56 return true;
60 if (VTy == nullptr) {
62 diag::err_typecheck_convert_incompatible)
63 << ArgTyA
65 << 0 << 0;
66 return true;
67 }
68 QualType RetTy = VTy->getElementType();
70 break;
71 }
72 }
73 return false;
74}
75}
This file declares semantic analysis for SPIRV constructs.
Enumerates target-specific builtins in their own namespaces within namespace clang.
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
A (possibly-)qualified type.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
bool CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Sema - This implements semantic analysis and AST building for C.
bool checkArgCount(CallExpr *Call, unsigned DesiredArgCount)
Checks that a call expression's argument count is the desired number.
SourceLocation getBeginLoc() const LLVM_READONLY
const T * getAs() const
Member-template getAs'.
Represents a GCC generic vector type.
The JSON file list parser is used to communicate input to InstallAPI.
@ Generic
not a target-specific vector type