[llvm] 3eaeebe - [WebAssembly] Fix WasmEmitter link error.
Wouter van Oortmerssen via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 16 17:23:31 PDT 2020
Author: Wouter van Oortmerssen
Date: 2020-04-16T17:23:18-07:00
New Revision: 3eaeebec959e64c8b855fecb51077b6009c95d64
URL: https://github.com/llvm/llvm-project/commit/3eaeebec959e64c8b855fecb51077b6009c95d64
DIFF: https://github.com/llvm/llvm-project/commit/3eaeebec959e64c8b855fecb51077b6009c95d64.diff
LOG: [WebAssembly] Fix WasmEmitter link error.
Added:
Modified:
llvm/lib/ObjectYAML/WasmEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ObjectYAML/WasmEmitter.cpp b/llvm/lib/ObjectYAML/WasmEmitter.cpp
index 84e364c07448..ef54eaedfc0b 100644
--- a/llvm/lib/ObjectYAML/WasmEmitter.cpp
+++ b/llvm/lib/ObjectYAML/WasmEmitter.cpp
@@ -530,7 +530,12 @@ void WasmWriter::writeRelocSection(raw_ostream &OS, WasmYAML::Section &Sec,
writeUint8(OS, Reloc.Type);
encodeULEB128(Reloc.Offset, OS);
encodeULEB128(Reloc.Index, OS);
- if (wasm::relocTypeHasAddend(Reloc.Type)) {
+ switch (Reloc.Type) {
+ case wasm::R_WASM_MEMORY_ADDR_LEB:
+ case wasm::R_WASM_MEMORY_ADDR_SLEB:
+ case wasm::R_WASM_MEMORY_ADDR_I32:
+ case wasm::R_WASM_FUNCTION_OFFSET_I32:
+ case wasm::R_WASM_SECTION_OFFSET_I32:
encodeULEB128(Reloc.Addend, OS);
}
}
More information about the llvm-commits
mailing list