[clang] [dataflow] Parse formulas from text (PR #66424)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 05:55:21 PDT 2023


================
@@ -95,4 +98,94 @@ BoolValue &Arena::makeBoolValue(const Formula &F) {
   return *It->second;
 }
 
+namespace {
+const Formula *parse(Arena &A, llvm::StringRef &In) {
+  auto EatWhitespace = [&] { In = In.ltrim(' '); };
----------------
martinboehme wrote:

```suggestion
  auto EatWhitespace = [&] { In = In.ltrim(); };
```

I think you initially thought you shouldn't eat newlines here, but AFAICT, this isn't an issue because `parseAll()` below splits lines before it ever calls this.

Alternatively, if you really do want to eat only spaces here, I'd suggest renaming this `EatSpaces`.

https://github.com/llvm/llvm-project/pull/66424


More information about the cfe-commits mailing list