[llvm-commits] [llvm] r166923 - /llvm/trunk/include/llvm/DataLayout.h

Duncan Sands baldrick at free.fr
Mon Oct 29 05:19:04 PDT 2012


Author: baldrick
Date: Mon Oct 29 07:19:04 2012
New Revision: 166923

URL: http://llvm.org/viewvc/llvm-project?rev=166923&view=rev
Log:
Rather than duplicating the getPointerSize code just call getPointerSize.

Modified:
    llvm/trunk/include/llvm/DataLayout.h

Modified: llvm/trunk/include/llvm/DataLayout.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DataLayout.h?rev=166923&r1=166922&r2=166923&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DataLayout.h (original)
+++ llvm/trunk/include/llvm/DataLayout.h Mon Oct 29 07:19:04 2012
@@ -256,11 +256,7 @@
   }
   /// Layout pointer size, in bits
   unsigned getPointerSizeInBits(unsigned AS)    const {
-    DenseMap<unsigned, PointerAlignElem>::const_iterator val = Pointers.find(AS);
-    if (val == Pointers.end()) {
-      val = Pointers.find(0);
-    }
-    return 8*val->second.TypeBitWidth;
+    return getPointerSize(AS) * 8;
   }
   /// Layout pointer size, in bits, based on the type.
   /// If this function is called with a pointer type, then





More information about the llvm-commits mailing list