comparison gen/abi-x86-64.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
comparison
equal deleted inserted replaced
1570:ab03cfb3a212 1571:8d086d552909
229 unsigned size = ty->size(); 229 unsigned size = ty->size();
230 230
231 switch (cl.classes[0]) { 231 switch (cl.classes[0]) {
232 case Integer: { 232 case Integer: {
233 unsigned bits = (size >= 8 ? 64 : (size * 8)); 233 unsigned bits = (size >= 8 ? 64 : (size * 8));
234 parts.push_back(LLIntegerType::get(bits)); 234 parts.push_back(LLIntegerType::get(gIR->context(), bits));
235 break; 235 break;
236 } 236 }
237 237
238 case Sse: 238 case Sse:
239 parts.push_back(size <= 4 ? LLType::FloatTy : LLType::DoubleTy); 239 parts.push_back(size <= 4 ? LLType::getFloatTy(gIR->context()) : LLType::getDoubleTy(gIR->context()));
240 break; 240 break;
241 241
242 case X87: 242 case X87:
243 assert(cl.classes[1] == X87Up && "Upper half of real not X87Up?"); 243 assert(cl.classes[1] == X87Up && "Upper half of real not X87Up?");
244 /// The type only contains a single real/ireal field, 244 /// The type only contains a single real/ireal field,
245 /// so just use that type. 245 /// so just use that type.
246 return const_cast<LLType*>(LLType::X86_FP80Ty); 246 return const_cast<LLType*>(LLType::getX86_FP80Ty(gIR->context()));
247 247
248 default: 248 default:
249 assert(0 && "Unanticipated argument class"); 249 assert(0 && "Unanticipated argument class");
250 } 250 }
251 251
258 break; 258 break;
259 259
260 case Integer: { 260 case Integer: {
261 assert(size > 8); 261 assert(size > 8);
262 unsigned bits = (size - 8) * 8; 262 unsigned bits = (size - 8) * 8;
263 parts.push_back(LLIntegerType::get(bits)); 263 parts.push_back(LLIntegerType::get(gIR->context(), bits));
264 break; 264 break;
265 } 265 }
266 case Sse: 266 case Sse:
267 parts.push_back(size <= 12 ? LLType::FloatTy : LLType::DoubleTy); 267 parts.push_back(size <= 12 ? LLType::getFloatTy(gIR->context()) : LLType::getDoubleTy(gIR->context()));
268 break; 268 break;
269 269
270 case X87Up: 270 case X87Up:
271 if(cl.classes[0] == X87) { 271 if(cl.classes[0] == X87) {
272 // This won't happen: it was short-circuited while 272 // This won't happen: it was short-circuited while
273 // processing the first half. 273 // processing the first half.
274 } else { 274 } else {
275 // I can't find this anywhere in the ABI documentation, 275 // I can't find this anywhere in the ABI documentation,
276 // but this is what gcc does (both regular and llvm-gcc). 276 // but this is what gcc does (both regular and llvm-gcc).
277 // (This triggers for types like union { real r; byte b; }) 277 // (This triggers for types like union { real r; byte b; })
278 parts.push_back(LLType::DoubleTy); 278 parts.push_back(LLType::getDoubleTy(gIR->context()));
279 } 279 }
280 break; 280 break;
281 281
282 default: 282 default:
283 assert(0 && "Unanticipated argument class for second half"); 283 assert(0 && "Unanticipated argument class for second half");