[llvm-dev] Force casting a Value*

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 11 07:53:05 PDT 2017


Sounds like you're looking for reinterpret_cast:
http://en.cppreference.com/w/cpp/language/reinterpret_cast

On Sun, Jun 11, 2017 at 3:06 AM Dipanjan Das via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
> I am trying to cast a Value* irrespective of  its underlying subclass to
> uint64 and pass it on to a method as an argument.
>
> if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) {
>                     Value* vo = store_inst->getValueOperand();
>                      uint64 value = /* cast vo to unsigned int 64 bit */
>                      func(value);
>                 }
>
> How can I force cast 'vo' to unsigned int?
>
> --
>
> Thanks & Regards,
> Dipanjan
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170611/e06ff6ea/attachment.html>


More information about the llvm-dev mailing list