[llvm-commits] [PATCH] Add getPointerTypeSizeInBits API to datalayout

Duncan Sands baldrick at free.fr
Tue Nov 6 01:12:09 PST 2012


Hi Micah,

On 05/11/12 22:41, Micah Villmow wrote:
> This re-adds the getPointerTypeSizeInBits API to the DataLayout class and also adds in unit tests to verify the functionality for both scalar pointers and vector of pointers.

is this method actually useful?  Before your previous patches were reverted I
took a look at the places where it was used, and there was only one use outside
of DataLayout.cpp itself IIRC.  As it is just the same as

   TD->getTypeSizeInBits(Ty->getScalarType());

I'm not sure it merits it's own method.  However I can live with it being an
inline helper in the DataLayout header file if you really want it (please use
the simple one-line implementation above).

As for the unittest, thanks for working on tests!  If it is decided not to have
a getPointerTypeSizeInBits method then please transform your test to one that
checks getTypeSizeInBits directly.

Ciao, Duncan.


>
> http://llvm-reviews.chandlerc.com/D100
>
> Files:
>    unittests/VMCore/DataLayoutTests.cpp
>    unittests/VMCore/CMakeLists.txt
>    include/llvm/DataLayout.h
>    lib/VMCore/DataLayout.cpp
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list