[PATCH] D136656: [IR Verifier] didn't check if switch case is constant, align IR Verifier's check with LLParser.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 19:31:29 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/IR/Verifier.cpp:2882
   for (auto &Case : SI.cases()) {
+    Check(isa<ConstantInt>(SI.getOperand(Case.getCaseIndex() * 2 + 2)),
+          "Case value is not a constant integer.", &SI);
----------------
Is this missing a check for a consistent number of operands, or is that hidden somewhere else?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136656



More information about the llvm-commits mailing list