[PATCH] D20811: [analyzer] Model some library functions

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 16 09:35:31 PDT 2016


NoQ added a comment.

In https://reviews.llvm.org/D20811#544927, @dcoughlin wrote:

> That said, now that I look at it with 'POSTCONDITION' alone I don't think it is clear that the provided value describes the return value. What do you think about renaming it 'RETURN_VALUE'? Or adding back the RET_VAL I asked you about removing before? :-)


Hmm, what about

  CONSTRAIN
    ARGUMENT_VALUE(0, WithinRange)
      RANGE('0', '9')
      RANGE('A', 'Z')
      RANGE('a', 'z')
    END_ARGUMENT_VALUE
    RETURN_VALUE(OutOfRange)
      VALUE(0)
    END_RETURN_VALUE
  END_CONSTRAIN

?

Something i don't like here is that the word "value" is overloaded. Maybe rename the inner `VALUE` back to `POINT`?

In https://reviews.llvm.org/D20811#544927, @dcoughlin wrote:

> Also: do you think CONDITION_KIND is needed? in PRECONDITION? Or can the bare kind be used like in POSTCONDITION?


I agree that it's ok to use the bare kind, because it's quite self-explanatory.


https://reviews.llvm.org/D20811





More information about the cfe-commits mailing list