mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[WebAssembly] Revert r319488 "Add visibility flag to Wasm symbol flags"
This patch reportedly broke one of LLVM bots (ubuntu-gcc7.1-werror). See http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror/builds/3369 for details. llvm-svn: 319602
This commit is contained in:
parent
9d5c56d7ba
commit
6aa6de8e58
@ -190,15 +190,11 @@ enum : unsigned {
|
||||
};
|
||||
|
||||
const unsigned WASM_SYMBOL_BINDING_MASK = 0x3;
|
||||
const unsigned WASM_SYMBOL_VISIBILITY_MASK = 0x4;
|
||||
|
||||
enum : unsigned {
|
||||
WASM_SYMBOL_BINDING_GLOBAL = 0x0,
|
||||
WASM_SYMBOL_BINDING_WEAK = 0x1,
|
||||
WASM_SYMBOL_BINDING_LOCAL = 0x2,
|
||||
|
||||
WASM_SYMBOL_VISIBILITY_DEFAULT = 0x0,
|
||||
WASM_SYMBOL_VISIBILITY_HIDDEN = 0x4,
|
||||
};
|
||||
|
||||
#define WASM_RELOC(name, value) name = value,
|
||||
|
@ -18,7 +18,6 @@ class MCSymbolWasm : public MCSymbol {
|
||||
private:
|
||||
bool IsFunction = false;
|
||||
bool IsWeak = false;
|
||||
bool IsHidden = false;
|
||||
std::string ModuleName;
|
||||
SmallVector<wasm::ValType, 1> Returns;
|
||||
SmallVector<wasm::ValType, 4> Params;
|
||||
@ -46,9 +45,6 @@ public:
|
||||
bool isWeak() const { return IsWeak; }
|
||||
void setWeak(bool isWeak) { IsWeak = isWeak; }
|
||||
|
||||
bool isHidden() const { return IsHidden; }
|
||||
void setHidden(bool isHidden) { IsHidden = isHidden; }
|
||||
|
||||
const StringRef getModuleName() const { return ModuleName; }
|
||||
|
||||
const SmallVector<wasm::ValType, 1> &getReturns() const {
|
||||
|
@ -81,14 +81,6 @@ public:
|
||||
return Flags & wasm::WASM_SYMBOL_BINDING_MASK;
|
||||
}
|
||||
|
||||
bool isHidden() const {
|
||||
return getVisibility() == wasm::WASM_SYMBOL_VISIBILITY_HIDDEN;
|
||||
}
|
||||
|
||||
unsigned getVisibility() const {
|
||||
return Flags & wasm::WASM_SYMBOL_VISIBILITY_MASK;
|
||||
}
|
||||
|
||||
void print(raw_ostream &Out) const {
|
||||
Out << "Name=" << Name << ", Type=" << static_cast<int>(Type)
|
||||
<< ", Flags=" << Flags << " ElemIndex=" << ElementIndex
|
||||
|
@ -98,13 +98,10 @@ bool MCWasmStreamer::EmitSymbolAttribute(MCSymbol *S, MCSymbolAttr Attribute) {
|
||||
case MCSA_WeakDefAutoPrivate:
|
||||
case MCSA_Invalid:
|
||||
case MCSA_IndirectSymbol:
|
||||
case MCSA_Hidden:
|
||||
case MCSA_Protected:
|
||||
return false;
|
||||
|
||||
case MCSA_Hidden:
|
||||
Symbol->setHidden(true);
|
||||
break;
|
||||
|
||||
case MCSA_Weak:
|
||||
case MCSA_WeakReference:
|
||||
Symbol->setWeak(true);
|
||||
|
@ -1180,14 +1180,10 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
|
||||
<< S.isExternal() << " isTemporary=" << S.isTemporary()
|
||||
<< " isFunction=" << WS.isFunction()
|
||||
<< " isWeak=" << WS.isWeak()
|
||||
<< " isHidden=" << WS.isHidden()
|
||||
<< " isVariable=" << WS.isVariable() << "\n");
|
||||
|
||||
if (WS.isWeak() || WS.isHidden()) {
|
||||
uint32_t Flags = (WS.isWeak() ? wasm::WASM_SYMBOL_BINDING_WEAK : 0) |
|
||||
(WS.isHidden() ? wasm::WASM_SYMBOL_VISIBILITY_HIDDEN : 0);
|
||||
SymbolFlags.emplace_back(WS.getName(), Flags);
|
||||
}
|
||||
if (WS.isWeak())
|
||||
SymbolFlags.emplace_back(WS.getName(), wasm::WASM_SYMBOL_BINDING_WEAK);
|
||||
|
||||
if (WS.isVariable())
|
||||
continue;
|
||||
|
@ -378,7 +378,7 @@ Error WasmObjectFile::parseLinkingSection(const uint8_t *Ptr,
|
||||
Symbols[SymIndex].Flags = Flags;
|
||||
DEBUG(dbgs() << "Set symbol flags index:"
|
||||
<< SymIndex << " name:"
|
||||
<< Symbols[SymIndex].Name << " expected:"
|
||||
<< Symbols[SymIndex].Name << " exptected:"
|
||||
<< Symbol << " flags: " << Flags << "\n");
|
||||
}
|
||||
break;
|
||||
@ -766,8 +766,6 @@ uint32_t WasmObjectFile::getSymbolFlags(DataRefImpl Symb) const {
|
||||
Result |= SymbolRef::SF_Weak;
|
||||
if (!Sym.isLocal())
|
||||
Result |= SymbolRef::SF_Global;
|
||||
if (Sym.isHidden())
|
||||
Result |= SymbolRef::SF_Hidden;
|
||||
|
||||
switch (Sym.Type) {
|
||||
case WasmSymbol::SymbolType::FUNCTION_IMPORT:
|
||||
|
@ -1,23 +0,0 @@
|
||||
; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s
|
||||
|
||||
; Function with __attribute__((visibility("default")))
|
||||
define void @defaultVis() #0 {
|
||||
entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function with __attribute__((visibility("hidden")))
|
||||
define hidden void @hiddenVis() #0 {
|
||||
entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: - Type: CUSTOM
|
||||
|
||||
; CHECK: - Type: CUSTOM
|
||||
; CHECK-NEXT: Name: linking
|
||||
; CHECK-NEXT: DataSize: 0
|
||||
; CHECK-NEXT: SymbolInfo:
|
||||
; CHECK-NEXT: - Name: hiddenVis
|
||||
; CHECK-NEXT: Flags: 4
|
||||
; CHECK-NEXT: ...
|
Loading…
Reference in New Issue
Block a user