Mercurial > projects > ldc
comparison gen/complex.cpp @ 1571:8d086d552909
IntegerType is now contextifed.
Requires llvm >= 78969. resistor says this will be the last context API change :)
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Fri, 14 Aug 2009 00:39:18 +0200 |
parents | 755abafbf25d |
children | 7f728c52e63c |
comparison
equal
deleted
inserted
replaced
1570:ab03cfb3a212 | 1571:8d086d552909 |
---|---|
22 const LLType* DtoComplexBaseType(Type* t) | 22 const LLType* DtoComplexBaseType(Type* t) |
23 { | 23 { |
24 TY ty = t->toBasetype()->ty; | 24 TY ty = t->toBasetype()->ty; |
25 const LLType* base; | 25 const LLType* base; |
26 if (ty == Tcomplex32) { | 26 if (ty == Tcomplex32) { |
27 return LLType::FloatTy; | 27 return LLType::getFloatTy(gIR->context()); |
28 } | 28 } |
29 else if (ty == Tcomplex64) { | 29 else if (ty == Tcomplex64) { |
30 return LLType::DoubleTy; | 30 return LLType::getDoubleTy(gIR->context()); |
31 } | 31 } |
32 else if (ty == Tcomplex80) { | 32 else if (ty == Tcomplex80) { |
33 if ((global.params.cpu == ARCHx86) || (global.params.cpu == ARCHx86_64)) | 33 if ((global.params.cpu == ARCHx86) || (global.params.cpu == ARCHx86_64)) |
34 return LLType::X86_FP80Ty; | 34 return LLType::getX86_FP80Ty(gIR->context()); |
35 else | 35 else |
36 return LLType::DoubleTy; | 36 return LLType::getDoubleTy(gIR->context()); |
37 } | 37 } |
38 else { | 38 else { |
39 assert(0); | 39 assert(0); |
40 } | 40 } |
41 } | 41 } |