@@ -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];
@@ -1550,7 +1566,7 @@ def SyncBoolCompareAndSwap : Builtin {
1550
1566
def SyncBoolCompareAndSwapN : Builtin, SyncBuiltinsTemplate {
1551
1567
let Spellings = [" __sync_bool_compare_and_swap_" ];
1552
1568
let Attributes = [CustomTypeChecking, NoThrow];
1553
- let Prototype = " T (T volatile*, T, ...)" ;
1569
+ let Prototype = " bool (T volatile*, T , T, ...)" ;
1554
1570
}
1555
1571
1556
1572
def SyncValCompareAndSwap : Builtin {
@@ -1562,7 +1578,7 @@ def SyncValCompareAndSwap : Builtin {
1562
1578
def SynLockValCompareAndSwapN : Builtin, SyncBuiltinsTemplate {
1563
1579
let Spellings = [" __sync_val_compare_and_swap_" ];
1564
1580
let Attributes = [CustomTypeChecking, NoThrow];
1565
- let Prototype = " T(T volatile*, T, ...)" ;
1581
+ let Prototype = " T(T volatile*, T, T, ...)" ;
1566
1582
}
1567
1583
1568
1584
def SyncLockTestAndSet : Builtin {
@@ -1577,16 +1593,16 @@ def SynLockLockTestAndSetN : Builtin, SyncBuiltinsTemplate {
1577
1593
let Prototype = " T(T volatile*, T, ...)" ;
1578
1594
}
1579
1595
1580
- def SyncLockReleaseN : Builtin {
1596
+ def SyncLockRelease : Builtin {
1581
1597
let Spellings = [" __sync_lock_release" ];
1582
1598
let Attributes = [CustomTypeChecking];
1583
1599
let Prototype = " void(...)" ;
1584
1600
}
1585
1601
1586
- def SynLockReleaseN : Builtin, SyncBuiltinsTemplate {
1602
+ def SyncLockReleaseN : Builtin, SyncBuiltinsTemplate {
1587
1603
let Spellings = [" __sync_lock_release_" ];
1588
1604
let Attributes = [CustomTypeChecking, NoThrow];
1589
- let Prototype = " T (T volatile*, T , ...)" ;
1605
+ let Prototype = " void (T volatile*, ...)" ;
1590
1606
}
1591
1607
1592
1608
def SyncSwap : Builtin {
@@ -2569,6 +2585,13 @@ def Abort : LibBuiltin<"stdlib.h"> {
2569
2585
let AddBuiltinPrefixedAlias = 1 ;
2570
2586
}
2571
2587
2588
+ def Abs : IntMathTemplate, LibBuiltin<" stdlib.h" > {
2589
+ let Spellings = [" abs" ];
2590
+ let Attributes = [NoThrow, Const];
2591
+ let Prototype = " T(T)" ;
2592
+ let AddBuiltinPrefixedAlias = 1 ;
2593
+ }
2594
+
2572
2595
def Calloc : LibBuiltin<" stdlib.h" > {
2573
2596
let Spellings = [" calloc" ];
2574
2597
let Prototype = " void*(size_t, size_t)" ;
@@ -3085,38 +3108,38 @@ def MemAlign : GNULibBuiltin<"malloc.h"> {
3085
3108
3086
3109
// POSIX string.h
3087
3110
3088
- def MemcCpy : GNULibBuiltin<" stdlib .h" > {
3111
+ def MemcCpy : GNULibBuiltin<" string .h" > {
3089
3112
let Spellings = [" memccpy" ];
3090
3113
let Prototype = " void*(void*, void const*, int, size_t)" ;
3091
3114
}
3092
3115
3093
- def MempCpy : GNULibBuiltin<" stdlib .h" > {
3116
+ def MempCpy : GNULibBuiltin<" string .h" > {
3094
3117
let Spellings = [" mempcpy" ];
3095
3118
let Prototype = " void*(void*, void const*, size_t)" ;
3096
3119
}
3097
3120
3098
- def StpCpy : GNULibBuiltin<" stdlib .h" > {
3121
+ def StpCpy : GNULibBuiltin<" string .h" > {
3099
3122
let Spellings = [" stpcpy" ];
3100
3123
let Attributes = [NoThrow];
3101
3124
let Prototype = " char*(char*, char const*)" ;
3102
3125
let AddBuiltinPrefixedAlias = 1 ;
3103
3126
}
3104
3127
3105
- def StpnCpy : GNULibBuiltin<" stdlib .h" > {
3128
+ def StpnCpy : GNULibBuiltin<" string .h" > {
3106
3129
let Spellings = [" stpncpy" ];
3107
3130
let Attributes = [NoThrow];
3108
3131
let Prototype = " char*(char*, char const*, size_t)" ;
3109
3132
let AddBuiltinPrefixedAlias = 1 ;
3110
3133
}
3111
3134
3112
- def StrDup : GNULibBuiltin<" stdlib .h" > {
3135
+ def StrDup : GNULibBuiltin<" string .h" > {
3113
3136
let Spellings = [" strdup" ];
3114
3137
let Attributes = [NoThrow];
3115
3138
let Prototype = " char*(char const*)" ;
3116
3139
let AddBuiltinPrefixedAlias = 1 ;
3117
3140
}
3118
3141
3119
- def StrnDup : GNULibBuiltin<" stdlib .h" > {
3142
+ def StrnDup : GNULibBuiltin<" string .h" > {
3120
3143
let Spellings = [" strndup" ];
3121
3144
let Attributes = [NoThrow];
3122
3145
let Prototype = " char*(char const*, size_t)" ;
@@ -3286,22 +3309,22 @@ def ObjcEnumerationMutation : ObjCLibBuiltin<"objc/runtime.h"> {
3286
3309
let Prototype = " void(id)" ;
3287
3310
}
3288
3311
3289
- def ObjcReadWeak : ObjCLibBuiltin<" objc/message .h" > {
3312
+ def ObjcReadWeak : ObjCLibBuiltin<" objc/objc-auto .h" > {
3290
3313
let Spellings = [" objc_read_weak" ];
3291
3314
let Prototype = " id(id*)" ;
3292
3315
}
3293
3316
3294
- def ObjcAssignWeak : ObjCLibBuiltin<" objc/message .h" > {
3317
+ def ObjcAssignWeak : ObjCLibBuiltin<" objc/objc-auto .h" > {
3295
3318
let Spellings = [" objc_assign_weak" ];
3296
3319
let Prototype = " id(id, id*)" ;
3297
3320
}
3298
3321
3299
- def ObjcAssignIvar : ObjCLibBuiltin<" objc/message .h" > {
3322
+ def ObjcAssignIvar : ObjCLibBuiltin<" objc/objc-auto .h" > {
3300
3323
let Spellings = [" objc_assign_ivar" ];
3301
3324
let Prototype = " id(id, id, ptrdiff_t)" ;
3302
3325
}
3303
3326
3304
- def ObjcAssignGlobal : ObjCLibBuiltin<" objc/message .h" > {
3327
+ def ObjcAssignGlobal : ObjCLibBuiltin<" objc/objc-auto .h" > {
3305
3328
let Spellings = [" objc_assign_global" ];
3306
3329
let Prototype = " id(id, id*)" ;
3307
3330
}
@@ -3371,13 +3394,6 @@ def Atan2 : FPMathTemplate, LibBuiltin<"math.h"> {
3371
3394
let AddBuiltinPrefixedAlias = 1 ;
3372
3395
}
3373
3396
3374
- def Abs : IntMathTemplate, LibBuiltin<" math.h" > {
3375
- let Spellings = [" abs" ];
3376
- let Attributes = [NoThrow, Const];
3377
- let Prototype = " T(T)" ;
3378
- let AddBuiltinPrefixedAlias = 1 ;
3379
- }
3380
-
3381
3397
def Copysign : FPMathTemplate, LibBuiltin<" math.h" > {
3382
3398
let Spellings = [" copysign" ];
3383
3399
let Attributes = [NoThrow, Const];
@@ -3996,8 +4012,16 @@ def BlockObjectDispose : LibBuiltin<"blocks.h"> {
3996
4012
}
3997
4013
// FIXME: Also declare NSConcreteGlobalBlock and NSConcreteStackBlock.
3998
4014
4015
+ def __Addressof : LangBuiltin<" CXX_LANG" > {
4016
+ let Spellings = [" __addressof" ];
4017
+ let Attributes = [FunctionWithoutBuiltinPrefix, NoThrow, Const,
4018
+ IgnoreSignature, Constexpr];
4019
+ let Prototype = " void*(void&)" ;
4020
+ let Namespace = " std" ;
4021
+ }
4022
+
3999
4023
def Addressof : CxxLibBuiltin<" memory" > {
4000
- let Spellings = [" addressof" , " __addressof " ];
4024
+ let Spellings = [" addressof" ];
4001
4025
let Attributes = [NoThrow, Const, IgnoreSignature, RequireDeclaration,
4002
4026
Constexpr];
4003
4027
let Prototype = " void*(void&)" ;
@@ -4036,7 +4060,7 @@ def Move : CxxLibBuiltin<"utility"> {
4036
4060
let Namespace = " std" ;
4037
4061
}
4038
4062
4039
- def MoveIfNsoexcept : CxxLibBuiltin<" memory " > {
4063
+ def MoveIfNsoexcept : CxxLibBuiltin<" utility " > {
4040
4064
let Spellings = [" move_if_noexcept" ];
4041
4065
let Attributes = [NoThrow, Const, IgnoreSignature, RequireDeclaration,
4042
4066
Constexpr];
0 commit comments