[PATCH] D104309: [OpaquePtr] Verify Opaque pointer in function parameter

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 10:22:55 PDT 2021


aeubanks added a comment.

can you add some negative tests for this? e.g. make sure you see the proper message for something like

  call void @f(ptr inalloca(%somenotsizedtype) %a)

there are some negative verifier tests in llvm/test/Verifier, search `RUN: not opt`



================
Comment at: llvm/lib/IR/Verifier.cpp:1860
+    } else {
+      SmallPtrSet<Type *, 4> Visited;
+      if (!PTy->getElementType()->isSized(&Visited)) {
----------------
we still need a `Visited` in the new code to account for recursive types

we can delete the checks below for `isSized()` and always use your new code, then only check that the pointee type and inalloca/etc type match for non-opaque pointers


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104309



More information about the llvm-commits mailing list