[cfe-dev] Explanation of the llvm::PointerIntPair data structure

Nikola Smiljanic popizdeh at gmail.com
Fri Mar 7 13:25:27 PST 2014


The rationale is performance. The more things you can fit inside caches the
better. It's also used as a building block for type safe unions of 2, 3 and
4 pointers that take up space for one pointer.


On Sat, Mar 8, 2014 at 6:22 AM, kwadwo amankwa <que at lunarblack.com> wrote:

> Hi ,
> I'm studying the llvm/clang source I came accross this line ;
>
> 97 mutable  llvm::PointerIntPair<const llvm::MemoryBuffer *, 2> Buffer;
>
>
> in SourceManager.h and I am curious as to the rationale behind using the
> PointerPair data structure ?I read the documentation about bit mangling and
>  I would be greatful if someone could provide an explanation for the
> rationale behind this technique.
>
>
> thanks ,
> que
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140308/7ca429b8/attachment.html>


More information about the cfe-dev mailing list