From ab2a663af1a696872d042d1a91f93ab9f8194fd6 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Sat, 15 Aug 2009 14:47:42 +0000 Subject: [PATCH] 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 --- lib/Target/CppBackend/CPPBackend.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 690436c2de0..79f1366d7ab 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -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(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