summaryrefslogtreecommitdiff
path: root/include/llvm/IR/DataLayout.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-02-26 16:58:35 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-02-26 16:58:35 +0000
commite3561972d45633cee705084ce1e26c4ecbbe8d43 (patch)
treec4799fe481e9096cd9f2ccfd65a86db37b4ebb76 /include/llvm/IR/DataLayout.h
parent3c4c95e522ab2efca47df170d38bc2c19aa173ad (diff)
downloadllvm-e3561972d45633cee705084ce1e26c4ecbbe8d43.tar.gz
llvm-e3561972d45633cee705084ce1e26c4ecbbe8d43.tar.bz2
llvm-e3561972d45633cee705084ce1e26c4ecbbe8d43.tar.xz
Use a sorted array to store the information about a few address spaces.
We don't have any test with more than 6 address spaces, so a DenseMap is probably not the correct answer. An unsorted array would also be OK, but we have to sort it for printing anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202275 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IR/DataLayout.h')
-rw-r--r--include/llvm/IR/DataLayout.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/IR/DataLayout.h b/include/llvm/IR/DataLayout.h
index 8a162430f7..e26dd026bd 100644
--- a/include/llvm/IR/DataLayout.h
+++ b/include/llvm/IR/DataLayout.h
@@ -115,7 +115,14 @@ private:
/// pointers vs. 64-bit pointers by extending LayoutAlignment, but for now,
/// we don't.
SmallVector<LayoutAlignElem, 16> Alignments;
- DenseMap<unsigned, PointerAlignElem> Pointers;
+ typedef SmallVector<PointerAlignElem, 8> PointersTy;
+ PointersTy Pointers;
+
+ PointersTy::const_iterator findPoiterLowerBound(uint32_t AddressSpace) const {
+ return const_cast<DataLayout *>(this)->findPoiterLowerBound(AddressSpace);
+ }
+
+ PointersTy::iterator findPoiterLowerBound(uint32_t AddressSpace);
/// InvalidAlignmentElem - This member is a signal that a requested alignment
/// type and bit width were not found in the SmallVector.