diff options
| author | Sam Clegg <sbc@chromium.org> | 2019-02-07 01:24:44 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2019-02-07 01:24:44 +0000 |
| commit | d6ef8da31780ea2fbce89873528295e5983d8323 (patch) | |
| tree | 5bb4ed450c1f8c1235d6135b0923565ac561c7eb /llvm/include | |
| parent | 40b1c0746231ebbd1364526638a494d8dc2a25af (diff) | |
| download | bcm5719-llvm-d6ef8da31780ea2fbce89873528295e5983d8323.tar.gz bcm5719-llvm-d6ef8da31780ea2fbce89873528295e5983d8323.zip | |
[WebAssembly] Add symbol flag to the binary format llvm.used
Summary:
Rather than add a new attribute
See https://github.com/WebAssembly/tool-conventions/issues/64
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57864
llvm-svn: 353360
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/BinaryFormat/Wasm.h | 1 | ||||
| -rw-r--r-- | llvm/include/llvm/MC/MCSymbolWasm.h | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/BinaryFormat/Wasm.h b/llvm/include/llvm/BinaryFormat/Wasm.h index 84832766858..348fa11542f 100644 --- a/llvm/include/llvm/BinaryFormat/Wasm.h +++ b/llvm/include/llvm/BinaryFormat/Wasm.h @@ -289,6 +289,7 @@ const unsigned WASM_SYMBOL_BINDING_LOCAL = 0x2; const unsigned WASM_SYMBOL_VISIBILITY_DEFAULT = 0x0; const unsigned WASM_SYMBOL_VISIBILITY_HIDDEN = 0x4; const unsigned WASM_SYMBOL_UNDEFINED = 0x10; +const unsigned WASM_SYMBOL_EXPORTED = 0x20; #define WASM_RELOC(name, value) name = value, diff --git a/llvm/include/llvm/MC/MCSymbolWasm.h b/llvm/include/llvm/MC/MCSymbolWasm.h index a39d1ce4b77..88759fe4d9e 100644 --- a/llvm/include/llvm/MC/MCSymbolWasm.h +++ b/llvm/include/llvm/MC/MCSymbolWasm.h @@ -46,6 +46,13 @@ public: wasm::WasmSymbolType getType() const { return Type; } void setType(wasm::WasmSymbolType type) { Type = type; } + bool isExported() const { + return getFlags() & wasm::WASM_SYMBOL_EXPORTED; + } + void setExported() const { + modifyFlags(wasm::WASM_SYMBOL_EXPORTED, wasm::WASM_SYMBOL_EXPORTED); + } + bool isWeak() const { return IsWeak; } void setWeak(bool isWeak) { IsWeak = isWeak; } |

