annotate dmd/Declaration.d @ 72:2e2a5c3f943a

reduced warnings by adding override to the methods think this also normalizes different line endings used all over the place
author Trass3r
date Sat, 28 Aug 2010 16:19:48 +0200
parents ee3a9f34dc48
children 43073c7c7769
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.Declaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
3 import dmd.Dsymbol;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.Type;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.PROT;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 import dmd.LINK;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 import dmd.Identifier;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 import dmd.Scope;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 import dmd.Loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 import dmd.STC;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 import dmd.FuncDeclaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 import dmd.VarDeclaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 import dmd.OutBuffer;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 import std.stdio : writef;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 import core.stdc.ctype;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 import core.stdc.stdio : sprintf;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 string mangle(Declaration sthis)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 scope OutBuffer buf = new OutBuffer();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 string id;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25 Dsymbol s = sthis;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27 //printf(".mangle(%s)\n", sthis.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 do
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30 //printf("mangle: s = %p, '%s', parent = %p\n", s, s.toChars(), s.parent);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 if (s.ident)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 FuncDeclaration fd = s.isFuncDeclaration();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
34 if (s !is sthis && fd)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
35 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36 id = mangle(fd);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
37 buf.prependstring(id);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38 goto L1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 id = s.ident.toChars();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
43 int len = id.length;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
44 char tmp[len.sizeof * 3 + 1];
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
45 buf.prependstring(id);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
46 len = sprintf(tmp.ptr, "%d".ptr, len);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47 buf.prependstring(tmp[0..len]);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
50 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
51 buf.prependstring("0");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
52 s = s.parent;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
53 } while (s);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55 // buf.prependstring("_D");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56 L1:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57 //printf("deco = '%s'\n", sthis.type.deco ? sthis.type.deco : "null");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
58 //printf("sthis.type = %s\n", sthis.type.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
59 FuncDeclaration fd = sthis.isFuncDeclaration();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
60 if (fd && (fd.needThis() || fd.isNested()))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
61 buf.writeByte(Type.needThisPrefix());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
62 if (sthis.type.deco)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
63 buf.writestring(sthis.type.deco);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
64 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
65 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66 debug {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
67 if (!fd.inferRetType)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68 writef("%s\n", fd.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
69 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
70 assert(fd.inferRetType);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
71 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73 id = buf.extractString();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
74 return id;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
75 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
76
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
77 class Declaration : Dsymbol
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
78 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
79 Type type;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
80 Type originalType; // before semantic analysis
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
81 STC storage_class = STC.STCundefined;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
82 PROT protection = PROT.PROTundefined;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
83 LINK linkage = LINK.LINKdefault;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
84 int inuse; // used to detect cycles
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
85
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
86 this(Identifier id)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
87 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
88 super(id);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
89 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
90
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
91 override void semantic(Scope sc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
92 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
93 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
94
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
95 override string kind()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
96 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
97 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
98 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
99
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
100 override uint size(Loc loc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
101 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
102 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
103 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
104
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
105 /*************************************
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
106 * Check to see if declaration can be modified in this context (sc).
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
107 * Issue error if not.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
108 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
109 void checkModify(Loc loc, Scope sc, Type t)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
110 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
111 if (sc.incontract && isParameter())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
112 error(loc, "cannot modify parameter '%s' in contract", toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
113
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
114 if (isCtorinit())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
115 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
116 // It's only modifiable if inside the right constructor
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
117 Dsymbol s = sc.func;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
118 while (true)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
119 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
120 FuncDeclaration fd = null;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
121 if (s)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
122 fd = s.isFuncDeclaration();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
123 if (fd && ((fd.isCtorDeclaration() && storage_class & STC.STCfield) ||
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
124 (fd.isStaticCtorDeclaration() && !(storage_class & STC.STCfield))) &&
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
125 fd.toParent() == toParent()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
126 )
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
127 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
128 VarDeclaration v = isVarDeclaration();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
129 assert(v);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
130 v.ctorinit = 1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
131 //printf("setting ctorinit\n");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
132 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
133 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
134 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
135 if (s)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
136 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
137 s = s.toParent2();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
138 continue;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
139 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
140 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
141 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
142 string p = isStatic() ? "static " : "";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
143 error(loc, "can only initialize %sconst %s inside %sconstructor", p, toChars(), p);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
144 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
145 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
146 break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
147 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
148 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
149 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
150 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
151 VarDeclaration v = isVarDeclaration();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
152 if (v && v.canassign == 0)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
153 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
154 string p = null;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
155 if (isConst())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
156 p = "const";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
157 else if (isInvariant())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
158 p = "immutable";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
159 else if (storage_class & STC.STCmanifest)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
160 p = "enum";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
161 else if (!t.isAssignable())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
162 p = "struct with immutable members";
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
163 if (p)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
164 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
165 error(loc, "cannot modify %s", p);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
166 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
167 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
168 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
169 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
170
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
171 override void emitComment(Scope sc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
172 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
173 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
174 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
175
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
176 override void toDocBuffer(OutBuffer buf)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
177 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
178 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
179 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
180
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
181 override string mangle()
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
182 /+out (result)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
183 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
184 try
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
185 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
186 int len = result.length;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
187
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
188 assert(len > 0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
189 //printf("mangle: '%s' => '%s'\n", toChars(), result);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
190 for (int i = 0; i < len; i++)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
191 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
192 assert(result[i] == '_' || result[i] == '@' || isalnum(result[i]) || result[i] & 0x80);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
193 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
194 } catch {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
195 writef("Incorrect mangle: '%s'\n", result);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
196 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
197 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
198 }
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
199 body+/
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
200 {
22
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 16
diff changeset
201 version(Bug3602) { writef( "Bug3602: Uncomment outblock when fixed\n" ); }
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
202 //writef("Declaration.mangle(this = %p, '%s', parent = '%s', linkage = %d)\n", this, toChars(), parent ? parent.toChars() : "null", linkage);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
203 if (!parent || parent.isModule() || linkage == LINK.LINKcpp) // if at global scope
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
204 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
205 // If it's not a D declaration, no mangling
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
206 switch (linkage)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
207 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
208 case LINK.LINKd:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
209 break;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
210
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
211 case LINK.LINKc:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
212 case LINK.LINKwindows:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
213 case LINK.LINKpascal:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
214 return ident.toChars();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
215
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
216 case LINK.LINKcpp:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
217 version (CPP_MANGLE) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
218 return cpp_mangle(this);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
219 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
220 // Windows C++ mangling is done by C++ back end
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
221 return ident.toChars();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
222 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
223
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
224 case LINK.LINKdefault:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
225 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
226 error("forward declaration");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
227 return ident.toChars();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
228
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
229 default:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
230 writef("'%s', linkage = %d\n", toChars(), linkage);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
231 assert(0);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
232 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
233 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
234
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
235 string p = .mangle(this);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
236 scope OutBuffer buf = new OutBuffer();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
237 buf.writestring("_D");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
238 buf.writestring(p);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
239 p = buf.toChars();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
240 buf.data = null;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
241 //writef("Declaration.mangle(this = %p, '%s', parent = '%s', linkage = %d) = %s\n", this, toChars(), parent ? parent.toChars() : "null", linkage, p);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
242 return p;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
243 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
244
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
245 int isStatic() { return storage_class & STC.STCstatic; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
246
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
247 bool isStaticConstructor()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
248 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
249 return false;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
250 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
251
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
252 bool isStaticDestructor()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
253 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
254 return false;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
255 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
256
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
257 bool isDelete()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
258 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
259 return false;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
260 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
261
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
262 bool isDataseg()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
263 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
264 return false;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
265 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
266
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
267 bool isThreadlocal()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
268 {
68
ee3a9f34dc48 final bits of codegen implementation to compile Phobos
korDen
parents: 22
diff changeset
269 return false;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
270 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
271
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
272 bool isCodeseg()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
273 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
274 return false;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
275 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
276
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
277 int isCtorinit() { return storage_class & STC.STCctorinit; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
278
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
279 int isFinal() { return storage_class & STC.STCfinal; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
280
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
281 bool isAbstract() { return (storage_class & STC.STCabstract) != 0; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
282
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
283 bool isConst() { return (storage_class & STC.STCconst) != 0; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
284
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
285 int isInvariant() { return storage_class & STC.STCinvariant; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
286
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
287 int isAuto() { return storage_class & STC.STCauto; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
288
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
289 int isScope() { return storage_class & (STC.STCscope | STC.STCauto); }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
290
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
291 int isSynchronized() { return storage_class & STC.STCsynchronized; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
292
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
293 int isParameter() { return storage_class & STC.STCparameter; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
294
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
295 override bool isDeprecated() { return (storage_class & STC.STCdeprecated) != 0; }
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
296
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
297 int isOverride() { return storage_class & STC.STCoverride; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
298
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
299 int isIn() { return storage_class & STC.STCin; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
300
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
301 int isOut() { return storage_class & STC.STCout; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
302
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
303 int isRef() { return storage_class & STC.STCref; }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
304
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
305 override PROT prot()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
306 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
307 return protection;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
308 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
309
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 68
diff changeset
310 override Declaration isDeclaration() { return this; }
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 0
diff changeset
311 }