File: ivar-layout-64.m

package info (click to toggle)
llvm-toolchain-3.7 1%3A3.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 345,556 kB
  • ctags: 362,199
  • sloc: cpp: 2,156,381; ansic: 458,339; objc: 91,547; python: 89,988; asm: 86,305; sh: 21,479; makefile: 6,853; perl: 5,601; ml: 5,458; pascal: 3,933; lisp: 2,429; xml: 686; cs: 239; php: 202; csh: 117
file content (114 lines) | stat: -rw-r--r-- 2,561 bytes parent folder | download
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck %s

/*

Here is a handy command for looking at llvm-gcc's output:
llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o - ivar-layout-64.m | \
  grep 'OBJC_CLASS_NAME.* =.*global' | \
  sed -e 's#, section.*# ...#' | \
  sed -e 's#_[0-9]*"#_NNN#' | \
  sort

*/

@interface B @end

@interface A {
  struct s0 {
    int f0;
    int f1;
  } f0;
  id f1;
__weak B *f2;
  int f3 : 5;
  struct s1 {
    int *f0;
    int *f1;
  } f4[2][1];
}
@end

@interface C : A
@property int p3;
@end

// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"C\00"
// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"\11p\00"
// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"!`\00"


@implementation C
@synthesize p3 = _p3;
@end

@interface A()
@property int p0;
@property (assign) __strong id p1;
@property (assign) __weak id p2;
@end

// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"A\00"
// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"\11q\10\00"
// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"!q\00"

@implementation A
@synthesize p0 = _p0;
@synthesize p1 = _p1;
@synthesize p2 = _p2;
@end

@interface D : A
@property int p3;
@end

// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"D\00"
// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"\11p\00"
// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"!`\00"

@implementation D
@synthesize p3 = _p3;
@end

typedef unsigned short UInt16;


typedef signed char BOOL;
typedef unsigned int FSCatalogInfoBitmap;

@interface NSFileLocationComponent {
    @private

    id _specifierOrStandardizedPath;
    BOOL _carbonCatalogInfoAndNameAreValid;
    FSCatalogInfoBitmap _carbonCatalogInfoMask;
    id _name;
    id _containerComponent;
    id _presentableName;
    id _iconAsAttributedString;
}
@end

// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"NSFileLocationComponent\00"
// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"\01\14\00"

@implementation NSFileLocationComponent @end

@interface NSObject {
  id isa;
}
@end

@interface Foo : NSObject {
    id ivar;

    unsigned long bitfield  :31;
    unsigned long bitfield2 :1;
    unsigned long bitfield3 :32;
}
@end

// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"Foo\00"
// CHECK: @OBJC_CLASS_NAME_{{.*}} = private global {{.*}} c"\02\10\00"

@implementation Foo @end