llvm.org GIT mirror llvm / ab2a663
Update cpp generation with new LLVM API for primitive types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79098 91177308-0d34-0410-b5e6-96231b3b80d8 Nicolas Geoffray 10 years ago
1 changed file(s) with 7 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
349349 // First, handle the primitive types .. easy
350350 if (Ty->isPrimitiveType() || Ty->isInteger()) {
351351 switch (Ty->getTypeID()) {
352 case Type::VoidTyID: return "Type::VoidTy";
352 case Type::VoidTyID: return "Type::getVoidTy(getGlobalContext())";
353353 case Type::IntegerTyID: {
354354 unsigned BitWidth = cast(Ty)->getBitWidth();
355355 return "IntegerType::get(getGlobalContext(), " + utostr(BitWidth) + ")";
356356 }
357 case Type::X86_FP80TyID: return "Type::X86_FP80Ty";
358 case Type::FloatTyID: return "Type::FloatTy";
359 case Type::DoubleTyID: return "Type::DoubleTy";
360 case Type::LabelTyID: return "Type::LabelTy";
357 case Type::X86_FP80TyID: return "Type::getX86_FP80Ty(getGlobalContext())";
358 case Type::FloatTyID: return "Type::getFloatTy(getGlobalContext())";
359 case Type::DoubleTyID: return "Type::getDoubleTy(getGlobalContext())";
360 case Type::LabelTyID: return "Type::getLabelTy(getGlobalContext())";
361361 default:
362362 error("Invalid primitive type");
363363 break;
364364 }
365 return "Type::VoidTy"; // shouldn't be returned, but make it sensible
365 // shouldn't be returned, but make it sensible
366 return "Type::getVoidTy(getGlobalContext())";
366367 }
367368
368369 // Now, see if we've seen the type before and return that