[lld] r347540 - [LLD][ELF] - Add llvm_unreachable. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 26 02:07:10 PST 2018


Author: grimar
Date: Mon Nov 26 02:07:10 2018
New Revision: 347540

URL: http://llvm.org/viewvc/llvm-project?rev=347540&view=rev
Log:
[LLD][ELF] - Add llvm_unreachable. NFC.

We never should call writeTo() for BSS section.

Modified:
    lld/trunk/ELF/SyntheticSections.h

Modified: lld/trunk/ELF/SyntheticSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=347540&r1=347539&r2=347540&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.h (original)
+++ lld/trunk/ELF/SyntheticSections.h Mon Nov 26 02:07:10 2018
@@ -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; }
 




More information about the llvm-commits mailing list