summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/ELFLinkingContext.cpp')
-rw-r--r--lld/lib/ReaderWriter/ELF/ELFLinkingContext.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lld/lib/ReaderWriter/ELF/ELFLinkingContext.cpp b/lld/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
index 6d6f6a75794..827d73d2abe 100644
--- a/lld/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
@@ -16,6 +16,8 @@
#include "lld/Core/Instrumentation.h"
#include "lld/Passes/LayoutPass.h"
+#include "lld/Passes/RoundTripNativePass.h"
+#include "lld/Passes/RoundTripYAMLPass.h"
#include "lld/ReaderWriter/ReaderLinkerScript.h"
#include "llvm/ADT/Triple.h"
@@ -52,10 +54,14 @@ bool ELFLinkingContext::isLittleEndian() const {
return true;
}
-void ELFLinkingContext::addPasses(PassManager &pm) const {
+void ELFLinkingContext::addPasses(PassManager &pm) {
if (_runLayoutPass)
pm.add(std::unique_ptr<Pass>(new LayoutPass()));
pm.add(std::unique_ptr<Pass>(new elf::ArrayOrderPass()));
+#ifndef NDEBUG
+ pm.add(std::unique_ptr<Pass>(new RoundTripYAMLPass(*this)));
+ pm.add(std::unique_ptr<Pass>(new RoundTripNativePass(*this)));
+#endif
}
uint16_t ELFLinkingContext::getOutputMachine() const {
OpenPOWER on IntegriCloud