[PATCH] D82884: [lld][WebAssembly] Give better error message on bad archive member

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 21:39:17 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG73e575a88e27: [lld][WebAssembly] Give better error message on bad archive member (authored by sbc100).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82884/new/

https://reviews.llvm.org/D82884

Files:
  lld/test/wasm/lto/incompatible.ll
  lld/test/wasm/lto/libcall-truncsfhf2.ll
  lld/wasm/InputFiles.cpp


Index: lld/wasm/InputFiles.cpp
===================================================================
--- lld/wasm/InputFiles.cpp
+++ lld/wasm/InputFiles.cpp
@@ -569,8 +569,7 @@
 
 void BitcodeFile::parse() {
   if (doneLTO) {
-    error(toString(mb.getBufferIdentifier()) +
-          ": attempt to add bitcode file after LTO.");
+    error(toString(this) + ": attempt to add bitcode file after LTO.");
     return;
   }
 
@@ -578,7 +577,7 @@
       mb.getBuffer(), saver.save(archiveName + mb.getBufferIdentifier()))));
   Triple t(obj->getTargetTriple());
   if (t.getArch() != Triple::wasm32) {
-    error(toString(mb.getBufferIdentifier()) + ": machine type must be wasm32");
+    error(toString(this) + ": machine type must be wasm32");
     return;
   }
   std::vector<bool> keptComdats;
Index: lld/test/wasm/lto/libcall-truncsfhf2.ll
===================================================================
--- lld/test/wasm/lto/libcall-truncsfhf2.ll
+++ lld/test/wasm/lto/libcall-truncsfhf2.ll
@@ -17,4 +17,4 @@
   ret void
 }
 
-; CHECK: wasm-ld: error: {{.*}}truncsfhf2.o: attempt to add bitcode file after LTO.
+; CHECK: wasm-ld: error: {{.*}}truncsfhf2.o): attempt to add bitcode file after LTO.
Index: lld/test/wasm/lto/incompatible.ll
===================================================================
--- lld/test/wasm/lto/incompatible.ll
+++ lld/test/wasm/lto/incompatible.ll
@@ -2,7 +2,11 @@
 ; RUN: llvm-as %s -o %t.bc
 ; RUN: not wasm-ld %t.bc -o %t.wasm 2>&1 | FileCheck %s
 
+; RUN: llvm-ar rc %t.a %t.bc
+; RUN: not wasm-ld --whole-archive %t.a -o %t.wasm 2>&1 | FileCheck %s --check-prefix=CHECK-ARCHIVE
+
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 ; CHECK: {{.*}}incompatible.ll.tmp.bc: machine type must be wasm32
+; CHECK-ARCHIVE: wasm-ld: error: {{.*}}.a(incompatible.ll.tmp.bc): machine type must be wasm32


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82884.274683.patch
Type: text/x-patch
Size: 1927 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200701/070fdd97/attachment.bin>


More information about the llvm-commits mailing list