[PATCH] ADT: Remove misaligned pointeres from DenseMapInfo
Alexey Samsonov
vonosmas at gmail.com
Mon Dec 29 17:45:15 PST 2014
On Mon, Dec 29, 2014 at 5:41 PM, Chandler Carruth <chandlerc at gmail.com>
wrote:
>
> On Mon, Dec 29, 2014 at 5:33 PM, Alexey Samsonov <vonosmas at gmail.com>
> wrote:
>
>> Casing (int*) to (float*) doesn't dereference a pointer. However,
>> upcast/downcast (in general case) does dereference a pointer - you may need
>> to read vtable and adjust the pointer value accordingly.
>
>
> I see, so the problem is we're up casting or down casting? I suspect such
> casts can be avoided? We should only be casting between integers and a
> single pointer type in the dense map stuff...
>
If we have smth. like DenseMap<AssertingVH<T>, Foo> (or other ValueHandle
kinds), we would cast empty/tombstone keys (i.e. fake pointers) for T* to
Value*.
--
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141229/fed6371f/attachment.html>
More information about the llvm-commits
mailing list