From 05c88f9b61b0576f84544fef90f0aefb3eab9095 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Wed, 8 Jan 2014 20:42:52 +0000 Subject: [PATCH] [Mips] Add assert to check that we handle all paired relocations. llvm-svn: 198789 --- lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp | 4 ++++ lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp index 74b4e184e376..57de8f28372a 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp @@ -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 { diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h index 674e924f5465..d2d9155d3df7 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h @@ -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;