mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-28 15:33:16 +00:00
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
This commit is contained in:
parent
bfa79b8be9
commit
ab2a663af1
@ -350,20 +350,21 @@ namespace {
|
||||
// First, handle the primitive types .. easy
|
||||
if (Ty->isPrimitiveType() || Ty->isInteger()) {
|
||||
switch (Ty->getTypeID()) {
|
||||
case Type::VoidTyID: return "Type::VoidTy";
|
||||
case Type::VoidTyID: return "Type::getVoidTy(getGlobalContext())";
|
||||
case Type::IntegerTyID: {
|
||||
unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth();
|
||||
return "IntegerType::get(getGlobalContext(), " + utostr(BitWidth) + ")";
|
||||
}
|
||||
case Type::X86_FP80TyID: return "Type::X86_FP80Ty";
|
||||
case Type::FloatTyID: return "Type::FloatTy";
|
||||
case Type::DoubleTyID: return "Type::DoubleTy";
|
||||
case Type::LabelTyID: return "Type::LabelTy";
|
||||
case Type::X86_FP80TyID: return "Type::getX86_FP80Ty(getGlobalContext())";
|
||||
case Type::FloatTyID: return "Type::getFloatTy(getGlobalContext())";
|
||||
case Type::DoubleTyID: return "Type::getDoubleTy(getGlobalContext())";
|
||||
case Type::LabelTyID: return "Type::getLabelTy(getGlobalContext())";
|
||||
default:
|
||||
error("Invalid primitive type");
|
||||
break;
|
||||
}
|
||||
return "Type::VoidTy"; // shouldn't be returned, but make it sensible
|
||||
// shouldn't be returned, but make it sensible
|
||||
return "Type::getVoidTy(getGlobalContext())";
|
||||
}
|
||||
|
||||
// Now, see if we've seen the type before and return that
|
||||
|
Loading…
Reference in New Issue
Block a user