[llvm-commits] [llvm] r79098 - /llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Sat Aug 15 07:47:42 PDT 2009
Author: geoffray
Date: Sat Aug 15 09:47:42 2009
New Revision: 79098
URL: http://llvm.org/viewvc/llvm-project?rev=79098&view=rev
Log:
Update cpp generation with new LLVM API for primitive types.
Modified:
llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=79098&r1=79097&r2=79098&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original)
+++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Sat Aug 15 09:47:42 2009
@@ -350,20 +350,21 @@
// 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
More information about the llvm-commits
mailing list