[all-commits] [llvm/llvm-project] 55aeb2: [clang][WebAssembly] Implement support for table t...

Paulo Matos via All-commits all-commits at lists.llvm.org
Sat Jun 10 06:53:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 55aeb23fe0084d930ecd7335092d712bd71694c7
      https://github.com/llvm/llvm-project/commit/55aeb23fe0084d930ecd7335092d712bd71694c7
  Author: Paulo Matos <pmatos at igalia.com>
  Date:   2023-06-10 (Sat, 10 Jun 2023)

  Changed paths:
    M clang/docs/LanguageExtensions.rst
    M clang/include/clang/AST/Type.h
    M clang/include/clang/Basic/BuiltinsWebAssembly.def
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/Type.cpp
    M clang/lib/Basic/Targets/WebAssembly.cpp
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/Sema/SemaCast.cpp
    M clang/lib/Sema/SemaChecking.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExceptionSpec.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaStmt.cpp
    M clang/lib/Sema/SemaType.cpp
    A clang/test/CodeGen/WebAssembly/builtins-table.c
    A clang/test/Sema/builtins-wasm.c
    A clang/test/Sema/wasm-refs-and-table-ped.c
    A clang/test/Sema/wasm-refs-and-tables.c
    R clang/test/Sema/wasm-refs.c
    A clang/test/SemaCXX/wasm-refs-and-tables.cpp
    R clang/test/SemaCXX/wasm-refs.cpp
    A llvm/include/llvm/CodeGen/WasmAddressSpaces.h
    M llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.cpp
    M llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h
    M llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyLowerRefTypesIntPtrConv.cpp

  Log Message:
  -----------
  [clang][WebAssembly] Implement support for table types and builtins

This commit implements support for WebAssembly table types and
respective builtins. Table tables are WebAssembly objects to store
reference types. They have a large amount of semantic restrictions
including, but not limited to, only being allowed to be declared
at the top-level as static arrays of zero-length. Not being arguments
or result of functions, not being stored ot memory, etc.

This commit introduces the __attribute__((wasm_table)) to attach to
arrays of WebAssembly reference types. And the following builtins to
manage tables:

* ref   __builtin_wasm_table_get(table, idx)
* void  __builtin_wasm_table_set(table, idx, ref)
* uint  __builtin_wasm_table_size(table)
* uint  __builtin_wasm_table_grow(table, ref, uint)
* void  __builtin_wasm_table_fill(table, idx, ref, uint)
* void  __builtin_wasm_table_copy(table, table, uint, uint, uint)

This commit also enables reference-types feature at bleeding-edge.

This is joint work with Alex Bradbury (@asb).

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D139010




More information about the All-commits mailing list