Index: include/llvm/IR/DataLayout.h =================================================================== --- include/llvm/IR/DataLayout.h +++ include/llvm/IR/DataLayout.h @@ -265,6 +265,18 @@ } return val->second.TypeBitWidth; } + + /// Return the largest pointer size for known address spaces. + unsigned getMaxPointerSize() const { + unsigned MaxPtrSize = 0; + for (DenseMap::const_iterator I + = Pointers.begin(), E = Pointers.end(); I != E; ++I) { + MaxPtrSize = std::max(MaxPtrSize, I->second.TypeBitWidth); + } + + return (MaxPtrSize == 0) ? 64 : MaxPtrSize; + } + /// Layout pointer size, in bits /// FIXME: The defaults need to be removed once all of /// the backends/clients are updated.