[PATCH] D86222: Fix PR46880: Fail CHECK-NOT with undefined variable

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 01:09:55 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/lib/Support/FileCheck.cpp:2014
+  // the next line.
+  Buffer = Buffer.substr(Buffer.find_first_not_of(" \t\n\r"));
+  FileCheckDiag::MatchType MatchTy = FileCheckDiag::MatchError;
----------------
thopre wrote:
> jhenderson wrote:
> > This might be a dumb question, but I'm not following why we're skipping '\t' and ' ' here. It certainly doesn't line up with the comment above.
> I'm not sure, this is copied over from PrintNoMatch. I thought it is used so that the "scanning from here" shows the first non blank line after last match but I haven't looked in details.
Could you investigate a bit more and then update the comment with your findings? This code at the moment also skips some whitespace, which isn't always desirable (imagine if you had a regex match looking for some explicit whitespace before some string).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86222/new/

https://reviews.llvm.org/D86222



More information about the llvm-commits mailing list