From 3c4c95e522ab2efca47df170d38bc2c19aa173ad Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 26 Feb 2014 16:49:40 +0000 Subject: Move these functions out of line. A DenseMap lookup is not a simple operation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202274 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DataLayout.h | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/llvm/IR/DataLayout.h b/include/llvm/IR/DataLayout.h index 5bdfc49875..8a162430f7 100644 --- a/include/llvm/IR/DataLayout.h +++ b/include/llvm/IR/DataLayout.h @@ -281,34 +281,18 @@ public: /// Layout pointer alignment /// FIXME: The defaults need to be removed once all of /// the backends/clients are updated. - unsigned getPointerABIAlignment(unsigned AS = 0) const { - DenseMap::const_iterator val = Pointers.find(AS); - if (val == Pointers.end()) { - val = Pointers.find(0); - } - return val->second.ABIAlign; - } + unsigned getPointerABIAlignment(unsigned AS = 0) const; /// Return target's alignment for stack-based pointers /// FIXME: The defaults need to be removed once all of /// the backends/clients are updated. - unsigned getPointerPrefAlignment(unsigned AS = 0) const { - DenseMap::const_iterator val = Pointers.find(AS); - if (val == Pointers.end()) { - val = Pointers.find(0); - } - return val->second.PrefAlign; - } + unsigned getPointerPrefAlignment(unsigned AS = 0) const; + /// Layout pointer size /// FIXME: The defaults need to be removed once all of /// the backends/clients are updated. - unsigned getPointerSize(unsigned AS = 0) const { - DenseMap::const_iterator val = Pointers.find(AS); - if (val == Pointers.end()) { - val = Pointers.find(0); - } - return val->second.TypeByteWidth; - } + unsigned getPointerSize(unsigned AS = 0) const; + /// Layout pointer size, in bits /// FIXME: The defaults need to be removed once all of /// the backends/clients are updated. -- cgit v1.2.3