Displaying 6 results from an estimated 6 matches for "cast_convert_val".
2008 Dec 10
2
[LLVMdev] dyn_cast really doesn't like multiple inheritance
...sses, both of which support dyn_cast. In
order to use dyn_cast on A, I need to do a bunch of extra work:
1) Since dyn_cast uses reinterpret_cast rather than static_cast, the
pointer value won't get adjusted by the cast operation, making the
pointer invalid. I end up having to redefine "cast_convert_val" and
other parts of the casting machinery for my type, so that it uses
static_cast.
2) In every class B which derives from A, it seems like I have to have 4
overloads of 'classof': One for B, one for A, and one for each of A's
top-most ancestors. Otherwise I get ambiguity erro...
2003 Nov 15
2
[LLVMdev] C++ Casting
...These occur pretty much only in Support/Casting.h and llvm/Use.h. They
may occur elsewhere but these are the only ones I've found so far.
A case in point:
/proj/work/llvm/include/Support/Casting.h: In static member function `static
typename llvm::cast_retty<To, From>::ret_type llvm::cast_convert_val<To,
FromTy, FromTy>::doit(const FromTy&)':
/proj/work/llvm/include/Support/Casting.h:181: warning: use of old-style cast
The offending code looks like:
template<class To, class FromTy> struct cast_convert_val<To,FromTy,FromTy> {
// This _is_ a simple type, just cast...
2012 Nov 29
2
[LLVMdev] [cfe-dev] UB in TypeLoc casting
Moving to LLVM dev to discuss the possibility of extending the cast
infrastructure to handle this.
On Tue, Nov 20, 2012 at 5:51 PM, John McCall <rjmccall at apple.com> wrote:
> On Nov 18, 2012, at 5:05 PM, David Blaikie <dblaikie at gmail.com> wrote:
>> TypeLoc casting looks bogus.
>>
>> TypeLoc derived types return true from classof when the dynamic type
>>
2012 Nov 30
0
[LLVMdev] [cfe-dev] UB in TypeLoc casting
...pename std::enable_if<!std::is_same<Y, typename simplify_type<Y>::SimpleType>::value>::type>
inline typename cast_retty<X, Y>::ret_type cast(const Y &Val) {
assert(isa<X>(Val) && "cast<Ty>() argument of incompatible type!");
return cast_convert_val<X, Y,
typename simplify_type<Y>::SimpleType>::doit(Val);
}
+template <class X, class Y, class S = typename std::enable_if<std::is_same<Y, typename simplify_type<Y>::SimpleType>::value>::type>
+inline typename cast_retty<X, Y>::...
2016 Jan 30
0
Question: C-style casting in Casting.h
I was poking through the black magic in Casting.h, and I see this
interesting struct/function:
template<class To, class FromTy> struct cast_convert_val<To,FromTy,FromTy> {
// This _is_ a simple type, just cast it.
static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
typename cast_retty<To, FromTy>::ret_type Res2
= (typename cast_retty<To, FromTy>::ret_type)const_cast<FromTy&>...
2015 Jan 19
3
[LLVMdev] Assertion: replaceAllUses of value with new value of different type! being thrown all of a sudden
> On 2015-Jan-19, at 12:38, Frédéric Riss <friss at apple.com> wrote:
>
>
>> On Jan 19, 2015, at 12:04 PM, Christian Schafmeister <chris.schaf at verizon.net> wrote:
>>
>>
>> I forgot to mention this in my initial email.
>>
>> The build of LLVM that I was using was commit a0d5d7aed8e177cea381b3d054d80c212ece9f2c
>> The date on the