comparison ir/irtype.cpp @ 1569:755abafbf25d

Push the context through StructType::get. Requires LLVM >= 78258. Also remove old #if's.
author Benjamin Kramer <benny.kra@gmail.com>
date Thu, 06 Aug 2009 01:47:39 +0200
parents 46f6365a50d7
children 8d086d552909
comparison
equal deleted inserted replaced
1568:a591aa6bd6dc 1569:755abafbf25d
90 else 90 else
91 return llvm::Type::DoubleTy; 91 return llvm::Type::DoubleTy;
92 92
93 case Tcomplex32: 93 case Tcomplex32:
94 t2 = llvm::Type::FloatTy; 94 t2 = llvm::Type::FloatTy;
95 return llvm::StructType::get(t2, t2, NULL); 95 return llvm::StructType::get(gIR->context(), t2, t2, NULL);
96 96
97 case Tcomplex64: 97 case Tcomplex64:
98 t2 = llvm::Type::DoubleTy; 98 t2 = llvm::Type::DoubleTy;
99 return llvm::StructType::get(t2, t2, NULL); 99 return llvm::StructType::get(gIR->context(), t2, t2, NULL);
100 100
101 case Tcomplex80: 101 case Tcomplex80:
102 t2 = (global.params.cpu == ARCHx86 || global.params.cpu == ARCHx86_64) 102 t2 = (global.params.cpu == ARCHx86 || global.params.cpu == ARCHx86_64)
103 ? llvm::Type::X86_FP80Ty 103 ? llvm::Type::X86_FP80Ty
104 : llvm::Type::DoubleTy; 104 : llvm::Type::DoubleTy;
105 return llvm::StructType::get(t2, t2, NULL); 105 return llvm::StructType::get(gIR->context(), t2, t2, NULL);
106 106
107 case Tbool: 107 case Tbool:
108 return llvm::Type::Int1Ty; 108 return llvm::Type::Int1Ty;
109 } 109 }
110 110
202 if (elemType == llvm::Type::VoidTy) 202 if (elemType == llvm::Type::VoidTy)
203 elemType = llvm::Type::Int8Ty; 203 elemType = llvm::Type::Int8Ty;
204 elemType = llvm::PointerType::get(elemType, 0); 204 elemType = llvm::PointerType::get(elemType, 0);
205 205
206 // create struct type 206 // create struct type
207 const llvm::Type* at = llvm::StructType::get(DtoSize_t(), elemType, NULL); 207 const llvm::Type* at = llvm::StructType::get(gIR->context(), DtoSize_t(), elemType, NULL);
208 208
209 // name dynamic array types 209 // name dynamic array types
210 Type::sir->getState()->module->addTypeName(t->toChars(), at); 210 Type::sir->getState()->module->addTypeName(t->toChars(), at);
211 211
212 return at; 212 return at;