[LLVMdev] Integer questions

Dan Gohman gohman at apple.com
Mon Sep 8 17:59:16 PDT 2008


On Sep 8, 2008, at 4:30 PM, OvermindDL1 wrote:

>> The Verifier pass is recommended; it catches a lot of
>> invalid stuff and be configured to abort, print an error to
>> stderr, or return an error status and message string.
>>
>> It doesn't catch everything though; codegen's error
>> handling today is usually an assertion failure, assuming
>> assertions are enabled.
>
> Was looking through some other code in LLVM, I noticed an abort(), how
> often do those occur as they would be *really* bad to occur in my
> circumstances (the couple I saw were in the JIT class) as catching the
> abort signal may not always be possible depending on the hosts code.
>
> Will the verifier catch things like integers that are too big for the
> platform that I am currently on, or will that be done by something
> like the JIT when it compiles it?

No, the verifier currently does not know about target-specific
codegen limitations.


>
> And yea, assertions are a very large "no" in this library, especially
> since bad code will probably happen very often

Patches to do the kind of checking you're asking about would be
welcome :-). I don't think it makes sense to extend the
Verifier itself here; it's supposed to accept any valid LLVM IR.
I think a separate CodeGenVerifier might be a good approach
though, or possibly extending codegen itself with the ability to
interrupt itself and yield some kind of error status.

Dan




More information about the llvm-dev mailing list