diff options
author | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-09-24 14:42:36 +0000 |
---|---|---|
committer | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-09-24 14:42:36 +0000 |
commit | 5f738940b552fe22ca0850981c55279da8e7527d (patch) | |
tree | 573211606034b47838be7fb3ae59cf69c6049531 /llvm/lib/TextAPI/MachO/TextStubCommon.cpp | |
parent | 5a4355324e1bb5cf6acc5f8b54349184b98eb60a (diff) | |
download | bcm5719-llvm-5f738940b552fe22ca0850981c55279da8e7527d.tar.gz bcm5719-llvm-5f738940b552fe22ca0850981c55279da8e7527d.zip |
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
llvm-svn: 372764
Diffstat (limited to 'llvm/lib/TextAPI/MachO/TextStubCommon.cpp')
0 files changed, 0 insertions, 0 deletions