[PATCH] D128440: [WebAssembly] Initial support for reference type funcref in clang

Paulo Matos via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 08:31:22 PST 2023


pmatos marked 4 inline comments as done.
pmatos added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:6696
+bool Sema::BuiltinWasmRefNullFunc(CallExpr *TheCall) {
+  if (TheCall->getNumArgs() != 0)
+    return true;
----------------
erichkeane wrote:
> Does this diagnose?  Should we be emitting an error here?
I think it makes sense. Will add a test as well for the diagnostic.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:6557-6561
+  // Therefore we need to change the types of the DeclRefExpr (stored in FDecl)
+  // and regenerate a straight up CallExpr on the modified FDecl.
+  // returning
+  // CallExpr
+  // `- FunctionDecl
----------------
aaron.ballman wrote:
> Why would we need to do this?? And what do we do when there is no `FunctionDecl` to get back to (because it's a call expression through a function pointer, for example)?
I have added a test to check this situation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128440



More information about the cfe-commits mailing list