summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2019-08-01 21:34:54 +0000
committerWouter van Oortmerssen <aardappel@gmail.com>2019-08-01 21:34:54 +0000
commit7fee93ed59fdc204c215639c028b561e56e685eb (patch)
tree626e21e4d2a72113e0d2d12006ced305684f7961 /llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
parent84586c1423aae1ca12f5203215b0eeb7c148ed6d (diff)
downloadbcm5719-llvm-7fee93ed59fdc204c215639c028b561e56e685eb.tar.gz
bcm5719-llvm-7fee93ed59fdc204c215639c028b561e56e685eb.zip
[WebAssembly] Fixed relocation errors having no location.
Summary: Fixes: https://bugs.llvm.org/show_bug.cgi?id=42441 Used to print: <unknown>:0: error: Cannot represent a difference across sections (the location was null). Now prints: err.s:20:3: error: Cannot represent a difference across sections i32.const foo-bar ^ Note: I looked at adding a test for this, but I don't think it is worth it. We're not testing error formatting in the Wasm backend :) Reviewers: sbc100, jgravelle-google Subscribers: dschuff, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65602 llvm-svn: 367619
Diffstat (limited to 'llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
index 2fd7382fbcc..5bebd392276 100644
--- a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
+++ b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
@@ -763,6 +763,7 @@ public:
uint64_t &ErrorInfo,
bool MatchingInlineAsm) override {
MCInst Inst;
+ Inst.setLoc(IDLoc);
unsigned MatchResult =
MatchInstructionImpl(Operands, Inst, ErrorInfo, MatchingInlineAsm);
switch (MatchResult) {
OpenPOWER on IntegriCloud