Displaying 2 results from an estimated 2 matches for "some_value_star".
2017 Jun 11
2
Force casting a Value*
On 11 June 2017 at 07:53, David Blaikie <dblaikie at gmail.com> wrote:
> Sounds like you're looking for reinterpret_cast: http://en.
> cppreference.com/w/cpp/language/reinterpret_cast
>
I tried cast<ConstInt>(vo), but that failed at run-time.
>
> On Sun, Jun 11, 2017 at 3:06 AM Dipanjan Das via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
2017 Jun 11
2
Force casting a Value*
...t;> Sounds like you're looking for reinterpret_cast: http://en.cp
>>> preference.com/w/cpp/language/reinterpret_cast
>>>
>>
>> I tried cast<ConstInt>(vo), but that failed at run-time.
>>
>
> That is not the same as reinterpret_cast<int64>(some_value_star).
>
None of the following work.
Value* var_value = reinterpret_cast<intptr_t>(vo);
Value* var_value= reinterpret_cast<uint64_t>(vo);
The following worked, still didn't solve the problem:
Value* var_value = reinterpret_cast<ConstantInt*>(vo);
I can't pass var_value...