[PATCH] D117448: [NFC][SDNode] Use `StringSwitch` instead of `if`

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 16 19:01:27 PST 2022


craig.topper added inline comments.


================
Comment at: llvm/utils/TableGen/SDNodeProperties.cpp:31
+                           .Case("SDNPVariadic", SDNPVariadic);
+    if (!Properties)
       PrintFatalError(R->getLoc(), "Unknown SD Node property '" +
----------------
This won't report the error correctly if there are two properties and the first one is known but the second isn't. `Properties` will be non-zero after the first property so the second property won't be able to trigger an error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117448



More information about the llvm-commits mailing list