[WebAssembly] Define toString(wasm::InputChunk *) and use that in MarkLive.cpp.

Define toString(wasm::InputChunk *) and use that in MarkLive.cpp.

Differential Revision: https://reviews.llvm.org/D43434

llvm-svn: 325535
diff --git a/lld/wasm/MarkLive.cpp b/lld/wasm/MarkLive.cpp
index 1a3372e..bba1b9d 100644
--- a/lld/wasm/MarkLive.cpp
+++ b/lld/wasm/MarkLive.cpp
@@ -91,17 +91,13 @@
 
   // Report garbage-collected sections.
   if (Config->PrintGcSections) {
-    auto CheckChunk = [](const InputChunk *C) {
-      if (!C->Live)
-        message("removing unused section '" + C->getName() + "' in file '" +
-                C->File->getName() + "'");
-    };
-
     for (const ObjFile *Obj : Symtab->ObjectFiles) {
       for (InputChunk *C : Obj->Functions)
-        CheckChunk(C);
+        if (!C->Live)
+          message("removing unused section " + toString(C));
       for (InputChunk *C : Obj->Segments)
-        CheckChunk(C);
+        if (!C->Live)
+          message("removing unused section " + toString(C));
     }
   }
 }