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

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


arsenm added a comment.

Before submitting I noticed the test added in 9aff829f78331ef3718bf73ea81d319c91730808 is failing on the reference to self. The test looks like a mistake to me. The commit message suggests this could have been anything. I also don't understand the test, since it's linking a single IR file (Is it missing an input?)



================
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:
> 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
I couldn't come up with a test where this happened. We also tend to emit every verifier error possible 


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

https://reviews.llvm.org/D141315



More information about the llvm-commits mailing list