llvm/unittests
Eli Bendersky 6b731486d4 Add backreference matching capabilities to Support/Regex, with
appropriate unit tests. This change in itself is not expected to
affect any functionality at this point, but it will serve as a
stepping stone to improve FileCheck's variable matching capabilities.

Luckily, our regex implementation already supports backreferences,
although a bit of hacking is required to enable it. It supports both
Basic Regular Expressions (BREs) and Extended Regular Expressions
(EREs), without supporting backrefs for EREs, following POSIX strictly
in this respect. And EREs is what we actually use (rightly). This is
contrary to many implementations (including the default on Linux) of
POSIX regexes, that do allow backrefs in EREs.

Adding backref support to our EREs is a very simple change in the
regcomp parsing code. I fail to think of significant cases where it
would clash with existing things, and can bring more versatility to
the regexes we write. There's always the danger of a backref in a
specially crafted regex causing exponential matching times, but since
we mainly use them for testing purposes I don't think it's a big
problem. [it can also be placed behind a flag specific to FileCheck,
if needed].

For more details, see:

* http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-November/055840.html
* http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/156878.html



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168802 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 19:00:02 +00:00
..
ADT Drop the limitation to IEEE floating point types from the fdiv of pow2 -> fmul transform. 2012-11-08 13:58:10 +00:00
Analysis Fix includes of llvm files that used angle brackets. 2012-09-15 18:45:38 +00:00
Bitcode llvm/unittests: Simplify LINK_COMPONENTS. 2012-06-21 22:17:51 +00:00
ExecutionEngine Moving SectionMemoryManager into RuntimeDyld and adding unit tests for it. 2012-11-27 19:42:02 +00:00
Support Add backreference matching capabilities to Support/Regex, with 2012-11-28 19:00:02 +00:00
Transforms Remove unneeded and invalid SetInsertPoint calls from unittest. 2012-09-26 15:16:05 +00:00
VMCore Add a new function to ConstantExpr - getAsInstruction. This returns its Instruction* corollary, which may be useful if a user 2012-11-17 17:56:30 +00:00
CMakeLists.txt Completely refactor the structuring of unittest CMake files to match the 2012-06-21 09:51:26 +00:00
Makefile Undo the hack in r147427 and move this unittest to a better home. This 2012-01-02 09:19:48 +00:00
Makefile.unittest