Commit Graph

36 Commits

Author SHA1 Message Date
Rui Ueyama c444241e41 [Passes][GOT] Split perform() into small predicate functions for readability sake.
Reviewers: shankarke

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D988

llvm-svn: 184091
2013-06-17 17:29:46 +00:00
Rui Ueyama a6b71cabb3 [LayoutPass] Add a method to check the followon graph structure.
Found that having a method to check the strucutre of the followon graph makes
it easy to debug file readers. The method checks if there's no wrong edge in
followOnNexts and followOnRoots. It is called only when debuggging is enabled
for LayoutPass.

Reviewers: shankarke

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D922

llvm-svn: 183553
2013-06-07 20:18:39 +00:00
Michael J. Spencer 615c076fc1 Revert "[Passes] Parallelize the layout pass sort."
Inconsistent (and wrong) sort order on non-Windows.

llvm-svn: 182975
2013-05-31 00:05:49 +00:00
Michael J. Spencer 0d9d3110c7 [Passes] Parallelize the layout pass sort.
llvm-svn: 182792
2013-05-28 19:03:29 +00:00
Michael J. Spencer bd66d04f34 Instrument things.
llvm-svn: 182789
2013-05-28 18:55:39 +00:00
Rui Ueyama 9c4f89ad2d [lld][LayoutPass] Consolidate debug flags, removing "layout" flag.
DEBUG_TYPE is already defined at the beginning of this file. We don't
want to have two different debug flags for a single pass.

Reviewers: shankarke

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D845

llvm-svn: 182543
2013-05-23 01:31:25 +00:00
Shankar Easwaran d8da989e78 [lld][LayoutPass] An earlier commit moved the functionality so that Atoms would
be laid out by their ordinal overrides first, there was a bug that two atoms may 
get the same override index due to which atoms were not ordered properly. This
commit fixes the problem.

Now the atoms are ordered by 

- Section Position hints
- Atom override (Using layout-after/layout-before/in-group)
- Content Permissions
- Content Type
- File Ordinal

This also fixes the problem of running c++ static executables that 
was broken by an earlier patch.

llvm-svn: 182494
2013-05-22 17:41:04 +00:00
Rui Ueyama 0196d1062f [lld][LayoutPass] Cleanup: replace (*atom).size() with atom->size().
llvm-svn: 181804
2013-05-14 16:53:59 +00:00
Rui Ueyama 5ec6d1a9cd [lld][LayoutPass] Fix a bug that caused buildbot to fail on some platforms.
llvm-svn: 181752
2013-05-14 01:51:56 +00:00
Rui Ueyama ca8ca55b52 [lld][LayoutPass] Split buildFollowOnTable for readability.
Summary:
Split buildFollowOnTable to small functions to improve
code readability and remove code duplication. No change
in functionality.

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D790

llvm-svn: 181749
2013-05-14 00:41:52 +00:00
Shankar Easwaran 3c5d2c8a24 [lld][LayoutPass] This commit fixes a problem in the
Layoutpass by ordering atoms if they appear in the override
list first and then looking at the way of ordering atoms in
the default way.

The fix also fixes issues with the sizes of the sections,
that appear in the output properly too.

The commit also adds a testcase(orderatoms-by-override.test)
to test it and fixes all the other relevant testcases.

llvm-svn: 181605
2013-05-10 16:44:02 +00:00
Shankar Easwaran 45a5f93517 [lld][LayoutPass] initialize the number of entries for the densehash (no functionality change)
llvm-svn: 180690
2013-04-29 03:27:57 +00:00
Michael J. Spencer d4eb47c110 Add VTune as an optional external dependency and add task tracking.
llvm-svn: 178940
2013-04-06 00:56:40 +00:00
Nick Kledzik f4fa8c0a75 fix DEBUG_WITH_TYPE to build without warnings in non-debug builds
llvm-svn: 178787
2013-04-04 20:32:18 +00:00
Nick Kledzik c314b46e71 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
2013-04-04 18:59:24 +00:00
Shankar Easwaran 8962feb915 [lld] remove trailing whitespace
llvm-svn: 177079
2013-03-14 16:09:49 +00:00
Shankar Easwaran 8c25685be7 [Pass][Layout] Add extra debugging information
llvm-svn: 176925
2013-03-13 04:05:38 +00:00
Michael J. Spencer 1ecf890215 [Pass][Layout] Make algorithm not n^2.
This reduces the time spent in this function while linking ASTMatchersTests
from %43 to %2.4 of total link time.

llvm-svn: 176842
2013-03-12 00:10:00 +00:00
Michael J. Spencer 52fdb8bf13 Fix (possible) MSVC miscompile in debug mode.
llvm-svn: 176748
2013-03-09 01:41:27 +00:00
Shankar Easwaran c44bc347cb [ELF] Order weak symbols properly
llvm-svn: 176583
2013-03-06 21:59:27 +00:00
Michael J. Spencer 7f09a3d54e [Pass][Layout] Fix bug and add debug printing.
Fix a bug where if two atoms had the same index in the override map,
the compare would return false. It now goes to the next check when
they are equal.

No test because it currently can't be tested. An upcomming patch will test it.

llvm-svn: 176073
2013-02-26 01:35:30 +00:00
Shankar Easwaran 34ab70f1e6 add changes for layoutafter/layoutbefore/ingroup/layoutpass and test cases
llvm-svn: 174658
2013-02-07 20:16:12 +00:00
Nick Kledzik 36293f6512 Add SectionPosition and OrderPass
llvm-svn: 173300
2013-01-23 22:32:56 +00:00
Michael J. Spencer 57752dc56e Factor File::addAtom out to MutableFile::addAtom.
This removes a bunch of llvm_unreachables and makes a File's mutability part of the type system.

llvm-svn: 172297
2013-01-12 02:45:54 +00:00
Michael J. Spencer b8c853e5eb [Passes][GOT] Fix style.
llvm-svn: 171530
2013-01-04 21:18:13 +00:00
Nick Kledzik abb6981f68 Major refactoring: Remove Platform concept. In its place there are
now Reader and Writer subclasses for each file format.  Each Reader and
Writer subclass defines an "options" class which controls how that Reader
or Writer operates.

llvm-svn: 157774
2012-05-31 22:34:00 +00:00
Nick Kledzik 062a98cff0 Rename referencesBegin() to begin() so that C++11 range based for loops can be used
llvm-svn: 154301
2012-04-08 23:52:13 +00:00
Nick Kledzik b334be1ed2 First implementation of Darwin Platform. It is rich enough to generate
a hello world executable from atoms.  There is still much to be flushed out.
Added one test case, test/darwin/hello-world.objtxt, which exercises the
darwin platform.

Added -platform option to lld-core tool to dynamically select platform.

llvm-svn: 154242
2012-04-07 01:31:00 +00:00
Michael J. Spencer 765792d5d1 Remove trailing whitespace.
llvm-svn: 153964
2012-04-03 18:40:27 +00:00
Michael J. Spencer e6203a57b5 Steal LLVM.h from Clang. This brings in very commonly used LLVM ADT/Support
types into the lld namespace.

llvm-svn: 153963
2012-04-03 18:39:40 +00:00
Michael J. Spencer b495562b5d Use the LLVM RTTI library.
llvm-svn: 153912
2012-04-02 23:56:36 +00:00
Michael J. Spencer c9d2506a76 Replace all uses of NULL with nullptr.
llvm-svn: 153677
2012-03-29 19:39:14 +00:00
Michael J. Spencer cfd029fd91 Rearange header order to match llvm style. This exposed some missing types.
Also fix some Platform.h includes that somehow got missed last time.

llvm-svn: 153590
2012-03-28 19:04:02 +00:00
Michael J. Spencer 87c2994e24 Move Platform.h to Core as Core depends on Platform.h, and the Platform
library depends on Core. This breaks that cycle.

llvm-svn: 153589
2012-03-28 18:49:17 +00:00
Nick Kledzik f4e2c73fa7 Add Pass to instantiate GOT entries
llvm-svn: 152874
2012-03-15 23:36:24 +00:00
Nick Kledzik 1a6615dc88 Sources now require C++11 to build.
Add first linker pass (StubsPass) which looks for calls to shared library
symbols and replaces them with calls to a StubAtom.  On ELF system, a "stub"
is a PLT entry.  Added a simple test case.

Pass a Platform object to YAML reader and writer for converting fixup kinds 
between names and values.

Change output of Resolver to be a File object instead of a vector of Atoms.
Thus, passes operate on a File instead of just Atoms.

Rework how to walk through a File's Atoms. Now iterator based instead of 
a method that visits each atom.  

llvm-svn: 152269
2012-03-08 00:18:30 +00:00