diff options
author | Micah Villmow <villmow@gmail.com> | 2012-10-24 17:25:11 +0000 |
---|---|---|
committer | Micah Villmow <villmow@gmail.com> | 2012-10-24 17:25:11 +0000 |
commit | b8bce928f4ffdf50eff69334f3e25b27848536b6 (patch) | |
tree | e334a8f1cd0126aafd8ae6cc2ca13ed654620193 /lib/VMCore | |
parent | 0873bea3ed2d740208131f7f1706b0628c0aae09 (diff) | |
download | external_llvm-b8bce928f4ffdf50eff69334f3e25b27848536b6.zip external_llvm-b8bce928f4ffdf50eff69334f3e25b27848536b6.tar.gz external_llvm-b8bce928f4ffdf50eff69334f3e25b27848536b6.tar.bz2 |
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
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Constants.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/Type.cpp | 22 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 3 |
3 files changed, 2 insertions, 25 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index b962579..a4e21e1 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 13fae33..54146e1 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 23f4e54..eb40b09 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<ArrayType>(GV.getType())) { StructType *STy = dyn_cast<StructType>(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, |