summaryrefslogtreecommitdiff
path: root/lib/VMCore/Type.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-25 16:00:35 +0000
committerDan Gohman <gohman@apple.com>2009-08-25 16:00:35 +0000
commit63a03cf58505aa839f721f212cd1518ebf133979 (patch)
tree4ac56bba954094c78fe415821f69455a01c4c20a /lib/VMCore/Type.cpp
parent0cabaa54e512420f3057ffe781ff317ecb9196ed (diff)
downloadllvm-63a03cf58505aa839f721f212cd1518ebf133979.tar.gz
llvm-63a03cf58505aa839f721f212cd1518ebf133979.tar.bz2
llvm-63a03cf58505aa839f721f212cd1518ebf133979.tar.xz
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
Diffstat (limited to 'lib/VMCore/Type.cpp')
-rw-r--r--lib/VMCore/Type.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 36dcbccdce..696ac96ae6 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;
}
//===----------------------------------------------------------------------===//