Differences From Artifact [9c702fcecb]:
- File
src/OFMethodSignature.m
— part of check-in
[5c0117205d]
at
2022-11-06 21:19:39
on branch trunk
— Work around an ICE in Clang 3.7.0 on Windows/x86
Apparently the optimizer crashes on some recursive functions. (user: js, size: 12883) [annotate] [blame] [check-ins using] [more...]
To Artifact [c6cbdf3c9e]:
- File src/OFMethodSignature.m — part of check-in [26ddd2e4e4] at 2024-01-02 17:17:25 on branch trunk — Update copyright (user: js, size: 13184) [annotate] [blame] [check-ins using] [more...]
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | - + - + - + | /* |
| ︙ | |||
61 62 63 64 65 66 67 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | - + |
alignmentOfStruct(const char **type, size_t *length)
{
size_t alignment = 0;
#if defined(OF_POWERPC) && defined(OF_MACOS)
bool first = true;
#endif
|
| ︙ | |||
107 108 109 110 111 112 113 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + |
}
static size_t
alignmentOfUnion(const char **type, size_t *length)
{
size_t alignment = 0;
|
| ︙ | |||
142 143 144 145 146 147 148 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | + - + | (*type)++; (*length)--; return alignment; } static size_t #if defined(__clang__) && __has_attribute(__optnone__) && \ |
| ︙ | |||
288 289 290 291 292 293 294 | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | - + |
static size_t
sizeOfArray(const char **type, size_t *length)
{
size_t count = 0;
size_t size;
|
| ︙ | |||
328 329 330 331 332 333 334 | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | - + | const char *typeCopy = *type; size_t lengthCopy = *length; size_t alignment = alignmentOfStruct(&typeCopy, &lengthCopy); #if defined(OF_POWERPC) && defined(OF_MACOS) bool first = true; #endif |
| ︙ | |||
401 402 403 404 405 406 407 | 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | - + |
}
static size_t
sizeOfUnion(const char **type, size_t *length)
{
size_t size = 0;
|
| ︙ | |||
436 437 438 439 440 441 442 443 444 445 446 447 448 449 | 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | + + + + + |
(*type)++;
(*length)--;
return size;
}
static size_t
#if defined(__clang__) && __has_attribute(__optnone__) && \
__clang_major__ == 3 && __clang_minor__ <= 7
/* Work around an ICE in Clang 3.7.0 on Windows/x86 */
__attribute__((__optnone__))
#endif
sizeOfEncoding(const char **type, size_t *length)
{
size_t size;
if (*length == 0)
@throw [OFInvalidFormatException exception];
|
| ︙ | |||
581 582 583 584 585 586 587 588 589 590 591 592 593 594 | 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | + + + + + |
}
@implementation OFMethodSignature
+ (instancetype)signatureWithObjCTypes: (const char*)types
{
return [[[self alloc] initWithObjCTypes: types] autorelease];
}
- (instancetype)init
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithObjCTypes: (const char *)types
{
self = [super init];
@try {
size_t length;
|
| ︙ |