summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
diff options
context:
space:
mode:
authorShankar Easwaran <shankare@codeaurora.org>2013-10-29 05:12:14 +0000
committerShankar Easwaran <shankare@codeaurora.org>2013-10-29 05:12:14 +0000
commit2bc24928d36531aeea52c6563a125adb22c203bf (patch)
treeb7fd4a401d972e6c946bc2ba3309ca99924b2070 /lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
parent3aca58f135b593a66c4c5680a4ce3b97d6531bdf (diff)
downloadbcm5719-llvm-2bc24928d36531aeea52c6563a125adb22c203bf.tar.gz
bcm5719-llvm-2bc24928d36531aeea52c6563a125adb22c203bf.zip
[PassManager] add ReaderWriter{Native,YAML} to the Driver.
Enable this for the following flavors a) core b) gnu c) darwin Its disabled for the flavor PECOFF. Convenient markers are added with FIXME comments in the Driver that would be removed and code removed from each flavor. llvm-svn: 193585
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
index 69219e5b168..b79fd39a8bc 100644
--- a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
@@ -16,6 +16,8 @@
#include "lld/ReaderWriter/Reader.h"
#include "lld/ReaderWriter/Writer.h"
#include "lld/Passes/LayoutPass.h"
+#include "lld/Passes/RoundTripNativePass.h"
+#include "lld/Passes/RoundTripYAMLPass.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Triple.h"
@@ -235,10 +237,14 @@ bool MachOLinkingContext::setOS(OS os, StringRef minOSVersion) {
return parsePackedVersion(minOSVersion, _osMinVersion);
}
-void MachOLinkingContext::addPasses(PassManager &pm) const {
+void MachOLinkingContext::addPasses(PassManager &pm) {
pm.add(std::unique_ptr<Pass>(new mach_o::GOTPass));
pm.add(std::unique_ptr<Pass>(new mach_o::StubsPass(*this)));
pm.add(std::unique_ptr<Pass>(new LayoutPass()));
+#ifndef NDEBUG
+ pm.add(std::unique_ptr<Pass>(new RoundTripYAMLPass(*this)));
+ pm.add(std::unique_ptr<Pass>(new RoundTripNativePass(*this)));
+#endif
}
Writer &MachOLinkingContext::writer() const {
OpenPOWER on IntegriCloud