[PATCH] D27318: Support escaping in TrigramIndex.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 12:36:13 PST 2016


pcc added inline comments.


================
Comment at: lib/Support/TrigramIndex.cpp:59-68
+      switch (Char) {
+        // Decimal escapes are backreferences. Note that \0 is only
+        // a backreference when replacing, so it's excluded.
+        case '1': case '2': case '3': case '4':
+        case '5': case '6': case '7': case '8': case '9':
+          Defeated = true;
+          return;
----------------
Perhaps more simply:
```
if (Escaped && Char >= '1' && Char <= '9') {
  Defeated = true;
  return;
}
```


https://reviews.llvm.org/D27318





More information about the llvm-commits mailing list