[LLVMdev] aborting on invalid code

Chris Lattner clattner at apple.com
Sat Oct 11 15:13:46 PDT 2008

Please use subjects that have something to do with the content, this  
discussion has nothing to do with 2.4

On Oct 11, 2008, at 1:01 PM, OvermindDL1 wrote:

> On Sat, Oct 11, 2008 at 1:24 PM, Kenneth Boyd <zaimoni at zaimoni.com>  
> wrote:
>> /* snip */
> Actually, my biggest issue with llvm (which highly impacts testing as
> well) is the use of abort()...

>  I cannot have llvm abort()ing on
> some bad passed in code

There are better solutions to that: 1) ensure you don't ever pass the  
llvm backend invalid code, and 2) use the llvm IR verifier to reject  
code before sending it to the backend.

> Which makes me curious, if I submitted a patch that got rid of llvms
> use of abort()s all over the place, and replaces them with exceptions
> what is the
> chance it would be accepted,

There is no chance, we worked hard to eliminate exceptions and are  
aiming to eliminate the last couple remnants of RTTI.  Sending invalid  
code into the backend is violating a very important invariant in the  
API.  I don't see how it would be any different then passing in a null  
pointer or garbage pointer into an API that would then bus error.


More information about the llvm-dev mailing list