projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
27f400c
)
Pre-allocate space for results from a regex match that uses 3 match strings.
author
MLIR Team
<no-reply@google.com>
Thu, 10 Oct 2019 02:57:02 +0000
(19:57 -0700)
committer
A. Unique TensorFlower
<gardener@tensorflow.org>
Thu, 10 Oct 2019 03:07:46 +0000
(20:07 -0700)
That space is 4 StringRefs, not 3, because element 0 of the match always
contains the entire source string.
PiperOrigin-RevId:
273875606
mlir/lib/IR/Diagnostics.cpp
patch
|
blob
|
history
diff --git
a/mlir/lib/IR/Diagnostics.cpp
b/mlir/lib/IR/Diagnostics.cpp
index
b13db11
..
edd67d7
100644
(file)
--- a/
mlir/lib/IR/Diagnostics.cpp
+++ b/
mlir/lib/IR/Diagnostics.cpp
@@
-594,7
+594,7
@@
SourceMgrDiagnosticVerifierHandlerImpl::computeExpectedDiags(
SmallVector<StringRef, 100> lines;
buf->getBuffer().split(lines, '\n');
for (unsigned lineNo = 0, e = lines.size(); lineNo < e; ++lineNo) {
- SmallVector<StringRef,
3
> matches;
+ SmallVector<StringRef,
4
> matches;
if (!expected.match(lines[lineNo], &matches))
continue;
// Point to the start of expected-*.