[lld] r323903 - [WebAssembly] Update to match llvm change rL323901. NFC
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 31 11:54:34 PST 2018
Author: sbc
Date: Wed Jan 31 11:54:34 2018
New Revision: 323903
URL: http://llvm.org/viewvc/llvm-project?rev=323903&view=rev
Log:
[WebAssembly] Update to match llvm change rL323901. NFC
See: https://reviews.llvm.org/rL323901
Patch by Nicholas Wilson!
Differential Revision: https://reviews.llvm.org/D42751
Modified:
lld/trunk/wasm/InputFiles.cpp
lld/trunk/wasm/Writer.cpp
lld/trunk/wasm/WriterUtils.cpp
lld/trunk/wasm/WriterUtils.h
Modified: lld/trunk/wasm/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/InputFiles.cpp?rev=323903&r1=323902&r2=323903&view=diff
==============================================================================
--- lld/trunk/wasm/InputFiles.cpp (original)
+++ lld/trunk/wasm/InputFiles.cpp Wed Jan 31 11:54:34 2018
@@ -172,7 +172,7 @@ InputSegment *ObjFile::getSegment(const
uint32_t ObjFile::getGlobalValue(const WasmSymbol &Sym) const {
const WasmGlobal &Global =
getWasmObj()->globals()[Sym.ElementIndex - NumGlobalImports];
- assert(Global.Type == llvm::wasm::WASM_TYPE_I32);
+ assert(Global.Type.Type == llvm::wasm::WASM_TYPE_I32);
return Global.InitExpr.Value.Int32;
}
@@ -273,7 +273,7 @@ void ObjFile::initializeSymbols() {
}
Symbols.push_back(S);
- if (WasmSym.isFunction()) {
+ if (WasmSym.isTypeFunction()) {
FunctionSymbols[WasmSym.ElementIndex] = S;
if (WasmSym.HasAltIndex)
FunctionSymbols[WasmSym.AltIndex] = S;
@@ -301,7 +301,7 @@ Symbol *ObjFile::createUndefined(const W
Symbol *ObjFile::createDefined(const WasmSymbol &Sym, Symbol::Kind Kind,
InputChunk *Chunk, uint32_t Address) {
Symbol *S;
- if (Sym.isLocal()) {
+ if (Sym.isBindingLocal()) {
S = make<Symbol>(Sym.Name, true);
S->update(Kind, this, Sym.Flags, Chunk, Address);
return S;
Modified: lld/trunk/wasm/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Writer.cpp?rev=323903&r1=323902&r2=323903&view=diff
==============================================================================
--- lld/trunk/wasm/Writer.cpp (original)
+++ lld/trunk/wasm/Writer.cpp Wed Jan 31 11:54:34 2018
@@ -236,8 +236,8 @@ void Writer::createGlobalSection() {
writeUleb128(OS, DefinedGlobals.size(), "global count");
for (const Symbol *Sym : DefinedGlobals) {
WasmGlobal Global;
- Global.Type = WASM_TYPE_I32;
- Global.Mutable = Sym == Config->StackPointerSymbol;
+ Global.Type.Type = WASM_TYPE_I32;
+ Global.Type.Mutable = Sym == Config->StackPointerSymbol;
Global.InitExpr.Opcode = WASM_OPCODE_I32_CONST;
Global.InitExpr.Value.Int32 = Sym->getVirtualAddress();
writeGlobal(OS, Global);
Modified: lld/trunk/wasm/WriterUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/WriterUtils.cpp?rev=323903&r1=323902&r2=323903&view=diff
==============================================================================
--- lld/trunk/wasm/WriterUtils.cpp (original)
+++ lld/trunk/wasm/WriterUtils.cpp Wed Jan 31 11:54:34 2018
@@ -123,9 +123,13 @@ void wasm::writeLimits(raw_ostream &OS,
writeUleb128(OS, Limits.Maximum, "limits max");
}
+void wasm::writeGlobalType(raw_ostream &OS, const WasmGlobalType &Type) {
+ writeValueType(OS, Type.Type, "global type");
+ writeUleb128(OS, Type.Mutable, "global mutable");
+}
+
void wasm::writeGlobal(raw_ostream &OS, const WasmGlobal &Global) {
- writeValueType(OS, Global.Type, "global type");
- writeUleb128(OS, Global.Mutable, "global mutable");
+ writeGlobalType(OS, Global.Type);
writeInitExpr(OS, Global.InitExpr);
}
@@ -138,8 +142,7 @@ void wasm::writeImport(raw_ostream &OS,
writeUleb128(OS, Import.SigIndex, "import sig index");
break;
case WASM_EXTERNAL_GLOBAL:
- writeValueType(OS, Import.Global.Type, "import global type");
- writeUleb128(OS, Import.Global.Mutable, "import global mutable");
+ writeGlobalType(OS, Import.Global);
break;
case WASM_EXTERNAL_MEMORY:
writeLimits(OS, Import.Memory);
Modified: lld/trunk/wasm/WriterUtils.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/WriterUtils.h?rev=323903&r1=323902&r2=323903&view=diff
==============================================================================
--- lld/trunk/wasm/WriterUtils.h (original)
+++ lld/trunk/wasm/WriterUtils.h Wed Jan 31 11:54:34 2018
@@ -60,6 +60,8 @@ void writeInitExpr(raw_ostream &OS, cons
void writeLimits(raw_ostream &OS, const llvm::wasm::WasmLimits &Limits);
+void writeGlobalType(raw_ostream &OS, const llvm::wasm::WasmGlobalType &Type);
+
void writeGlobal(raw_ostream &OS, const llvm::wasm::WasmGlobal &Global);
void writeImport(raw_ostream &OS, const llvm::wasm::WasmImport &Import);
More information about the llvm-commits
mailing list