diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/MemoryBuiltins.h | 5 | ||||
-rw-r--r-- | include/llvm/Analysis/ScalarEvolution.h | 5 | ||||
-rw-r--r-- | include/llvm/DataLayout.h | 10 | ||||
-rw-r--r-- | include/llvm/InstrTypes.h | 6 | ||||
-rw-r--r-- | include/llvm/Transforms/Utils/Local.h | 4 |
5 files changed, 7 insertions, 23 deletions
diff --git a/include/llvm/Analysis/MemoryBuiltins.h b/include/llvm/Analysis/MemoryBuiltins.h index 9e5d97d..a842898 100644 --- a/include/llvm/Analysis/MemoryBuiltins.h +++ b/include/llvm/Analysis/MemoryBuiltins.h @@ -168,8 +168,7 @@ class ObjectSizeOffsetVisitor public: ObjectSizeOffsetVisitor(const DataLayout *TD, const TargetLibraryInfo *TLI, - LLVMContext &Context, bool RoundToAlign = false, - unsigned AS = 0); + LLVMContext &Context, bool RoundToAlign = false); SizeOffsetType compute(Value *V); @@ -230,7 +229,7 @@ class ObjectSizeOffsetEvaluator public: ObjectSizeOffsetEvaluator(const DataLayout *TD, const TargetLibraryInfo *TLI, - LLVMContext &Context, unsigned AS = 0); + LLVMContext &Context); SizeOffsetEvalType compute(Value *V); bool knownSize(SizeOffsetEvalType SizeOffset) { diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index b5025d3..235adca 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -628,7 +628,7 @@ namespace llvm { /// getSizeOfExpr - Return an expression for sizeof on the given type. /// - const SCEV *getSizeOfExpr(Type *AllocTy, Type *IntPtrTy); + const SCEV *getSizeOfExpr(Type *AllocTy); /// getAlignOfExpr - Return an expression for alignof on the given type. /// @@ -636,8 +636,7 @@ namespace llvm { /// getOffsetOfExpr - Return an expression for offsetof on the given field. /// - const SCEV *getOffsetOfExpr(StructType *STy, Type *IntPtrTy, - unsigned FieldNo); + const SCEV *getOffsetOfExpr(StructType *STy, unsigned FieldNo); /// getOffsetOfExpr - Return an expression for offsetof on the given field. /// diff --git a/include/llvm/DataLayout.h b/include/llvm/DataLayout.h index 987569d..e9d8678 100644 --- a/include/llvm/DataLayout.h +++ b/include/llvm/DataLayout.h @@ -258,14 +258,6 @@ public: unsigned getPointerSizeInBits(unsigned AS) const { return getPointerSize(AS) * 8; } - /// Layout pointer size, in bits, based on the type. - /// If this function is called with a pointer type, then - /// the type size of the pointer is returned. - /// If this function is called with a vector of pointers, - /// then the type size of the pointer is returned. - /// Otherwise the type sizeo f a default pointer is returned. - unsigned getPointerTypeSizeInBits(Type* Ty) const; - /// Size examples: /// /// Type SizeInBits StoreSizeInBits AllocSizeInBits[*] @@ -343,7 +335,7 @@ public: /// getIntPtrType - Return an integer type with size at least as big as that /// of a pointer in the given address space. - IntegerType *getIntPtrType(LLVMContext &C, unsigned AddressSpace) const; + IntegerType *getIntPtrType(LLVMContext &C, unsigned AddressSpace = 0) const; /// getIntPtrType - Return an integer (vector of integer) type with size at /// least as big as that of a pointer of the given pointer (vector of pointer) diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 74e51ff..da17f3b 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -17,7 +17,6 @@ #define LLVM_INSTRUCTION_TYPES_H #include "llvm/Instruction.h" -#include "llvm/DataLayout.h" #include "llvm/OperandTraits.h" #include "llvm/DerivedTypes.h" #include "llvm/ADT/Twine.h" @@ -577,11 +576,6 @@ public: Type *IntPtrTy ///< Integer type corresponding to pointer ) const; - /// @brief Determine if this cast is a no-op cast. - bool isNoopCast( - const DataLayout &DL ///< DataLayout to get the Int Ptr type from. - ) const; - /// Determine how a pair of casts can be eliminated, if they can be at all. /// This is a helper function for both CastInst and ConstantExpr. /// @returns 0 if the CastInst pair can't be eliminated, otherwise diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index 5c804d8..7173781 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -179,9 +179,8 @@ static inline unsigned getKnownAlignment(Value *V, const DataLayout *TD = 0) { template<typename IRBuilderTy> Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &TD, User *GEP, bool NoAssumptions = false) { - unsigned AS = cast<GEPOperator>(GEP)->getPointerAddressSpace(); gep_type_iterator GTI = gep_type_begin(GEP); - Type *IntPtrTy = TD.getIntPtrType(GEP->getContext(), AS); + Type *IntPtrTy = TD.getIntPtrType(GEP->getContext()); Value *Result = Constant::getNullValue(IntPtrTy); // If the GEP is inbounds, we know that none of the addressing operations will @@ -189,6 +188,7 @@ Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &TD, User *GEP, bool isInBounds = cast<GEPOperator>(GEP)->isInBounds() && !NoAssumptions; // Build a mask for high order bits. + unsigned AS = cast<GEPOperator>(GEP)->getPointerAddressSpace(); unsigned IntPtrWidth = TD.getPointerSizeInBits(AS); uint64_t PtrSizeMask = ~0ULL >> (64-IntPtrWidth); |