//===------ SemaWasm.cpp ---- WebAssembly target-specific routines --------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements semantic analysis functions specific to WebAssembly. // //===----------------------------------------------------------------------===// #include "clang/Sema/SemaWasm.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/Type.h" #include "clang/Basic/AddressSpaces.h" #include "clang/Basic/DiagnosticSema.h" #include "clang/Basic/TargetBuiltins.h" #include "clang/Sema/Attr.h" #include "clang/Sema/Sema.h" namespace clang { SemaWasm::SemaWasm(Sema &S) : … { … } /// Checks the argument at the given index is a WebAssembly table and if it /// is, sets ElTy to the element type. static bool CheckWasmBuiltinArgIsTable(Sema &S, CallExpr *E, unsigned ArgIndex, QualType &ElTy) { … } /// Checks the argument at the given index is an integer. static bool CheckWasmBuiltinArgIsInteger(Sema &S, CallExpr *E, unsigned ArgIndex) { … } bool SemaWasm::BuiltinWasmRefNullExtern(CallExpr *TheCall) { … } bool SemaWasm::BuiltinWasmRefNullFunc(CallExpr *TheCall) { … } /// Check that the first argument is a WebAssembly table, and the second /// is an index to use as index into the table. bool SemaWasm::BuiltinWasmTableGet(CallExpr *TheCall) { … } /// Check that the first argumnet is a WebAssembly table, the second is /// an index to use as index into the table and the third is the reference /// type to set into the table. bool SemaWasm::BuiltinWasmTableSet(CallExpr *TheCall) { … } /// Check that the argument is a WebAssembly table. bool SemaWasm::BuiltinWasmTableSize(CallExpr *TheCall) { … } /// Check that the first argument is a WebAssembly table, the second is the /// value to use for new elements (of a type matching the table type), the /// third value is an integer. bool SemaWasm::BuiltinWasmTableGrow(CallExpr *TheCall) { … } /// Check that the first argument is a WebAssembly table, the second is an /// integer, the third is the value to use to fill the table (of a type /// matching the table type), and the fourth is an integer. bool SemaWasm::BuiltinWasmTableFill(CallExpr *TheCall) { … } /// Check that the first argument is a WebAssembly table, the second is also a /// WebAssembly table (of the same element type), and the third to fifth /// arguments are integers. bool SemaWasm::BuiltinWasmTableCopy(CallExpr *TheCall) { … } bool SemaWasm::CheckWebAssemblyBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall) { … } WebAssemblyImportModuleAttr * SemaWasm::mergeImportModuleAttr(Decl *D, const WebAssemblyImportModuleAttr &AL) { … } WebAssemblyImportNameAttr * SemaWasm::mergeImportNameAttr(Decl *D, const WebAssemblyImportNameAttr &AL) { … } void SemaWasm::handleWebAssemblyImportModuleAttr(Decl *D, const ParsedAttr &AL) { … } void SemaWasm::handleWebAssemblyImportNameAttr(Decl *D, const ParsedAttr &AL) { … } void SemaWasm::handleWebAssemblyExportNameAttr(Decl *D, const ParsedAttr &AL) { … } } // namespace clang