comparison dmd/expression.h @ 664:eef8ac26c66c

Some missed LLVMDC -> LDC.
author Christian Kamm <kamm incasoftware de>
date Mon, 06 Oct 2008 22:54:08 +0200
parents 722630261d62
children 340acf1535d0
comparison
equal deleted inserted replaced
663:6aaa3d3c1183 664:eef8ac26c66c
156 virtual Expression *buildArrayLoop(Arguments *fparams); 156 virtual Expression *buildArrayLoop(Arguments *fparams);
157 157
158 // Back end 158 // Back end
159 virtual elem *toElem(IRState *irs); 159 virtual elem *toElem(IRState *irs);
160 virtual dt_t **toDt(dt_t **pdt); 160 virtual dt_t **toDt(dt_t **pdt);
161 // LLVMDC 161 // LDC
162 virtual llvm::Constant *toConstElem(IRState *irs); 162 virtual llvm::Constant *toConstElem(IRState *irs);
163 }; 163 };
164 164
165 struct IntegerExp : Expression 165 struct IntegerExp : Expression
166 { 166 {
183 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 183 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
184 void toMangleBuffer(OutBuffer *buf); 184 void toMangleBuffer(OutBuffer *buf);
185 Expression *toLvalue(Scope *sc, Expression *e); 185 Expression *toLvalue(Scope *sc, Expression *e);
186 elem *toElem(IRState *irs); 186 elem *toElem(IRState *irs);
187 dt_t **toDt(dt_t **pdt); 187 dt_t **toDt(dt_t **pdt);
188 // LLVMDC 188 // LDC
189 virtual llvm::Constant *toConstElem(IRState *irs); 189 virtual llvm::Constant *toConstElem(IRState *irs);
190 }; 190 };
191 191
192 struct RealExp : Expression 192 struct RealExp : Expression
193 { 193 {
208 int isBool(int result); 208 int isBool(int result);
209 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 209 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
210 void toMangleBuffer(OutBuffer *buf); 210 void toMangleBuffer(OutBuffer *buf);
211 elem *toElem(IRState *irs); 211 elem *toElem(IRState *irs);
212 dt_t **toDt(dt_t **pdt); 212 dt_t **toDt(dt_t **pdt);
213 // LLVMDC 213 // LDC
214 virtual llvm::Constant *toConstElem(IRState *irs); 214 virtual llvm::Constant *toConstElem(IRState *irs);
215 }; 215 };
216 216
217 struct ComplexExp : Expression 217 struct ComplexExp : Expression
218 { 218 {
236 #ifdef _DH 236 #ifdef _DH
237 OutBuffer hexp; 237 OutBuffer hexp;
238 #endif 238 #endif
239 elem *toElem(IRState *irs); 239 elem *toElem(IRState *irs);
240 dt_t **toDt(dt_t **pdt); 240 dt_t **toDt(dt_t **pdt);
241 // LLVMDC 241 // LDC
242 virtual llvm::Constant *toConstElem(IRState *irs); 242 virtual llvm::Constant *toConstElem(IRState *irs);
243 }; 243 };
244 244
245 struct IdentifierExp : Expression 245 struct IdentifierExp : Expression
246 { 246 {
315 MATCH implicitConvTo(Type *t); 315 MATCH implicitConvTo(Type *t);
316 Expression *castTo(Scope *sc, Type *t); 316 Expression *castTo(Scope *sc, Type *t);
317 Expression *interpret(InterState *istate); 317 Expression *interpret(InterState *istate);
318 elem *toElem(IRState *irs); 318 elem *toElem(IRState *irs);
319 dt_t **toDt(dt_t **pdt); 319 dt_t **toDt(dt_t **pdt);
320 // LLVMDC 320 // LDC
321 virtual llvm::Constant *toConstElem(IRState *irs); 321 virtual llvm::Constant *toConstElem(IRState *irs);
322 }; 322 };
323 323
324 struct StringExp : Expression 324 struct StringExp : Expression
325 { 325 {
345 unsigned charAt(size_t i); 345 unsigned charAt(size_t i);
346 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 346 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
347 void toMangleBuffer(OutBuffer *buf); 347 void toMangleBuffer(OutBuffer *buf);
348 elem *toElem(IRState *irs); 348 elem *toElem(IRState *irs);
349 dt_t **toDt(dt_t **pdt); 349 dt_t **toDt(dt_t **pdt);
350 // LLVMDC 350 // LDC
351 virtual llvm::Constant *toConstElem(IRState *irs); 351 virtual llvm::Constant *toConstElem(IRState *irs);
352 }; 352 };
353 353
354 // Tuple 354 // Tuple
355 355
398 dt_t **toDt(dt_t **pdt); 398 dt_t **toDt(dt_t **pdt);
399 399
400 int inlineCost(InlineCostState *ics); 400 int inlineCost(InlineCostState *ics);
401 Expression *doInline(InlineDoState *ids); 401 Expression *doInline(InlineDoState *ids);
402 Expression *inlineScan(InlineScanState *iss); 402 Expression *inlineScan(InlineScanState *iss);
403 // LLVMDC 403 // LDC
404 virtual llvm::Constant *toConstElem(IRState *irs); 404 virtual llvm::Constant *toConstElem(IRState *irs);
405 }; 405 };
406 406
407 struct AssocArrayLiteralExp : Expression 407 struct AssocArrayLiteralExp : Expression
408 { 408 {
425 Expression *castTo(Scope *sc, Type *t); 425 Expression *castTo(Scope *sc, Type *t);
426 426
427 int inlineCost(InlineCostState *ics); 427 int inlineCost(InlineCostState *ics);
428 Expression *doInline(InlineDoState *ids); 428 Expression *doInline(InlineDoState *ids);
429 Expression *inlineScan(InlineScanState *iss); 429 Expression *inlineScan(InlineScanState *iss);
430 // LLVMDC 430 // LDC
431 virtual llvm::Constant *toConstElem(IRState *irs); 431 virtual llvm::Constant *toConstElem(IRState *irs);
432 }; 432 };
433 433
434 struct StructLiteralExp : Expression 434 struct StructLiteralExp : Expression
435 { 435 {
458 Expression *toLvalue(Scope *sc, Expression *e); 458 Expression *toLvalue(Scope *sc, Expression *e);
459 459
460 int inlineCost(InlineCostState *ics); 460 int inlineCost(InlineCostState *ics);
461 Expression *doInline(InlineDoState *ids); 461 Expression *doInline(InlineDoState *ids);
462 Expression *inlineScan(InlineScanState *iss); 462 Expression *inlineScan(InlineScanState *iss);
463 // LLVMDC 463 // LDC
464 virtual llvm::Constant *toConstElem(IRState *irs); 464 virtual llvm::Constant *toConstElem(IRState *irs);
465 }; 465 };
466 466
467 struct TypeDotIdExp : Expression 467 struct TypeDotIdExp : Expression
468 { 468 {
592 void scanForNestedRef(Scope *sc); 592 void scanForNestedRef(Scope *sc);
593 593
594 int inlineCost(InlineCostState *ics); 594 int inlineCost(InlineCostState *ics);
595 Expression *doInline(InlineDoState *ids); 595 Expression *doInline(InlineDoState *ids);
596 //Expression *inlineScan(InlineScanState *iss); 596 //Expression *inlineScan(InlineScanState *iss);
597 // LLVMDC 597 // LDC
598 virtual llvm::Constant *toConstElem(IRState *irs); 598 virtual llvm::Constant *toConstElem(IRState *irs);
599 }; 599 };
600 600
601 #if DMDV2 601 #if DMDV2
602 // Overload Set 602 // Overload Set
824 Expression *modifiableLvalue(Scope *sc, Expression *e); 824 Expression *modifiableLvalue(Scope *sc, Expression *e);
825 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 825 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
826 void dump(int indent); 826 void dump(int indent);
827 elem *toElem(IRState *irs); 827 elem *toElem(IRState *irs);
828 828
829 //LLVMDC: since we don't convert abc.def -> *(&abc + ABC.def.offsetof) 829 //LDC: since we don't convert abc.def -> *(&abc + ABC.def.offsetof)
830 // these are needed 830 // these are needed
831 Expression *optimize(int result); 831 Expression *optimize(int result);
832 Expression *interpret(InterState *istate); 832 Expression *interpret(InterState *istate);
833 }; 833 };
834 834
899 Expression *semantic(Scope *sc); 899 Expression *semantic(Scope *sc);
900 elem *toElem(IRState *irs); 900 elem *toElem(IRState *irs);
901 MATCH implicitConvTo(Type *t); 901 MATCH implicitConvTo(Type *t);
902 Expression *castTo(Scope *sc, Type *t); 902 Expression *castTo(Scope *sc, Type *t);
903 Expression *optimize(int result); 903 Expression *optimize(int result);
904 // LLVMDC 904 // LDC
905 virtual llvm::Constant *toConstElem(IRState *irs); 905 virtual llvm::Constant *toConstElem(IRState *irs);
906 }; 906 };
907 907
908 struct PtrExp : UnaExp 908 struct PtrExp : UnaExp
909 { 909 {
1002 elem *toElem(IRState *irs); 1002 elem *toElem(IRState *irs);
1003 1003
1004 // For operator overloading 1004 // For operator overloading
1005 Identifier *opId(); 1005 Identifier *opId();
1006 1006
1007 // LLVMDC 1007 // LDC
1008 virtual llvm::Constant *toConstElem(IRState *irs); 1008 virtual llvm::Constant *toConstElem(IRState *irs);
1009 }; 1009 };
1010 1010
1011 1011
1012 struct SliceExp : UnaExp 1012 struct SliceExp : UnaExp
1499 1499
1500 /****************************************************************/ 1500 /****************************************************************/
1501 1501
1502 #if IN_LLVM 1502 #if IN_LLVM
1503 1503
1504 // this stuff is strictly LLVMDC 1504 // this stuff is strictly LDC
1505 1505
1506 struct GEPExp : UnaExp 1506 struct GEPExp : UnaExp
1507 { 1507 {
1508 unsigned index; 1508 unsigned index;
1509 Identifier* ident; 1509 Identifier* ident;