[PATCH] D139010: [clang][WebAssembly] Implement support for table types and builtins
Thomas Lively via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 17 12:57:09 PDT 2023
tlively added a comment.
It looks like the LLVM-side changes are generally moving Wasm type classification functions to a more global location. Since no other backend should care about these things, it would be better if we could get away without these changes.
================
Comment at: llvm/include/llvm/IR/Type.h:23
#include "llvm/Support/TypeSize.h"
+#include "llvm/CodeGen/WasmAddressSpaces.h"
#include <cassert>
----------------
I don't know if things in IR are supposed to depend on things in CodeGen. Is there precedent here?
================
Comment at: llvm/include/llvm/IR/Type.h:220-232
+ bool isWebAssemblyReferenceType() const { return isWebAssemblyExternrefType() || isWebAssemblyFuncrefType(); }
+
+ /// Return true if this is a WebAssembly Externref Type.
+ bool isWebAssemblyExternrefType() const {
+ return getPointerAddressSpace() ==
+ WebAssembly::WasmAddressSpace::WASM_ADDRESS_SPACE_EXTERNREF;
+ }
----------------
Do these need to be in Type.h? If not, it would be good to keep them in a more Wasm-specific location.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139010/new/
https://reviews.llvm.org/D139010
More information about the llvm-commits
mailing list