Files
llvm/lib/Support
Thomas Preud'homme 2c032d2797 Regex: Make "match" and "sub" const member functions
Summary:
The Regex "match" and "sub" member functions were previously not "const"
because they wrote to the "error" member variable. This commit removes
those assignments, and instead assumes that the validity of the regex
is already known after the initial compilation of the regular
expression. As a result, these member functions were possible to make
"const". This makes it easier to do things like pre-compile Regexes
up-front, and makes "match" and "sub" thread-safe. The error status is
now returned as an optional output, which also makes the API of "match"
and "sub" more consistent with each other.

Also, some uses of Regex that could be refactored to be const were made const.

Patch by Nicolas Guillemot

Reviewers: jankratochvil, thopre

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67241

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372764 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-24 14:42:36 +00:00
..
2019-04-08 12:31:12 +00:00
2019-04-27 15:33:22 +00:00
2019-09-20 23:04:45 +00:00
2019-08-06 15:46:45 +00:00
2009-09-06 12:26:28 +00:00
2018-07-30 19:41:25 +00:00
2019-08-15 10:05:22 +00:00
2019-04-23 14:51:27 +00:00
2019-07-09 18:10:06 +00:00