diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/DataLayout.h | 16 | ||||
-rw-r--r-- | include/llvm/Transforms/Utils/Local.h | 3 |
2 files changed, 13 insertions, 6 deletions
diff --git a/include/llvm/DataLayout.h b/include/llvm/DataLayout.h index e9d8678..24ad05f 100644 --- a/include/llvm/DataLayout.h +++ b/include/llvm/DataLayout.h @@ -231,7 +231,9 @@ public: } /// Layout pointer alignment - unsigned getPointerABIAlignment(unsigned AS) const { + /// FIXME: The defaults need to be removed once all of + /// the backends/clients are updated. + unsigned getPointerABIAlignment(unsigned AS = 0) const { DenseMap<unsigned, PointerAlignElem>::const_iterator val = Pointers.find(AS); if (val == Pointers.end()) { val = Pointers.find(0); @@ -239,7 +241,9 @@ public: return val->second.ABIAlign; } /// Return target's alignment for stack-based pointers - unsigned getPointerPrefAlignment(unsigned AS) const { + /// FIXME: The defaults need to be removed once all of + /// the backends/clients are updated. + unsigned getPointerPrefAlignment(unsigned AS = 0) const { DenseMap<unsigned, PointerAlignElem>::const_iterator val = Pointers.find(AS); if (val == Pointers.end()) { val = Pointers.find(0); @@ -247,7 +251,9 @@ public: return val->second.PrefAlign; } /// Layout pointer size - unsigned getPointerSize(unsigned AS) const { + /// FIXME: The defaults need to be removed once all of + /// the backends/clients are updated. + unsigned getPointerSize(unsigned AS = 0) const { DenseMap<unsigned, PointerAlignElem>::const_iterator val = Pointers.find(AS); if (val == Pointers.end()) { val = Pointers.find(0); @@ -255,7 +261,9 @@ public: return val->second.TypeBitWidth; } /// Layout pointer size, in bits - unsigned getPointerSizeInBits(unsigned AS) const { + /// FIXME: The defaults need to be removed once all of + /// the backends/clients are updated. + unsigned getPointerSizeInBits(unsigned AS = 0) const { return getPointerSize(AS) * 8; } /// Size examples: diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index 7173781..be3029e 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -188,8 +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); + unsigned IntPtrWidth = TD.getPointerSizeInBits(); uint64_t PtrSizeMask = ~0ULL >> (64-IntPtrWidth); for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; |