[LLVMdev] Why asserts don't provide much information?

Curtis Faith curtis_faith at yahoo.com
Thu Jun 3 19:47:11 PDT 2010


I concur. I've run into this exact assert at least 10 different times in the last two weeks since I started with LLVM as I'm learning the particulars of the typing system for function calls in particular.

It would be nice if it would tell you what expected signature was, what the value of i was so you know which parameter went wrong, and what the actual type passed in was, as well as what was expected. You can get this information yourself but it is a real pain.

- Curtis


On Jun 3, 2010, at 7:36 PM, Yuri wrote:

> When for example some call is wrong error message always looks like this:
> Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) == 
> Params[i]->getType()) && "Calling a function with a bad signature!"), 
> function init, file /tmp/llvm-svn/llvm/lib/VMCore/Instructions.cpp, line 
> 247.
> 
> I believe assert() statements should better be replaced with more 
> detailed printouts of what is wrong. This will save many people a lot of 
> debugging time.
> 
> Yuri
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list