[PATCH] D42626: [WebAssembly] Add getName and getFileName methods to InputChunk base class. NFC.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 28 12:00:08 PST 2018


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL323623: [WebAssembly] Add getName and getFileName methods to InputChunk base class. NFC. (authored by sbc, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D42626

Files:
  lld/trunk/wasm/InputChunks.cpp
  lld/trunk/wasm/InputChunks.h


Index: lld/trunk/wasm/InputChunks.cpp
===================================================================
--- lld/trunk/wasm/InputChunks.cpp
+++ lld/trunk/wasm/InputChunks.cpp
@@ -113,13 +113,13 @@
 }
 
 void InputFunction::setOutputIndex(uint32_t Index) {
-  DEBUG(dbgs() << "InputFunction::setOutputIndex: " << Index << "\n");
+  DEBUG(dbgs() << "InputFunction::setOutputIndex: " << getName() << " -> " << Index << "\n");
   assert(!hasOutputIndex());
   OutputIndex = Index;
 }
 
 void InputFunction::setTableIndex(uint32_t Index) {
-  DEBUG(dbgs() << "InputFunction::setTableIndex " << Index << "\n");
+  DEBUG(dbgs() << "InputFunction::setTableIndex: " << getName() << " -> " << Index << "\n");
   assert(!hasTableIndex());
   TableIndex = Index;
 }
Index: lld/trunk/wasm/InputChunks.h
===================================================================
--- lld/trunk/wasm/InputChunks.h
+++ lld/trunk/wasm/InputChunks.h
@@ -51,8 +51,10 @@
 
   uint32_t getOutputOffset() const { return OutputOffset; }
   ArrayRef<WasmRelocation> getRelocations() const { return Relocations; }
+  StringRef getFileName() const { return File->getName(); }
 
   virtual StringRef getComdat() const = 0;
+  virtual StringRef getName() const = 0;
 
   bool Discarded = false;
   std::vector<OutputRelocation> OutRelocations;
@@ -99,7 +101,7 @@
   uint32_t getAlignment() const { return Segment.Data.Alignment; }
   uint32_t startVA() const { return Segment.Data.Offset.Value.Int32; }
   uint32_t endVA() const { return startVA() + getSize(); }
-  StringRef getName() const { return Segment.Data.Name; }
+  StringRef getName() const override { return Segment.Data.Name; }
   StringRef getComdat() const override { return Segment.Data.Comdat; }
 
   int32_t OutputSegmentOffset = 0;
@@ -126,7 +128,7 @@
     return C->kind() == InputChunk::Function;
   }
 
-  virtual StringRef getName() const { return Function->Name; }
+  StringRef getName() const override { return Function->Name; }
   StringRef getComdat() const override { return Function->Comdat; }
   uint32_t getOutputIndex() const { return OutputIndex.getValue(); }
   bool hasOutputIndex() const { return OutputIndex.hasValue(); }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42626.131721.patch
Type: text/x-patch
Size: 2173 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180128/be0756b1/attachment.bin>


More information about the llvm-commits mailing list