[LLD][ELF] - Add llvm_unreachable. NFC.
authorGeorge Rimar <grimar@accesssoftek.com>
Mon, 26 Nov 2018 10:07:10 +0000 (10:07 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Mon, 26 Nov 2018 10:07:10 +0000 (10:07 +0000)
We never should call writeTo() for BSS section.

llvm-svn: 347540

lld/ELF/SyntheticSections.h

index f35a8bb..3458bdf 100644 (file)
@@ -170,7 +170,9 @@ private:
 class BssSection final : public SyntheticSection {
 public:
   BssSection(StringRef Name, uint64_t Size, uint32_t Alignment);
-  void writeTo(uint8_t *) override {}
+  void writeTo(uint8_t *) override {
+    llvm_unreachable("unexpected writeTo() call for SHT_NOBITS section");
+  }
   bool empty() const override { return getSize() == 0; }
   size_t getSize() const override { return Size; }