[LLVMdev] error api for APInt / APFloat

Erick Tryzelaar idadesub at users.sourceforge.net
Wed Aug 19 23:19:09 PDT 2009


On Wed, Aug 19, 2009 at 11:08 PM, Chris Lattner<clattner at apple.com> wrote:
>
> As we discussed on IRC, I don't think there is any reason for the
> implementation of these methods to check these invariants.  These are clear
> API invariants that the caller can check if needbe.  Making the
> implementation check these will slow down clients which are known to be well
> formed.  I didn't look at all of the things you listed, perhaps some other
> ones would make some more to be recoverable errors.

By that logic, I think it's safe to say then to say that it's an
invariant of APInt and APFloat to pass in a well formed string, and
that it's the client's responsibility to make sure that the string
isn't invalid. Which then follows that the assertions checking the
validity of the string should stay.

I'm happy with that decision if you are.




More information about the llvm-dev mailing list