LLVM
23.0.0git
lib
Target
WebAssembly
Utils
WasmAddressSpaces.h
Go to the documentation of this file.
1
//===--- llvm/CodeGen/WasmAddressSpaces.h -----------------------*- 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
//
9
// Address Spaces for WebAssembly Type Handling
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_UTILS_WASMADDRESSSPACES_H
14
#define LLVM_LIB_TARGET_WEBASSEMBLY_UTILS_WASMADDRESSSPACES_H
15
16
namespace
llvm
{
17
18
namespace
WebAssembly
{
19
20
enum
WasmAddressSpace
:
unsigned
{
21
// Default address space, for pointers to linear memory (stack, heap, data).
22
WASM_ADDRESS_SPACE_DEFAULT
= 0,
23
// A non-integral address space for pointers to named objects outside of
24
// linear memory: WebAssembly globals or WebAssembly locals. Loads and stores
25
// to these pointers are lowered to global.get / global.set or local.get /
26
// local.set, as appropriate.
27
WASM_ADDRESS_SPACE_VAR
= 1
28
};
29
30
inline
bool
isDefaultAddressSpace
(
unsigned
AS) {
31
return
AS ==
WASM_ADDRESS_SPACE_DEFAULT
;
32
}
33
inline
bool
isWasmVarAddressSpace
(
unsigned
AS) {
34
return
AS ==
WASM_ADDRESS_SPACE_VAR
;
35
}
36
inline
bool
isValidAddressSpace
(
unsigned
AS) {
37
return
isDefaultAddressSpace
(AS) ||
isWasmVarAddressSpace
(AS);
38
}
39
40
}
// namespace WebAssembly
41
42
}
// namespace llvm
43
44
#endif
// LLVM_LIB_TARGET_WEBASSEMBLY_UTILS_WASMADDRESSSPACES_H
llvm::WebAssembly
Definition
WasmEHInfo.h:18
llvm::WebAssembly::isDefaultAddressSpace
bool isDefaultAddressSpace(unsigned AS)
Definition
WasmAddressSpaces.h:30
llvm::WebAssembly::WasmAddressSpace
WasmAddressSpace
Definition
WasmAddressSpaces.h:20
llvm::WebAssembly::WASM_ADDRESS_SPACE_DEFAULT
@ WASM_ADDRESS_SPACE_DEFAULT
Definition
WasmAddressSpaces.h:22
llvm::WebAssembly::WASM_ADDRESS_SPACE_VAR
@ WASM_ADDRESS_SPACE_VAR
Definition
WasmAddressSpaces.h:27
llvm::WebAssembly::isValidAddressSpace
bool isValidAddressSpace(unsigned AS)
Definition
WasmAddressSpaces.h:36
llvm::WebAssembly::isWasmVarAddressSpace
bool isWasmVarAddressSpace(unsigned AS)
Definition
WasmAddressSpaces.h:33
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
FunctionInfo.h:25
Generated on
for LLVM by
1.14.0