From b8bce928f4ffdf50eff69334f3e25b27848536b6 Mon Sep 17 00:00:00 2001 From: Micah Villmow Date: Wed, 24 Oct 2012 17:25:11 +0000 Subject: Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166596 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Constants.cpp | 2 +- lib/VMCore/Type.cpp | 22 ---------------------- lib/VMCore/Verifier.cpp | 3 +-- 3 files changed, 2 insertions(+), 25 deletions(-) (limited to 'lib/VMCore') diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index b96257936d..a4e21e16b3 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -1673,7 +1673,7 @@ Constant *ConstantExpr::getAlignOf(Type* Ty) { // Note that a non-inbounds gep is used, as null isn't within any object. Type *AligningTy = StructType::get(Type::getInt1Ty(Ty->getContext()), Ty, NULL); - Constant *NullPtr = Constant::getNullValue(AligningTy->getPointerTo(Ty)); + Constant *NullPtr = Constant::getNullValue(AligningTy->getPointerTo()); Constant *Zero = ConstantInt::get(Type::getInt64Ty(Ty->getContext()), 0); Constant *One = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1); Constant *Indices[2] = { Zero, One }; diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 13fae3327b..54146e118c 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -779,28 +779,6 @@ PointerType *Type::getPointerTo(unsigned addrs) { return PointerType::get(this, addrs); } -PointerType *Type::getPointerTo(const Type *Ty) { - unsigned AS = 0; - // For pointers, we return a new pointer based on the address space. - if (Ty->isPointerTy()) AS = Ty->getPointerAddressSpace(); - // For vector of pointers, we return a new pointer based on the - // address space of the element pointer type. - if (Ty->isVectorTy()) - AS = Ty->getVectorElementType()->getPointerAddressSpace(); - // Otherwise return a pointer based on the default address space - // since we want a pointer to the current type without having - // a type that can give us the correct address space. - // An example of this occuring is that you want to get a pointer to - // all of the arguments in a function. However, the PointerType - // for a non-pointer type cannot be determined by the type, so - // the default value is used. - return getPointerTo(AS); -} - -PointerType *Type::getPointerTo() { - return getPointerTo(this); -} - bool PointerType::isValidElementType(Type *ElemTy) { return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() && !ElemTy->isMetadataTy(); diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 23f4e54328..eb40b09d29 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -434,8 +434,7 @@ void Verifier::visitGlobalVariable(GlobalVariable &GV) { if (ArrayType *ATy = dyn_cast(GV.getType())) { StructType *STy = dyn_cast(ATy->getElementType()); PointerType *FuncPtrTy = - FunctionType::get(Type::getVoidTy(*Context), false) - ->getPointerTo(GV.getType()); + FunctionType::get(Type::getVoidTy(*Context), false)->getPointerTo(); Assert1(STy && STy->getNumElements() == 2 && STy->getTypeAtIndex(0u)->isIntegerTy(32) && STy->getTypeAtIndex(1) == FuncPtrTy, -- cgit v1.2.3