diff options
| author | Nick Kledzik <kledzik@apple.com> | 2013-04-04 18:59:24 +0000 |
|---|---|---|
| committer | Nick Kledzik <kledzik@apple.com> | 2013-04-04 18:59:24 +0000 |
| commit | c314b46e718bb5f23ca257af2331c120891361b2 (patch) | |
| tree | b0c6c6a9688cadb233589dc5e317df5d05d89cba /lld/lib/Passes/LayoutPass.cpp | |
| parent | 83f1be1bfc3112d0edba33ed6d8e1a751844b06f (diff) | |
| download | bcm5719-llvm-c314b46e718bb5f23ca257af2331c120891361b2.tar.gz bcm5719-llvm-c314b46e718bb5f23ca257af2331c120891361b2.zip | |
This is my Driver refactoring patch.
The major changes are:
1) LinkerOptions has been merged into TargetInfo
2) LinkerInvocation has been merged into Driver
3) Drivers no longer convert arguments into an intermediate (core) argument
list, but instead create a TargetInfo object and call setter methods on
it. This is only how in-process linking would work. That is, you can
programmatically set up a TargetInfo object which controls the linking.
4) Lots of tweaks to test suite to work with driver changes
5) Add the DarwinDriver
6) I heavily doxygen commented TargetInfo.h
Things to do after this patch is committed:
a) Consider renaming TargetInfo, given its new roll.
b) Consider pulling the list of input files out of TargetInfo. This will
enable in-process clients to create one TargetInfo the re-use it with
different input file lists.
c) Work out a way for Drivers to format the warnings and error done in
core linking.
llvm-svn: 178776
Diffstat (limited to 'lld/lib/Passes/LayoutPass.cpp')
| -rw-r--r-- | lld/lib/Passes/LayoutPass.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lld/lib/Passes/LayoutPass.cpp b/lld/lib/Passes/LayoutPass.cpp index f6bf980006d..6edbcadbcbf 100644 --- a/lld/lib/Passes/LayoutPass.cpp +++ b/lld/lib/Passes/LayoutPass.cpp @@ -11,6 +11,7 @@ #define DEBUG_TYPE "LayoutPass" #include "lld/Passes/LayoutPass.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h" @@ -435,6 +436,29 @@ void LayoutPass::perform(MutableFile &mergedFile) { // Build override maps buildOrdinalOverrideMap(atomRange); + DEBUG_WITH_TYPE("layout", llvm::dbgs() << "unsorted atoms:\n"); + for ( const DefinedAtom *atom : atomRange ) { + DEBUG_WITH_TYPE("layout", llvm::dbgs() + << " file=" << atom->file().path() + << ", name=" << atom->name() + << ", size=" << atom->size() + << ", type=" << atom->contentType() + << ", ordinal=" << atom->ordinal() + << "\n"); + } + // sort the atoms std::sort(atomRange.begin(), atomRange.end(), _compareAtoms); + + DEBUG_WITH_TYPE("layout", llvm::dbgs() << "sorted atoms:\n"); + for ( const DefinedAtom *atom : atomRange ) { + DEBUG_WITH_TYPE("layout", llvm::dbgs() + << " file=" << atom->file().path() + << ", name=" << atom->name() + << ", size=" << atom->size() + << ", type=" << atom->contentType() + << ", ordinal=" << atom->ordinal() + << "\n"); + } + } |

