[PATCH] D104938: OpaquePtr: Reject 'ptr*' again when parsing textual IR

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 25 15:23:34 PDT 2021


dexonsmith added a comment.

Thanks for both reviews! Landed in 4506f614cb6983a16d117cf77a968608e66d7a5c <https://reviews.llvm.org/rG4506f614cb6983a16d117cf77a968608e66d7a5c>.

In D104938#2841449 <https://reviews.llvm.org/D104938#2841449>, @nikic wrote:

> LGTM -- looks like we had a bit of race condition, I just committed ad4bb8280952c2cacf497e30560ee94c119b36e0 <https://reviews.llvm.org/rGad4bb8280952c2cacf497e30560ee94c119b36e0> in preparation for doing the same change...

Yeah, sorry about that / thanks; after I left the other review I realized it was easy enough for me to pitch in here :).



================
Comment at: llvm/include/llvm/IR/Type.h:231
+  /// True if this is an instance of PointerType that's opaque.
+  bool isOpaquePointerTy() const { return isPointerTy() && !NumContainedTys; }
+
----------------
aeubanks wrote:
> I have a mild preference to not add these one off sort of methods when we already have lots of code that does `isa<PointerType> && cast<PointerType>(Ty)->isOpaque()`
Agreed it shouldn't be a one off, was surprised it hadn't been added yet though... I'll see if I can find time to clean up the existing boilerplate instances to use this helper (note that @nikic already added it).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104938



More information about the llvm-commits mailing list