[LLVMdev] Verifier & abort()

Chris Lattner sabre at nondot.org
Thu Apr 1 21:16:02 PST 2004


On Thu, 1 Apr 2004, Reid Spencer wrote:

> compiler that doesn't fail verificiation, I'm also not perfect. So, I'd
> prefer it if there was a way to override this behavior.

Make sense.

> Would anyone mind if I changed the Verifier to allow installation of a
> failure handler function that defaults to abort()?  I would also like to
> change the verifier to print to an arbitrary iostream instead of always
> to std::cerr. This will help me capture the verifier's output and
> produce it to the user within an "ICE" message. Again, the default would
> be std::cerr so if you don't use the new api, the current behavior is
> retained.

I think that the best solution would be to print to a stringstream and
then throw the completed string as an exception.  The default verifier
pass would catch the exception, print it out, then call abort.  Your hooks
could do other things with the exception as you please.  Does this make
sense?

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list