[PATCH] D68054: Regex: Add static convenience functions for "match" and "sub"

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 13:11:17 PST 2020


thopre added a comment.

In D68054#1806142 <https://reviews.llvm.org/D68054#1806142>, @nlguillemot wrote:

> In D68054#1801066 <https://reviews.llvm.org/D68054#1801066>, @thopre wrote:
>
> > How about the following commit message:
> >
> > (...)
>
>
> I would suggest an amendment to this part:
>
> > To force developers to be mindful of this aspect, an assert is added to match() to check
> >  that the regex is valid and an new idiom is created as follows for
> >  cases where the pattern is known to be valid:
>
> As-is, this patch doesn't assert inside `match()`, since this makes the API more backwards compatible. The wording of the commit message should be updated to match this.
>
> It was originally a bit tricky to track down and update all users of the API, but the monorepo makes that a lot easier. If we brought back the older version of the commit that *did* `assert` inside `match()`, and we updated all affected users of the API (eg: clang) before committing, I wouldn't be opposed.


Yes I think it should be done otherwise the change does not bring benefit besides an API familiarity to users of other languages (since it's not more concise and does not help catch errors).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68054/new/

https://reviews.llvm.org/D68054





More information about the llvm-commits mailing list