[PATCH] D141315: Verifier: Add checks for associated metadata

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 17:01:56 PST 2023


arsenm added inline comments.


================
Comment at: llvm/lib/IR/Verifier.cpp:664
+      const auto *VM = dyn_cast_or_null<ValueAsMetadata>(Op);
+      Check(VM, "associated metadata must be ValueAsMetadata", GO, Associated);
+      if (VM) {
----------------
arsenm wrote:
> eugenis wrote:
> > It looks like the `!{null}` case will print both "must have a global value" and "must be ValueAsMetadata". We probably want just the first one.
> Looking at the test, it doesn't actually hit this one. I'm not actually sure how to construct a not-ValueAsMetadata that would reach here with text IR
Oh, I can just use a string here


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

https://reviews.llvm.org/D141315



More information about the llvm-commits mailing list