]> granicus.if.org Git - llvm/commit
Extend SpecialCaseList to allow users to blame matches on entries in the file.
authorMitch Phillips <mitchphillips@outlook.com>
Tue, 7 Nov 2017 21:16:46 +0000 (21:16 +0000)
committerMitch Phillips <mitchphillips@outlook.com>
Tue, 7 Nov 2017 21:16:46 +0000 (21:16 +0000)
commit56fec39d44a4b10ddcb8963f636bd350abc892b0
tree7bc4258b94ce47b51d383d3bb3f5fd86394e8059
parentc062c8dc61df5d6c0e44cd69e14a304f222c4fe2
Extend SpecialCaseList to allow users to blame matches on entries in the file.

Summary:
Extends SCL functionality to allow users to find the line number in the file the SCL is built from through SpecialCaseList::inSectionBlame(...).

Also removes the need to compile the SCL before use. As the matcher now contains a list of regexes to test against instead of a single regex, the regexes can be individually built on each insertion rather than one large compilation at the end of construction.

This change also fixes a bug where blank lines would cause the parser to become out-of-sync with the line number. An error on line `k` was being reported as being on line `k - num_blank_lines_before_k`.

Note: This change has a cyclical dependency on D39486. Both these changes must be submitted at the same time to avoid a build breakage.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: kcc, pcc, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317617 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/SpecialCaseList.h
lib/Support/SpecialCaseList.cpp
unittests/Support/SpecialCaseListTest.cpp