[Mips] Add assert to check that we handle all paired relocations.
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 8 Jan 2014 20:42:52 +0000 (20:42 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 8 Jan 2014 20:42:52 +0000 (20:42 +0000)
llvm-svn: 198789

lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h

index 74b4e18..57de8f2 100644 (file)
@@ -95,6 +95,10 @@ MipsTargetRelocationHandler::MipsTargetRelocationHandler(
     const MipsLinkingContext &context, const MipsTargetHandler &handler)
     : _targetHandler(handler) {}
 
+MipsTargetRelocationHandler::~MipsTargetRelocationHandler() {
+  assert(_pairedRelocations.empty());
+}
+
 void
 MipsTargetRelocationHandler::savePairedRelocation(const lld::AtomLayout &atom,
                                                   const Reference &ref) const {
index 674e924..d2d9155 100644 (file)
@@ -22,6 +22,8 @@ public:
   MipsTargetRelocationHandler(const MipsLinkingContext &context,
                               const MipsTargetHandler &handler);
 
+  ~MipsTargetRelocationHandler();
+
   virtual error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
                                      const lld::AtomLayout &,
                                      const Reference &) const;