[llvm] r319602 - [WebAssembly] Revert r319488 "Add visibility flag to Wasm symbol flags"
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 1 18:05:06 PST 2017
Author: aheejin
Date: Fri Dec 1 18:05:06 2017
New Revision: 319602
URL: http://llvm.org/viewvc/llvm-project?rev=319602&view=rev
Log:
[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.
Removed:
llvm/trunk/test/MC/WebAssembly/visibility.ll
Modified:
llvm/trunk/include/llvm/BinaryFormat/Wasm.h
llvm/trunk/include/llvm/MC/MCSymbolWasm.h
llvm/trunk/include/llvm/Object/Wasm.h
llvm/trunk/lib/MC/MCWasmStreamer.cpp
llvm/trunk/lib/MC/WasmObjectWriter.cpp
llvm/trunk/lib/Object/WasmObjectFile.cpp
Modified: llvm/trunk/include/llvm/BinaryFormat/Wasm.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/Wasm.h?rev=319602&r1=319601&r2=319602&view=diff
==============================================================================
--- llvm/trunk/include/llvm/BinaryFormat/Wasm.h (original)
+++ llvm/trunk/include/llvm/BinaryFormat/Wasm.h Fri Dec 1 18:05:06 2017
@@ -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,
Modified: llvm/trunk/include/llvm/MC/MCSymbolWasm.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbolWasm.h?rev=319602&r1=319601&r2=319602&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSymbolWasm.h (original)
+++ llvm/trunk/include/llvm/MC/MCSymbolWasm.h Fri Dec 1 18:05:06 2017
@@ -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 {
Modified: llvm/trunk/include/llvm/Object/Wasm.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/Wasm.h?rev=319602&r1=319601&r2=319602&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/Wasm.h (original)
+++ llvm/trunk/include/llvm/Object/Wasm.h Fri Dec 1 18:05:06 2017
@@ -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
Modified: llvm/trunk/lib/MC/MCWasmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCWasmStreamer.cpp?rev=319602&r1=319601&r2=319602&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCWasmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCWasmStreamer.cpp Fri Dec 1 18:05:06 2017
@@ -98,13 +98,10 @@ bool MCWasmStreamer::EmitSymbolAttribute
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);
Modified: llvm/trunk/lib/MC/WasmObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WasmObjectWriter.cpp?rev=319602&r1=319601&r2=319602&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WasmObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WasmObjectWriter.cpp Fri Dec 1 18:05:06 2017
@@ -1180,14 +1180,10 @@ void WasmObjectWriter::writeObject(MCAss
<< 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;
Modified: llvm/trunk/lib/Object/WasmObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/WasmObjectFile.cpp?rev=319602&r1=319601&r2=319602&view=diff
==============================================================================
--- llvm/trunk/lib/Object/WasmObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/WasmObjectFile.cpp Fri Dec 1 18:05:06 2017
@@ -378,7 +378,7 @@ Error WasmObjectFile::parseLinkingSectio
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(
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:
Removed: llvm/trunk/test/MC/WebAssembly/visibility.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/WebAssembly/visibility.ll?rev=319601&view=auto
==============================================================================
--- llvm/trunk/test/MC/WebAssembly/visibility.ll (original)
+++ llvm/trunk/test/MC/WebAssembly/visibility.ll (removed)
@@ -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: ...
More information about the llvm-commits
mailing list