1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/lib/Passes
Thomas Preud'homme df284c0ecf 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
2019-09-24 14:42:36 +00:00
..
CMakeLists.txt [New PM][PassInstrumentation] IR printing support for New Pass Manager 2018-09-24 16:08:15 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PassBuilder.cpp Regex: Make "match" and "sub" const member functions 2019-09-24 14:42:36 +00:00
PassPlugin.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PassRegistry.def Data Dependence Graph Basics 2019-09-18 17:43:45 +00:00
StandardInstrumentations.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00