From 63a03cf58505aa839f721f212cd1518ebf133979 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 25 Aug 2009 16:00:35 +0000 Subject: Allocate the basic types inside the LLVMContextImpl instance, rather than separately with new. Move the members above the TypeMap members to avoid destruction order issues. This fixes a leak of these objects, and eliminates an extra level of indirection in Type::getInt32Ty and friends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79997 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Type.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lib/VMCore/Type.cpp') diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 36dcbcc..696ac96 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -304,55 +304,55 @@ const Type *StructType::getTypeAtIndex(unsigned Idx) const { //===----------------------------------------------------------------------===// const Type *Type::getVoidTy(LLVMContext &C) { - return C.pImpl->VoidTy; + return &C.pImpl->VoidTy; } const Type *Type::getLabelTy(LLVMContext &C) { - return C.pImpl->LabelTy; + return &C.pImpl->LabelTy; } const Type *Type::getFloatTy(LLVMContext &C) { - return C.pImpl->FloatTy; + return &C.pImpl->FloatTy; } const Type *Type::getDoubleTy(LLVMContext &C) { - return C.pImpl->DoubleTy; + return &C.pImpl->DoubleTy; } const Type *Type::getMetadataTy(LLVMContext &C) { - return C.pImpl->MetadataTy; + return &C.pImpl->MetadataTy; } const Type *Type::getX86_FP80Ty(LLVMContext &C) { - return C.pImpl->X86_FP80Ty; + return &C.pImpl->X86_FP80Ty; } const Type *Type::getFP128Ty(LLVMContext &C) { - return C.pImpl->FP128Ty; + return &C.pImpl->FP128Ty; } const Type *Type::getPPC_FP128Ty(LLVMContext &C) { - return C.pImpl->PPC_FP128Ty; + return &C.pImpl->PPC_FP128Ty; } const IntegerType *Type::getInt1Ty(LLVMContext &C) { - return C.pImpl->Int1Ty; + return &C.pImpl->Int1Ty; } const IntegerType *Type::getInt8Ty(LLVMContext &C) { - return C.pImpl->Int8Ty; + return &C.pImpl->Int8Ty; } const IntegerType *Type::getInt16Ty(LLVMContext &C) { - return C.pImpl->Int16Ty; + return &C.pImpl->Int16Ty; } const IntegerType *Type::getInt32Ty(LLVMContext &C) { - return C.pImpl->Int32Ty; + return &C.pImpl->Int32Ty; } const IntegerType *Type::getInt64Ty(LLVMContext &C) { - return C.pImpl->Int64Ty; + return &C.pImpl->Int64Ty; } //===----------------------------------------------------------------------===// -- cgit v1.1