@@ -12,13 +12,17 @@ class FPMathTemplate : Template<["float", "double", "long double"],
12
12
[" f" , " " , " l" ]>;
13
13
14
14
class FPMathWithF16Template :
15
- Template<[" float" , " double" , " long double" , " __fp16" , " __float128 " ],
16
- [" f" , " " , " l" , " f16" , " f128 " ]>;
15
+ Template<[" float" , " double" , " long double" , " __fp16" ],
16
+ [" f" , " " , " l" , " f16" ]>;
17
17
18
18
class FPMathWithF16F128Template :
19
19
Template<[" float" , " double" , " long double" , " __fp16" , " __float128" ],
20
20
[" f" , " " , " l" , " f16" , " f128" ]>;
21
21
22
+ class FPMathWithF128Template :
23
+ Template<[" float" , " double" , " long double" , " __float128" ],
24
+ [" f" , " " , " l" , " f128" ]>;
25
+
22
26
class F16F128MathTemplate : Template<[" __fp16" , " __float128" ],
23
27
[" f16" , " f128" ]>;
24
28
@@ -253,18 +257,30 @@ def FrexpF16F128 : F16F128MathTemplate, Builtin {
253
257
let Prototype = " T(T, int*)" ;
254
258
}
255
259
256
- def HugeVal : Builtin, FPMathWithF16F128Template {
260
+ def HugeVal : Builtin, FPMathWithF128Template {
257
261
let Spellings = [" __builtin_huge_val" ];
258
262
let Attributes = [NoThrow, Const, Constexpr];
259
263
let Prototype = " T()" ;
260
264
}
261
265
262
- def Inf : Builtin, FPMathWithF16F128Template {
266
+ def HugeValF16 : Builtin {
267
+ let Spellings = [" __builtin_huge_valf16" ];
268
+ let Attributes = [NoThrow, Const, Constexpr];
269
+ let Prototype = " _Float16()" ;
270
+ }
271
+
272
+ def Inf : Builtin, FPMathWithF128Template {
263
273
let Spellings = [" __builtin_inf" ];
264
274
let Attributes = [NoThrow, Const, Constexpr];
265
275
let Prototype = " T()" ;
266
276
}
267
277
278
+ def InfF16 : Builtin {
279
+ let Spellings = [" __builtin_inff16" ];
280
+ let Attributes = [NoThrow, Const, Constexpr];
281
+ let Prototype = " _Float16()" ;
282
+ }
283
+
268
284
def LdexpF16F128 : F16F128MathTemplate, Builtin {
269
285
let Spellings = [" __builtin_ldexp" ];
270
286
let Attributes = [FunctionWithBuiltinPrefix, NoThrow, ConstIgnoringErrnoAndExceptions];
@@ -1538,7 +1554,7 @@ def SyncBoolCompareAndSwap : Builtin {
1538
1554
def SyncBoolCompareAndSwapN : Builtin, SyncBuiltinsTemplate {
1539
1555
let Spellings = [" __sync_bool_compare_and_swap_" ];
1540
1556
let Attributes = [CustomTypeChecking, NoThrow];
1541
- let Prototype = " T (T volatile*, T, ...)" ;
1557
+ let Prototype = " bool (T volatile*, T , T, ...)" ;
1542
1558
}
1543
1559
1544
1560
def SyncValCompareAndSwap : Builtin {
@@ -1550,7 +1566,7 @@ def SyncValCompareAndSwap : Builtin {
1550
1566
def SynLockValCompareAndSwapN : Builtin, SyncBuiltinsTemplate {
1551
1567
let Spellings = [" __sync_val_compare_and_swap_" ];
1552
1568
let Attributes = [CustomTypeChecking, NoThrow];
1553
- let Prototype = " T(T volatile*, T, ...)" ;
1569
+ let Prototype = " T(T volatile*, T, T, ...)" ;
1554
1570
}
1555
1571
1556
1572
def SyncLockTestAndSet : Builtin {
@@ -1565,16 +1581,16 @@ def SynLockLockTestAndSetN : Builtin, SyncBuiltinsTemplate {
1565
1581
let Prototype = " T(T volatile*, T, ...)" ;
1566
1582
}
1567
1583
1568
- def SyncLockReleaseN : Builtin {
1584
+ def SyncLockRelease : Builtin {
1569
1585
let Spellings = [" __sync_lock_release" ];
1570
1586
let Attributes = [CustomTypeChecking];
1571
1587
let Prototype = " void(...)" ;
1572
1588
}
1573
1589
1574
- def SynLockReleaseN : Builtin, SyncBuiltinsTemplate {
1590
+ def SyncLockReleaseN : Builtin, SyncBuiltinsTemplate {
1575
1591
let Spellings = [" __sync_lock_release_" ];
1576
1592
let Attributes = [CustomTypeChecking, NoThrow];
1577
- let Prototype = " T (T volatile*, T , ...)" ;
1593
+ let Prototype = " void (T volatile*, ...)" ;
1578
1594
}
1579
1595
1580
1596
def SyncSwap : Builtin {
@@ -2557,6 +2573,13 @@ def Abort : LibBuiltin<"stdlib.h"> {
2557
2573
let AddBuiltinPrefixedAlias = 1 ;
2558
2574
}
2559
2575
2576
+ def Abs : IntMathTemplate, LibBuiltin<" stdlib.h" > {
2577
+ let Spellings = [" abs" ];
2578
+ let Attributes = [NoThrow, Const];
2579
+ let Prototype = " T(T)" ;
2580
+ let AddBuiltinPrefixedAlias = 1 ;
2581
+ }
2582
+
2560
2583
def Calloc : LibBuiltin<" stdlib.h" > {
2561
2584
let Spellings = [" calloc" ];
2562
2585
let Prototype = " void*(size_t, size_t)" ;
@@ -3073,38 +3096,38 @@ def MemAlign : GNULibBuiltin<"malloc.h"> {
3073
3096
3074
3097
// POSIX string.h
3075
3098
3076
- def MemcCpy : GNULibBuiltin<" stdlib .h" > {
3099
+ def MemcCpy : GNULibBuiltin<" string .h" > {
3077
3100
let Spellings = [" memccpy" ];
3078
3101
let Prototype = " void*(void*, void const*, int, size_t)" ;
3079
3102
}
3080
3103
3081
- def MempCpy : GNULibBuiltin<" stdlib .h" > {
3104
+ def MempCpy : GNULibBuiltin<" string .h" > {
3082
3105
let Spellings = [" mempcpy" ];
3083
3106
let Prototype = " void*(void*, void const*, size_t)" ;
3084
3107
}
3085
3108
3086
- def StpCpy : GNULibBuiltin<" stdlib .h" > {
3109
+ def StpCpy : GNULibBuiltin<" string .h" > {
3087
3110
let Spellings = [" stpcpy" ];
3088
3111
let Attributes = [NoThrow];
3089
3112
let Prototype = " char*(char*, char const*)" ;
3090
3113
let AddBuiltinPrefixedAlias = 1 ;
3091
3114
}
3092
3115
3093
- def StpnCpy : GNULibBuiltin<" stdlib .h" > {
3116
+ def StpnCpy : GNULibBuiltin<" string .h" > {
3094
3117
let Spellings = [" stpncpy" ];
3095
3118
let Attributes = [NoThrow];
3096
3119
let Prototype = " char*(char*, char const*, size_t)" ;
3097
3120
let AddBuiltinPrefixedAlias = 1 ;
3098
3121
}
3099
3122
3100
- def StrDup : GNULibBuiltin<" stdlib .h" > {
3123
+ def StrDup : GNULibBuiltin<" string .h" > {
3101
3124
let Spellings = [" strdup" ];
3102
3125
let Attributes = [NoThrow];
3103
3126
let Prototype = " char*(char const*)" ;
3104
3127
let AddBuiltinPrefixedAlias = 1 ;
3105
3128
}
3106
3129
3107
- def StrnDup : GNULibBuiltin<" stdlib .h" > {
3130
+ def StrnDup : GNULibBuiltin<" string .h" > {
3108
3131
let Spellings = [" strndup" ];
3109
3132
let Attributes = [NoThrow];
3110
3133
let Prototype = " char*(char const*, size_t)" ;
@@ -3274,22 +3297,22 @@ def ObjcEnumerationMutation : ObjCLibBuiltin<"objc/runtime.h"> {
3274
3297
let Prototype = " void(id)" ;
3275
3298
}
3276
3299
3277
- def ObjcReadWeak : ObjCLibBuiltin<" objc/message .h" > {
3300
+ def ObjcReadWeak : ObjCLibBuiltin<" objc/objc-auto .h" > {
3278
3301
let Spellings = [" objc_read_weak" ];
3279
3302
let Prototype = " id(id*)" ;
3280
3303
}
3281
3304
3282
- def ObjcAssignWeak : ObjCLibBuiltin<" objc/message .h" > {
3305
+ def ObjcAssignWeak : ObjCLibBuiltin<" objc/objc-auto .h" > {
3283
3306
let Spellings = [" objc_assign_weak" ];
3284
3307
let Prototype = " id(id, id*)" ;
3285
3308
}
3286
3309
3287
- def ObjcAssignIvar : ObjCLibBuiltin<" objc/message .h" > {
3310
+ def ObjcAssignIvar : ObjCLibBuiltin<" objc/objc-auto .h" > {
3288
3311
let Spellings = [" objc_assign_ivar" ];
3289
3312
let Prototype = " id(id, id, ptrdiff_t)" ;
3290
3313
}
3291
3314
3292
- def ObjcAssignGlobal : ObjCLibBuiltin<" objc/message .h" > {
3315
+ def ObjcAssignGlobal : ObjCLibBuiltin<" objc/objc-auto .h" > {
3293
3316
let Spellings = [" objc_assign_global" ];
3294
3317
let Prototype = " id(id, id*)" ;
3295
3318
}
@@ -3359,13 +3382,6 @@ def Atan2 : FPMathTemplate, LibBuiltin<"math.h"> {
3359
3382
let AddBuiltinPrefixedAlias = 1 ;
3360
3383
}
3361
3384
3362
- def Abs : IntMathTemplate, LibBuiltin<" math.h" > {
3363
- let Spellings = [" abs" ];
3364
- let Attributes = [NoThrow, Const];
3365
- let Prototype = " T(T)" ;
3366
- let AddBuiltinPrefixedAlias = 1 ;
3367
- }
3368
-
3369
3385
def Copysign : FPMathTemplate, LibBuiltin<" math.h" > {
3370
3386
let Spellings = [" copysign" ];
3371
3387
let Attributes = [NoThrow, Const];
@@ -4024,7 +4040,7 @@ def Move : CxxLibBuiltin<"utility"> {
4024
4040
let Namespace = " std" ;
4025
4041
}
4026
4042
4027
- def MoveIfNsoexcept : CxxLibBuiltin<" memory " > {
4043
+ def MoveIfNsoexcept : CxxLibBuiltin<" utility " > {
4028
4044
let Spellings = [" move_if_noexcept" ];
4029
4045
let Attributes = [NoThrow, Const, IgnoreSignature, RequireDeclaration,
4030
4046
Constexpr];
0 commit comments