[PATCH] D122215: [WebAssembly] Initial support for reference type externref in clang

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 09:53:37 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/AST/Type.h:1972-1973
+  /// Check if this is a WebAssembly Reference Type.
+  bool isWebAssemblyReferenceType() const;
+  bool isWebAssemblyExternrefType() const;
   /// Determines if this is a sizeless type supported by the
----------------
pmatos wrote:
> aaron.ballman wrote:
> > It's unfortunate to name this with `ReferenceType` given that we already have a considerable number of APIs that assume "reference type" to mean `&` or `&&`. We run into similar problems with "pointer type" and objective-c pointers.
> > 
> > Basically, I worry we're setting ourselves up for another `isObjCObjectPointerType()`/`isPointerType()` situation.
> I understand this concern. However, unsure what else to call it given that's what it is. It's a WebAssembly Reference Type, which indeed is different from a C/C++ ReferenceType. Could call it OpaqueType but that would be even worse. Not only it's not called an opaque type in Wasm, it's also not what LLVM users will think of as Opaque Types.
Yeah, I think this is as good of a name as we're likely to find; I certainly haven't thought of something better. If we do think of something later, we can refactor then.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122215



More information about the llvm-commits mailing list