summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/CoreLinkingContext.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/CoreLinkingContext.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/CoreLinkingContext.cpp')
-rw-r--r--lld/lib/ReaderWriter/CoreLinkingContext.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/CoreLinkingContext.cpp b/lld/lib/ReaderWriter/CoreLinkingContext.cpp
index ec8962bbce2..3b83d297e48 100644
--- a/lld/lib/ReaderWriter/CoreLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/CoreLinkingContext.cpp
@@ -12,6 +12,9 @@
#include "lld/Core/Pass.h"
#include "lld/Core/PassManager.h"
#include "lld/Passes/LayoutPass.h"
+#include "lld/Passes/RoundTripNativePass.h"
+#include "lld/Passes/RoundTripYAMLPass.h"
+#include "lld/ReaderWriter/Simple.h"
#include "llvm/ADT/ArrayRef.h"
@@ -149,10 +152,10 @@ private:
uint32_t _ordinal;
};
-class TestingPassFile : public MutableFile {
+class TestingPassFile : public SimpleFile {
public:
TestingPassFile(const LinkingContext &ctx)
- : MutableFile(ctx, "Testing pass") {}
+ : SimpleFile(ctx, "Testing pass") {}
virtual void addAtom(const Atom &atom) {
if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(&atom))
@@ -277,7 +280,7 @@ bool CoreLinkingContext::validateImpl(raw_ostream &) {
return true;
}
-void CoreLinkingContext::addPasses(PassManager &pm) const {
+void CoreLinkingContext::addPasses(PassManager &pm) {
for (StringRef name : _passNames) {
if (name.equals("layout"))
pm.add(std::unique_ptr<Pass>((new LayoutPass())));
@@ -288,6 +291,10 @@ void CoreLinkingContext::addPasses(PassManager &pm) const {
else
llvm_unreachable("bad pass name");
}
+#ifndef NDEBUG
+ pm.add(std::unique_ptr<Pass>(new RoundTripYAMLPass(*this)));
+ pm.add(std::unique_ptr<Pass>(new RoundTripNativePass(*this)));
+#endif
}
Writer &CoreLinkingContext::writer() const { return *_writer; }
OpenPOWER on IntegriCloud