Skip to content

Commit 72c40d7

Browse files
committed
[SPIR-V] Change long definition to deal with LLP64 vs LP64
Signed-off-by: Victor Lomuller <[email protected]>
1 parent 377b2e3 commit 72c40d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/Sema/SPIRVBuiltins.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,16 @@ class ConstOCLSPVBuiltin<string _Name, list<Type> _Signature> :
286286

287287
// OpenCL v1.0/1.2/2.0 s6.1.1: Built-in Scalar Data Types.
288288
def Bool : IntType<"bool", QualType<"BoolTy">, 1>;
289-
def TrueChar : IntType<"char", QualType<"CharTy", 0, 1>, 8>;
289+
def TrueChar : IntType<"char", QualType<"CharTy", 0, 1>, 8>;
290290
def Char : IntType<"schar", QualType<"SignedCharTy", 0, 1>, 8>;
291291
def SChar : IntType<"schar", QualType<"SignedCharTy", 0, 1>, 8>;
292292
def UChar : UIntType<"uchar", QualType<"UnsignedCharTy">, 8>;
293293
def Short : IntType<"short", QualType<"ShortTy", 0, 1>, 16>;
294294
def UShort : UIntType<"ushort", QualType<"UnsignedShortTy">, 16>;
295295
def Int : IntType<"int", QualType<"IntTy", 0, 1>, 32>;
296296
def UInt : UIntType<"uint", QualType<"UnsignedIntTy">, 32>;
297-
def Long : IntType<"long", QualType<"LongTy", 0, 1>, 64>;
298-
def ULong : UIntType<"ulong", QualType<"UnsignedLongTy">, 64>;
297+
def Long : IntType<"long", QualType<"getIntTypeForBitwidth(64, true)", 0, 1>, 64>;
298+
def ULong : UIntType<"ulong", QualType<"getIntTypeForBitwidth(64, false)">, 64>;
299299
def Float : FPType<"float", QualType<"FloatTy">, 32>;
300300
def Double : FPType<"double", QualType<"DoubleTy">, 64>;
301301
def Half : FPType<"half", QualType<"Float16Ty">, 16>;

0 commit comments

Comments
 (0)