@@ -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];
@@ -1544,7 +1560,7 @@ def SyncBoolCompareAndSwap : Builtin {
1544
1560
def SyncBoolCompareAndSwapN : Builtin, SyncBuiltinsTemplate {
1545
1561
let Spellings = [" __sync_bool_compare_and_swap_" ];
1546
1562
let Attributes = [CustomTypeChecking, NoThrow];
1547
- let Prototype = " T (T volatile*, T, ...)" ;
1563
+ let Prototype = " bool (T volatile*, T , T, ...)" ;
1548
1564
}
1549
1565
1550
1566
def SyncValCompareAndSwap : Builtin {
@@ -1556,7 +1572,7 @@ def SyncValCompareAndSwap : Builtin {
1556
1572
def SynLockValCompareAndSwapN : Builtin, SyncBuiltinsTemplate {
1557
1573
let Spellings = [" __sync_val_compare_and_swap_" ];
1558
1574
let Attributes = [CustomTypeChecking, NoThrow];
1559
- let Prototype = " T(T volatile*, T, ...)" ;
1575
+ let Prototype = " T(T volatile*, T, T, ...)" ;
1560
1576
}
1561
1577
1562
1578
def SyncLockTestAndSet : Builtin {
@@ -1571,16 +1587,16 @@ def SynLockLockTestAndSetN : Builtin, SyncBuiltinsTemplate {
1571
1587
let Prototype = " T(T volatile*, T, ...)" ;
1572
1588
}
1573
1589
1574
- def SyncLockReleaseN : Builtin {
1590
+ def SyncLockRelease : Builtin {
1575
1591
let Spellings = [" __sync_lock_release" ];
1576
1592
let Attributes = [CustomTypeChecking];
1577
1593
let Prototype = " void(...)" ;
1578
1594
}
1579
1595
1580
- def SynLockReleaseN : Builtin, SyncBuiltinsTemplate {
1596
+ def SyncLockReleaseN : Builtin, SyncBuiltinsTemplate {
1581
1597
let Spellings = [" __sync_lock_release_" ];
1582
1598
let Attributes = [CustomTypeChecking, NoThrow];
1583
- let Prototype = " T (T volatile*, T , ...)" ;
1599
+ let Prototype = " void (T volatile*, ...)" ;
1584
1600
}
1585
1601
1586
1602
def SyncSwap : Builtin {
@@ -2563,6 +2579,13 @@ def Abort : LibBuiltin<"stdlib.h"> {
2563
2579
let AddBuiltinPrefixedAlias = 1 ;
2564
2580
}
2565
2581
2582
+ def Abs : IntMathTemplate, LibBuiltin<" stdlib.h" > {
2583
+ let Spellings = [" abs" ];
2584
+ let Attributes = [NoThrow, Const];
2585
+ let Prototype = " T(T)" ;
2586
+ let AddBuiltinPrefixedAlias = 1 ;
2587
+ }
2588
+
2566
2589
def Calloc : LibBuiltin<" stdlib.h" > {
2567
2590
let Spellings = [" calloc" ];
2568
2591
let Prototype = " void*(size_t, size_t)" ;
@@ -3079,38 +3102,38 @@ def MemAlign : GNULibBuiltin<"malloc.h"> {
3079
3102
3080
3103
// POSIX string.h
3081
3104
3082
- def MemcCpy : GNULibBuiltin<" stdlib .h" > {
3105
+ def MemcCpy : GNULibBuiltin<" string .h" > {
3083
3106
let Spellings = [" memccpy" ];
3084
3107
let Prototype = " void*(void*, void const*, int, size_t)" ;
3085
3108
}
3086
3109
3087
- def MempCpy : GNULibBuiltin<" stdlib .h" > {
3110
+ def MempCpy : GNULibBuiltin<" string .h" > {
3088
3111
let Spellings = [" mempcpy" ];
3089
3112
let Prototype = " void*(void*, void const*, size_t)" ;
3090
3113
}
3091
3114
3092
- def StpCpy : GNULibBuiltin<" stdlib .h" > {
3115
+ def StpCpy : GNULibBuiltin<" string .h" > {
3093
3116
let Spellings = [" stpcpy" ];
3094
3117
let Attributes = [NoThrow];
3095
3118
let Prototype = " char*(char*, char const*)" ;
3096
3119
let AddBuiltinPrefixedAlias = 1 ;
3097
3120
}
3098
3121
3099
- def StpnCpy : GNULibBuiltin<" stdlib .h" > {
3122
+ def StpnCpy : GNULibBuiltin<" string .h" > {
3100
3123
let Spellings = [" stpncpy" ];
3101
3124
let Attributes = [NoThrow];
3102
3125
let Prototype = " char*(char*, char const*, size_t)" ;
3103
3126
let AddBuiltinPrefixedAlias = 1 ;
3104
3127
}
3105
3128
3106
- def StrDup : GNULibBuiltin<" stdlib .h" > {
3129
+ def StrDup : GNULibBuiltin<" string .h" > {
3107
3130
let Spellings = [" strdup" ];
3108
3131
let Attributes = [NoThrow];
3109
3132
let Prototype = " char*(char const*)" ;
3110
3133
let AddBuiltinPrefixedAlias = 1 ;
3111
3134
}
3112
3135
3113
- def StrnDup : GNULibBuiltin<" stdlib .h" > {
3136
+ def StrnDup : GNULibBuiltin<" string .h" > {
3114
3137
let Spellings = [" strndup" ];
3115
3138
let Attributes = [NoThrow];
3116
3139
let Prototype = " char*(char const*, size_t)" ;
@@ -3280,22 +3303,22 @@ def ObjcEnumerationMutation : ObjCLibBuiltin<"objc/runtime.h"> {
3280
3303
let Prototype = " void(id)" ;
3281
3304
}
3282
3305
3283
- def ObjcReadWeak : ObjCLibBuiltin<" objc/message .h" > {
3306
+ def ObjcReadWeak : ObjCLibBuiltin<" objc/objc-auto .h" > {
3284
3307
let Spellings = [" objc_read_weak" ];
3285
3308
let Prototype = " id(id*)" ;
3286
3309
}
3287
3310
3288
- def ObjcAssignWeak : ObjCLibBuiltin<" objc/message .h" > {
3311
+ def ObjcAssignWeak : ObjCLibBuiltin<" objc/objc-auto .h" > {
3289
3312
let Spellings = [" objc_assign_weak" ];
3290
3313
let Prototype = " id(id, id*)" ;
3291
3314
}
3292
3315
3293
- def ObjcAssignIvar : ObjCLibBuiltin<" objc/message .h" > {
3316
+ def ObjcAssignIvar : ObjCLibBuiltin<" objc/objc-auto .h" > {
3294
3317
let Spellings = [" objc_assign_ivar" ];
3295
3318
let Prototype = " id(id, id, ptrdiff_t)" ;
3296
3319
}
3297
3320
3298
- def ObjcAssignGlobal : ObjCLibBuiltin<" objc/message .h" > {
3321
+ def ObjcAssignGlobal : ObjCLibBuiltin<" objc/objc-auto .h" > {
3299
3322
let Spellings = [" objc_assign_global" ];
3300
3323
let Prototype = " id(id, id*)" ;
3301
3324
}
@@ -3365,13 +3388,6 @@ def Atan2 : FPMathTemplate, LibBuiltin<"math.h"> {
3365
3388
let AddBuiltinPrefixedAlias = 1 ;
3366
3389
}
3367
3390
3368
- def Abs : IntMathTemplate, LibBuiltin<" math.h" > {
3369
- let Spellings = [" abs" ];
3370
- let Attributes = [NoThrow, Const];
3371
- let Prototype = " T(T)" ;
3372
- let AddBuiltinPrefixedAlias = 1 ;
3373
- }
3374
-
3375
3391
def Copysign : FPMathTemplate, LibBuiltin<" math.h" > {
3376
3392
let Spellings = [" copysign" ];
3377
3393
let Attributes = [NoThrow, Const];
@@ -3990,8 +4006,16 @@ def BlockObjectDispose : LibBuiltin<"blocks.h"> {
3990
4006
}
3991
4007
// FIXME: Also declare NSConcreteGlobalBlock and NSConcreteStackBlock.
3992
4008
4009
+ def __Addressof : LangBuiltin<" CXX_LANG" > {
4010
+ let Spellings = [" __addressof" ];
4011
+ let Attributes = [FunctionWithoutBuiltinPrefix, NoThrow, Const,
4012
+ IgnoreSignature, Constexpr];
4013
+ let Prototype = " void*(void&)" ;
4014
+ let Namespace = " std" ;
4015
+ }
4016
+
3993
4017
def Addressof : CxxLibBuiltin<" memory" > {
3994
- let Spellings = [" addressof" , " __addressof " ];
4018
+ let Spellings = [" addressof" ];
3995
4019
let Attributes = [NoThrow, Const, IgnoreSignature, RequireDeclaration,
3996
4020
Constexpr];
3997
4021
let Prototype = " void*(void&)" ;
@@ -4030,7 +4054,7 @@ def Move : CxxLibBuiltin<"utility"> {
4030
4054
let Namespace = " std" ;
4031
4055
}
4032
4056
4033
- def MoveIfNsoexcept : CxxLibBuiltin<" memory " > {
4057
+ def MoveIfNsoexcept : CxxLibBuiltin<" utility " > {
4034
4058
let Spellings = [" move_if_noexcept" ];
4035
4059
let Attributes = [NoThrow, Const, IgnoreSignature, RequireDeclaration,
4036
4060
Constexpr];
0 commit comments