LLVM: include/llvm/MC/MCSymbolWasm.h Source File (original) (raw)
1
2
3
4
5
6
7
8#ifndef LLVM_MC_MCSYMBOLWASM_H
9#define LLVM_MC_MCSYMBOLWASM_H
10
14
15namespace llvm {
16
18 std::optionalwasm::WasmSymbolType Type;
19 bool IsWeak = false;
20 bool IsHidden = false;
21 bool IsComdat = false;
22 bool OmitFromLinkingSection = false;
23 mutable bool IsUsedInInitArray = false;
24 mutable bool IsUsedInGOT = false;
25 std::optional ImportModule;
26 std::optional ImportName;
27 std::optional ExportName;
29 std::optionalwasm::WasmGlobalType GlobalType;
30 std::optionalwasm::WasmTableType TableType;
31
32
33
34 const MCExpr *SymbolSize = nullptr;
35
36public:
39
44
46
52
53 std::optionalwasm::WasmSymbolType getType() const { return Type; }
54
56
63
70
75
76 bool isWeak() const { return IsWeak; }
78
79 bool isHidden() const { return IsHidden; }
81
82 bool isComdat() const { return IsComdat; }
84
85
86
87
90
93 if (ImportModule)
94 return *ImportModule;
95
96
97
98
99 return "env";
100 }
102
103 bool hasImportName() const { return ImportName.has_value(); }
105 if (ImportName)
106 return *ImportName;
108 }
110
111 bool hasExportName() const { return ExportName.has_value(); }
114
125
128
131
134
137 return *GlobalType;
138 }
140
141 bool hasTableType() const { return TableType.has_value(); }
144 return *TableType;
145 }
154};
155
156}
157
158#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
bool isGlobal() const
Definition MCSymbolWasm.h:48
void setTableType(wasm::WasmTableType TT)
Definition MCSymbolWasm.h:146
void setComdat(bool isComdat)
Definition MCSymbolWasm.h:83
const wasm::WasmTableType & getTableType() const
Definition MCSymbolWasm.h:142
void setImportModule(StringRef Name)
Definition MCSymbolWasm.h:101
bool isUsedInGOT() const
Definition MCSymbolWasm.h:127
StringRef getImportModule() const
Definition MCSymbolWasm.h:92
bool isExported() const
Definition MCSymbolWasm.h:57
const wasm::WasmSignature * getSignature() const
Definition MCSymbolWasm.h:132
StringRef getImportName() const
Definition MCSymbolWasm.h:104
bool isExternal() const
Definition MCSymbolWasm.h:40
MCSymbolWasm(const MCSymbolTableEntry *Name, bool isTemporary)
Definition MCSymbolWasm.h:37
const MCExpr * getSize() const
Definition MCSymbolWasm.h:42
bool hasImportModule() const
Definition MCSymbolWasm.h:91
void setSignature(wasm::WasmSignature *Sig)
Definition MCSymbolWasm.h:133
void setFunctionTable(bool is64)
Definition MCSymbolWasm.h:119
bool isFunctionTable() const
Definition MCSymbolWasm.h:115
bool hasTableType() const
Definition MCSymbolWasm.h:141
void setTableType(wasm::ValType VT, uint8_t flags=wasm::WASM_LIMITS_FLAG_NONE)
Definition MCSymbolWasm.h:147
void setNoStrip() const
Definition MCSymbolWasm.h:67
void setImportName(StringRef Name)
Definition MCSymbolWasm.h:109
void setWeak(bool isWeak)
Definition MCSymbolWasm.h:77
void setType(wasm::WasmSymbolType type)
Definition MCSymbolWasm.h:55
void setExportName(StringRef Name)
Definition MCSymbolWasm.h:113
void setGlobalType(wasm::WasmGlobalType GT)
Definition MCSymbolWasm.h:139
void setHidden(bool isHidden)
Definition MCSymbolWasm.h:80
bool isNoStrip() const
Definition MCSymbolWasm.h:64
void setOmitFromLinkingSection()
Definition MCSymbolWasm.h:89
void setUsedInInitArray() const
Definition MCSymbolWasm.h:129
bool isHidden() const
Definition MCSymbolWasm.h:79
bool isSection() const
Definition MCSymbolWasm.h:50
bool hasExportName() const
Definition MCSymbolWasm.h:111
bool omitFromLinkingSection() const
Definition MCSymbolWasm.h:88
void setExternal(bool Value) const
Definition MCSymbolWasm.h:41
void setExported() const
Definition MCSymbolWasm.h:60
bool isTable() const
Definition MCSymbolWasm.h:49
const wasm::WasmGlobalType & getGlobalType() const
Definition MCSymbolWasm.h:135
StringRef getExportName() const
Definition MCSymbolWasm.h:112
bool isComdat() const
Definition MCSymbolWasm.h:82
bool isData() const
Definition MCSymbolWasm.h:47
void setUsedInGOT() const
Definition MCSymbolWasm.h:126
bool isTag() const
Definition MCSymbolWasm.h:51
bool isUsedInInitArray() const
Definition MCSymbolWasm.h:130
bool hasImportName() const
Definition MCSymbolWasm.h:103
bool isTLS() const
Definition MCSymbolWasm.h:71
bool isFunction() const
Definition MCSymbolWasm.h:45
void setSize(const MCExpr *SS)
Definition MCSymbolWasm.h:43
std::optional< wasm::WasmSymbolType > getType() const
Definition MCSymbolWasm.h:53
void setTLS() const
Definition MCSymbolWasm.h:72
bool isWeak() const
Definition MCSymbolWasm.h:76
MCSymbol(const MCSymbolTableEntry *Name, bool isTemporary)
void modifyFlags(uint32_t Value, uint32_t Mask) const
Modify the flags via a mask.
StringRef getName() const
getName - Get the symbol name.
uint32_t getFlags() const
Get the (implementation defined) symbol flags.
unsigned IsExternal
True if this symbol is visible outside this translation unit.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
const MCExpr * Value
If non-null, the value for a variable symbol.
StringRef - Represent a constant reference to a string, i.e.
const unsigned WASM_SYMBOL_NO_STRIP
const unsigned WASM_SYMBOL_TLS
@ WASM_SYMBOL_TYPE_GLOBAL
@ WASM_SYMBOL_TYPE_SECTION
@ WASM_SYMBOL_TYPE_FUNCTION
const unsigned WASM_SYMBOL_EXPORTED
This is an optimization pass for GlobalISel generic memory operations.
StringMapEntry< MCSymbolTableValue > MCSymbolTableEntry
MCContext stores MCSymbolTableValue in a string map (see MCSymbol::operator new).