[LLVMdev] type-system-rewrite branch landing tomorrow

Chris Lattner
Sun, 10 Jul 2011 05:46:29 -0000

On Jul 9, 2011, at 1:11 PM, Jay Foad wrote:

>> ... and it's in.  Please let me know if you see any problems.
>
> My clang self-hosted build (Release+Asserts on Release+Asserts, Linux
> x86_64) fails with:
>
> make[2]: Entering directory `/home/jay/llvm/objdir-self/tools/opt'
> llvm[2]: Compiling GraphPrinters.cpp for Debug+Asserts build
> clang:
/home/jay/svn/llvm-project/llvm/trunk/include/llvm/Support/Casting.h:194:
> typename llvm::cast_retty<To, From>::ret_type llvm::cast(const
Y&)
> [with X = llvm::FunctionType, Y = llvm::Type*, typename
> llvm::cast_retty<To, From>::ret_type = llvm::FunctionType*]:
Assertion
> `isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.
>
> This is one of the cases that was giving me grief when I was working
> on the Clang bits! Here's a small C testcase:
>
> $ cat foo.c
> struct S;
> extern struct T {
>  struct S (*p)(void);
> } t;
> struct S { int i; };
> void g(void) {
>  t.p();
> }
> $ clang -cc1 -emit-llvm foo.c
> clang:
/home/jay/svn/llvm-project/llvm/trunk/include/llvm/Support/Casting.h:194:
> typename llvm::cast_retty<To, From>::ret_type llvm::cast(const
Y&)
> [with X = llvm::FunctionType, Y = llvm::Type*, typename
> llvm::cast_retty<To, From>::ret_type = llvm::FunctionType*]:
Assertion
> `isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.

This should be fixed now.

-Chris