[PATCH] D65602: [WebAssembly] Fixed relocation errors having no location.

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 12:56:48 PDT 2019


aardappel created this revision.
aardappel added reviewers: sbc100, jgravelle-google.
Herald added subscribers: llvm-commits, sunfish, aheejin, dschuff.
Herald added a project: LLVM.

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 :)


Repository:
  rL LLVM

https://reviews.llvm.org/D65602

Files:
  lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp


Index: lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
===================================================================
--- lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
+++ lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
@@ -763,6 +763,7 @@
                                uint64_t &ErrorInfo,
                                bool MatchingInlineAsm) override {
     MCInst Inst;
+    Inst.setLoc(IDLoc);
     unsigned MatchResult =
         MatchInstructionImpl(Operands, Inst, ErrorInfo, MatchingInlineAsm);
     switch (MatchResult) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65602.212887.patch
Type: text/x-patch
Size: 573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190801/53556bc8/attachment.bin>


More information about the llvm-commits mailing list