diff options
Diffstat (limited to 'lld/wasm/Symbols.cpp')
-rw-r--r-- | lld/wasm/Symbols.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lld/wasm/Symbols.cpp b/lld/wasm/Symbols.cpp index 6b43eb36341..ef135b35b1a 100644 --- a/lld/wasm/Symbols.cpp +++ b/lld/wasm/Symbols.cpp @@ -98,6 +98,16 @@ void Symbol::setHidden(bool IsHidden) { Flags |= WASM_SYMBOL_VISIBILITY_DEFAULT; } +bool Symbol::isExported() const { + if (!isDefined() || isLocal()) + return false; + + if (Config->ExportAll) + return true; + + return !isHidden(); +} + uint32_t FunctionSymbol::getFunctionIndex() const { if (auto *F = dyn_cast<DefinedFunction>(this)) return F->Function->getFunctionIndex(); |