[clang][WebAssembly] Initial support for reference type externref in clang
authorPaulo Matos <pmatos@igalia.com>
Mon, 9 Jan 2023 14:15:12 +0000 (15:15 +0100)
committerPaulo Matos <pmatos@igalia.com>
Tue, 31 Jan 2023 16:34:01 +0000 (17:34 +0100)
commiteb66833d19573df97034a81279eda31b8d19815b
treefd42f2041cac031d7c0778cde3016a644b618e2d
parent48b5a06dfcab12cf093a1a3df42cb5b684e2be4c
[clang][WebAssembly] Initial support for reference type externref in clang

This patch introduces a new type __externref_t that denotes a WebAssembly opaque
reference type. It also implements builtin __builtin_wasm_ref_null_extern(),
that returns a null value of __externref_t. This lays the ground work
for further builtins and reference types.

Differential Revision: https://reviews.llvm.org/D122215
47 files changed:
clang/include/clang/AST/ASTContext.h
clang/include/clang/AST/Type.h
clang/include/clang/AST/TypeProperties.td
clang/include/clang/Basic/BuiltinsWebAssembly.def
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Basic/WebAssemblyReferenceTypes.def [new file with mode: 0644]
clang/include/clang/Sema/Sema.h
clang/include/clang/Serialization/ASTBitCodes.h
clang/include/clang/module.modulemap
clang/lib/AST/ASTContext.cpp
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/ExprConstant.cpp
clang/lib/AST/ItaniumMangle.cpp
clang/lib/AST/MicrosoftMangle.cpp
clang/lib/AST/NSAPI.cpp
clang/lib/AST/PrintfFormatString.cpp
clang/lib/AST/Type.cpp
clang/lib/AST/TypeLoc.cpp
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/lib/CodeGen/CodeGenTypes.cpp
clang/lib/CodeGen/ItaniumCXXABI.cpp
clang/lib/CodeGen/TargetInfo.cpp
clang/lib/CodeGen/TargetInfo.h
clang/lib/Index/USRGeneration.cpp
clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaType.cpp
clang/lib/Serialization/ASTCommon.cpp
clang/lib/Serialization/ASTReader.cpp
clang/test/CodeGen/WebAssembly/wasm-externref.c [new file with mode: 0644]
clang/test/CodeGen/builtins-wasm.c
clang/test/CodeGenCXX/wasm-reftypes-mangle.cpp [new file with mode: 0644]
clang/test/CodeGenCXX/wasm-reftypes-typeinfo.cpp [new file with mode: 0644]
clang/test/Sema/wasm-refs.c [new file with mode: 0644]
clang/test/SemaCXX/wasm-refs.cpp [new file with mode: 0644]
clang/test/SemaTemplate/address_space-dependent.cpp
clang/tools/libclang/CIndex.cpp
llvm/include/llvm/IR/Type.h
llvm/include/llvm/Transforms/Utils.h
llvm/lib/CodeGen/ValueTypes.cpp
llvm/lib/IR/Type.cpp
llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
llvm/lib/Transforms/Utils/Mem2Reg.cpp