Mercurial > projects > ldc
comparison dmd/statement.h @ 920:545f54041d91
Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Fixed align N; in asm blocks.
Fixed inreg parameter passing on x86 for ref/out params.
Removed support for lazy initialization of function local static variables, I have no idea why I ever implemented this, it's not in the D spec, and DMD doesn't support it :P
Some of the global variable related changes might cause minor regressions, but they should be easily fixable.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 03 Feb 2009 08:54:57 +0100 |
parents | 330f999ade44 |
children | 03d7c4aac654 |
comparison
equal
deleted
inserted
replaced
919:c76f74d09fb1 | 920:545f54041d91 |
---|---|
159 virtual Statement *inlineScan(InlineScanState *iss); | 159 virtual Statement *inlineScan(InlineScanState *iss); |
160 | 160 |
161 // Back end | 161 // Back end |
162 virtual void toIR(IRState *irs); | 162 virtual void toIR(IRState *irs); |
163 | 163 |
164 // LDC | |
165 virtual void toNakedIR(IRState *irs); | |
166 | |
164 // Avoid dynamic_cast | 167 // Avoid dynamic_cast |
165 virtual DeclarationStatement *isDeclarationStatement() { return NULL; } | 168 virtual DeclarationStatement *isDeclarationStatement() { return NULL; } |
166 virtual CompoundStatement *isCompoundStatement() { return NULL; } | 169 virtual CompoundStatement *isCompoundStatement() { return NULL; } |
167 virtual ReturnStatement *isReturnStatement() { return NULL; } | 170 virtual ReturnStatement *isReturnStatement() { return NULL; } |
168 virtual IfStatement *isIfStatement() { return NULL; } | 171 virtual IfStatement *isIfStatement() { return NULL; } |
183 int inlineCost(InlineCostState *ics); | 186 int inlineCost(InlineCostState *ics); |
184 Expression *doInline(InlineDoState *ids); | 187 Expression *doInline(InlineDoState *ids); |
185 Statement *inlineScan(InlineScanState *iss); | 188 Statement *inlineScan(InlineScanState *iss); |
186 | 189 |
187 void toIR(IRState *irs); | 190 void toIR(IRState *irs); |
191 | |
192 // LDC | |
193 void toNakedIR(IRState *irs); | |
188 }; | 194 }; |
189 | 195 |
190 struct CompileStatement : Statement | 196 struct CompileStatement : Statement |
191 { | 197 { |
192 Expression *exp; | 198 Expression *exp; |
231 int inlineCost(InlineCostState *ics); | 237 int inlineCost(InlineCostState *ics); |
232 Expression *doInline(InlineDoState *ids); | 238 Expression *doInline(InlineDoState *ids); |
233 Statement *inlineScan(InlineScanState *iss); | 239 Statement *inlineScan(InlineScanState *iss); |
234 | 240 |
235 virtual void toIR(IRState *irs); | 241 virtual void toIR(IRState *irs); |
242 | |
243 // LDC | |
244 virtual void toNakedIR(IRState *irs); | |
236 | 245 |
237 virtual CompoundStatement *isCompoundStatement() { return this; } | 246 virtual CompoundStatement *isCompoundStatement() { return this; } |
238 }; | 247 }; |
239 | 248 |
240 /* The purpose of this is so that continue will go to the next | 249 /* The purpose of this is so that continue will go to the next |
842 | 851 |
843 void toIR(IRState *irs); | 852 void toIR(IRState *irs); |
844 | 853 |
845 // LDC | 854 // LDC |
846 bool asmLabel; // for labels inside inline assembler | 855 bool asmLabel; // for labels inside inline assembler |
856 void toNakedIR(IRState *irs); | |
847 }; | 857 }; |
848 | 858 |
849 struct LabelDsymbol : Dsymbol | 859 struct LabelDsymbol : Dsymbol |
850 { | 860 { |
851 LabelStatement *statement; | 861 LabelStatement *statement; |
874 void toIR(IRState *irs); | 884 void toIR(IRState *irs); |
875 | 885 |
876 // LDC | 886 // LDC |
877 // non-zero if this is a branch, contains the target labels identifier | 887 // non-zero if this is a branch, contains the target labels identifier |
878 Identifier* isBranchToLabel; | 888 Identifier* isBranchToLabel; |
889 | |
890 void toNakedIR(IRState *irs); | |
879 }; | 891 }; |
880 | 892 |
881 struct AsmBlockStatement : CompoundStatement | 893 struct AsmBlockStatement : CompoundStatement |
882 { | 894 { |
883 EnclosingHandler* enclosinghandler; | 895 EnclosingHandler* enclosinghandler; |
890 | 902 |
891 CompoundStatement *isCompoundStatement() { return NULL; } | 903 CompoundStatement *isCompoundStatement() { return NULL; } |
892 AsmBlockStatement *isAsmBlockStatement() { return this; } | 904 AsmBlockStatement *isAsmBlockStatement() { return this; } |
893 | 905 |
894 void toIR(IRState *irs); | 906 void toIR(IRState *irs); |
907 void toNakedIR(IRState *irs); | |
895 }; | 908 }; |
896 | 909 |
897 #endif /* DMD_STATEMENT_H */ | 910 #endif /* DMD_STATEMENT_H */ |