summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver
diff options
context:
space:
mode:
authorShankar Easwaran <shankare@codeaurora.org>2013-10-24 03:30:03 +0000
committerShankar Easwaran <shankare@codeaurora.org>2013-10-24 03:30:03 +0000
commit89c2d8facaf9c97a2802a3ee139647b7c346ea5e (patch)
treee6574b2843cd52ce5494e2786cc576434bce706b /lld/lib/Driver
parent887c20ffc2691c26be081da69fb8844cdbf63832 (diff)
downloadbcm5719-llvm-89c2d8facaf9c97a2802a3ee139647b7c346ea5e.tar.gz
bcm5719-llvm-89c2d8facaf9c97a2802a3ee139647b7c346ea5e.zip
[PassManager] add ReaderWriter{Native,YAML} to the Driver.
Disable tests to be run with REQUIRES: disable. Note disable is not added to the config by the test runner Mkaefiles, so essentially disables the test. Code changes would be required to fix these tests :- test/darwin/hello-world.objtxt test/elf/check.test test/elf/phdr.test test/elf/ppc.test test/elf/undef-from-main-dso.test test/elf/X86_64/note-sections-ro_plus_rw.test test/pecoff/alignment.test test/pecoff/base-reloc.test test/pecoff/bss-section.test test/pecoff/drectve.test test/pecoff/dynamic.test test/pecoff/dynamicbase.test test/pecoff/entry.test test/pecoff/hello.test test/pecoff/imagebase.test test/pecoff/importlib.test test/pecoff/lib.test test/pecoff/multi.test test/pecoff/reloc.test test/pecoff/weak-external.test llvm-svn: 193300
Diffstat (limited to 'lld/lib/Driver')
-rw-r--r--lld/lib/Driver/Driver.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lld/lib/Driver/Driver.cpp b/lld/lib/Driver/Driver.cpp
index 6f0f4ecdde6..fcbdbe723b5 100644
--- a/lld/lib/Driver/Driver.cpp
+++ b/lld/lib/Driver/Driver.cpp
@@ -16,6 +16,8 @@
#include "lld/Core/Resolver.h"
#include "lld/ReaderWriter/Reader.h"
#include "lld/ReaderWriter/Writer.h"
+#include "lld/Passes/RoundTripNativePass.h"
+#include "lld/Passes/RoundTripYAMLPass.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
@@ -105,19 +107,25 @@ bool Driver::link(LinkingContext &context, raw_ostream &diagnostics) {
Resolver resolver(context);
if (!resolver.resolve())
return false;
- MutableFile &merged = resolver.resultFile();
+ std::unique_ptr<MutableFile> merged = resolver.resultFile();
resolveTask.end();
// Run passes on linked atoms.
ScopedTask passTask(getDefaultDomain(), "Passes");
PassManager pm;
context.addPasses(pm);
+
+#ifndef NDEBUG
+ pm.add(std::unique_ptr<Pass>(new RoundTripNativePass(context)));
+ pm.add(std::unique_ptr<Pass>(new RoundTripYAMLPass(context)));
+#endif
+
pm.runOnFile(merged);
passTask.end();
// Give linked atoms to Writer to generate output file.
ScopedTask writeTask(getDefaultDomain(), "Write");
- if (error_code ec = context.writeFile(merged)) {
+ if (error_code ec = context.writeFile(*merged)) {
diagnostics << "Failed to write file '" << context.outputPath()
<< "': " << ec.message() << "\n";
return false;
OpenPOWER on IntegriCloud