clang  20.0.0git
SemaWasm.h
Go to the documentation of this file.
1 //===----- SemaWasm.h ------ Wasm target-specific routines ----*- C++ -*---===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 /// \file
9 /// This file declares semantic analysis functions specific to Wasm.
10 ///
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_SEMA_SEMAWASM_H
14 #define LLVM_CLANG_SEMA_SEMAWASM_H
15 
16 #include "clang/AST/ASTFwd.h"
17 #include "clang/Sema/SemaBase.h"
18 
19 namespace clang {
20 class ParsedAttr;
21 class TargetInfo;
22 
23 class SemaWasm : public SemaBase {
24 public:
25  SemaWasm(Sema &S);
26 
28  unsigned BuiltinID,
29  CallExpr *TheCall);
30 
31  bool BuiltinWasmRefNullExtern(CallExpr *TheCall);
32  bool BuiltinWasmRefNullFunc(CallExpr *TheCall);
33  bool BuiltinWasmTableGet(CallExpr *TheCall);
34  bool BuiltinWasmTableSet(CallExpr *TheCall);
35  bool BuiltinWasmTableSize(CallExpr *TheCall);
36  bool BuiltinWasmTableGrow(CallExpr *TheCall);
37  bool BuiltinWasmTableFill(CallExpr *TheCall);
38  bool BuiltinWasmTableCopy(CallExpr *TheCall);
39 
40  WebAssemblyImportNameAttr *
41  mergeImportNameAttr(Decl *D, const WebAssemblyImportNameAttr &AL);
42  WebAssemblyImportModuleAttr *
43  mergeImportModuleAttr(Decl *D, const WebAssemblyImportModuleAttr &AL);
44 
48 };
49 } // namespace clang
50 
51 #endif // LLVM_CLANG_SEMA_SEMAWASM_H
Forward declaration of all AST node types.
const Decl * D
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2882
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:129
void handleWebAssemblyImportNameAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaWasm.cpp:302
bool BuiltinWasmRefNullExtern(CallExpr *TheCall)
Definition: SemaWasm.cpp:54
bool CheckWebAssemblyBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaWasm.cpp:219
bool BuiltinWasmTableGet(CallExpr *TheCall)
Check that the first argument is a WebAssembly table, and the second is an index to use as index into...
Definition: SemaWasm.cpp:86
bool BuiltinWasmTableFill(CallExpr *TheCall)
Check that the first argument is a WebAssembly table, the second is an integer, the third is the valu...
Definition: SemaWasm.cpp:165
bool BuiltinWasmTableSize(CallExpr *TheCall)
Check that the argument is a WebAssembly table.
Definition: SemaWasm.cpp:127
void handleWebAssemblyImportModuleAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaWasm.cpp:285
bool BuiltinWasmRefNullFunc(CallExpr *TheCall)
Definition: SemaWasm.cpp:63
bool BuiltinWasmTableSet(CallExpr *TheCall)
Check that the first argumnet is a WebAssembly table, the second is an index to use as index into the...
Definition: SemaWasm.cpp:109
SemaWasm(Sema &S)
Definition: SemaWasm.cpp:25
void handleWebAssemblyExportNameAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaWasm.cpp:318
WebAssemblyImportNameAttr * mergeImportNameAttr(Decl *D, const WebAssemblyImportNameAttr &AL)
Definition: SemaWasm.cpp:266
WebAssemblyImportModuleAttr * mergeImportModuleAttr(Decl *D, const WebAssemblyImportModuleAttr &AL)
Definition: SemaWasm.cpp:245
bool BuiltinWasmTableGrow(CallExpr *TheCall)
Check that the first argument is a WebAssembly table, the second is the value to use for new elements...
Definition: SemaWasm.cpp:141
bool BuiltinWasmTableCopy(CallExpr *TheCall)
Check that the first argument is a WebAssembly table, the second is also a WebAssembly table (of the ...
Definition: SemaWasm.cpp:192
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:493
Exposes information about the current target.
Definition: TargetInfo.h:218
The JSON file list parser is used to communicate input to InstallAPI.