[PATCH] D102450: [OpaquePtr] Make loads and stores work with opaque pointers

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 17:44:26 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/lib/AsmParser/LLParser.cpp:7533-7534
     return error(Loc, "store operand must be a first class value");
-  if (cast<PointerType>(Ptr->getType())->getElementType() != Val->getType())
+  if (!cast<PointerType>(Ptr->getType())->isOpaque() &&
+      cast<PointerType>(Ptr->getType())->getElementType() != Val->getType())
     return error(Loc, "stored value and pointer type do not match");
----------------
Reckon there's anything we could do to generalize these sort of tests - if we're going to add a whole bunch of them through this migration (& then remove them once we've moved over to opaque pointer types), maybe there are some good primitives we could create?

Like "hasElementTypeOrOpaque(PtrType, PointeeType)"?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102450



More information about the llvm-commits mailing list