[lld][ELF] split ELF reader into multiple functions for readability (no change in functionality)

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181288 91177308-0d34-0410-b5e6-96231b3b80d8
[lld][ELF] fix build failure

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181325 91177308-0d34-0410-b5e6-96231b3b80d8
Use anonymous namespace for local classes.  Patch by Rui Ueyama

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181473 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Add "explicit" to constructors where appropriate.

Summary:
Add the explicit keyword to one-parameter
constructors to prevent unintended type conversions.

CC: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181483 91177308-0d34-0410-b5e6-96231b3b80d8
[lld][Core] Fix latch synchronization bug.

We need to acquire a lock before signal a condition.
Otherwise threads waiting on a condition variable can
miss a signal.

Consider two threads: Thread A executing dec() and thread
B executing sync(). The initial value of _count is 1. If
these two threads are interleaved in the following order,
thread B misses the signal sent by thread A, because at the
time thread A sends a signal, B is not waiting for it.

  Thread A                 |   Thread B
                           |   std::unique_lock<std::mutex> lock(_condMut);
                           |   while (!(_count == 0)) {
  if (--_count == 0)       |
    _cond_notify_all()     |
                           |     _cond.wait();
                           |   }

Note that "wait(lock, pred)" is equivalent to "while(!pred())
wait(lock)", so I expanded it in the above example.

Reviewers: Bigcheese

CC: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181484 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Add comments to InputFiles::searchLibraries() arguments.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181492 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Use range based for loop instead of explicit iterators (no functionality change)

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181503 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Fix wrong comment.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181547 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Fix broken test. -layout-pass option does not exist.

Also shuffle the atoms so that it can verify the layout pass
actually changed the layout.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181573 91177308-0d34-0410-b5e6-96231b3b80d8
[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.


git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181605 91177308-0d34-0410-b5e6-96231b3b80d8
[lld][ELF] set ordinals for mergeAtoms and fix testcase

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181622 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Document about how to enable debug output.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181640 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Fix typo in document.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181652 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Add help text for -flavor option.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181655 91177308-0d34-0410-b5e6-96231b3b80d8
[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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181749 91177308-0d34-0410-b5e6-96231b3b80d8
[lld][LayoutPass] Fix a bug that caused buildbot to fail on some platforms.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181752 91177308-0d34-0410-b5e6-96231b3b80d8
[lld][LayoutPass] Cleanup: replace (*atom).size() with atom->size().

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181804 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Allow flags other than -std= in CMAKE_CXX_FLAGS. Also simplify the IF conditions.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181822 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Fix compiler warning that shift count is too big on P64.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@181852 91177308-0d34-0410-b5e6-96231b3b80d8
[lld] Fix inconsistent style and do cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@182031 91177308-0d34-0410-b5e6-96231b3b80d8