[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:27:46 PDT 2021


dexonsmith added inline comments.


================
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; }
+
----------------
dexonsmith wrote:
> 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).
Actually, git-grep can't come up with any examples of the more verbose pattern anymore... looks like @nikic cleaned them all up.


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