hanchenye-llvm-project/lld
Chandler Carruth c9cdc502f3 Fix a comparison function to actually be a SWO so that it conforms to
the spec required by std::sort and friends.

Ordering things this way also dramatically simplifies the code as
short-circuit ensures we can skip all of the negative tests.

I've left one FIXME where we're establishing a fairly arbitrary
ordering. Previously, the function compared all types as equal except
for the ones it explicitly handled, but it didn't delegate correctly to
the atomflags when doing so, and so it would fail to be a SWO. The two
possible fixes are to stop comparing the atom flags entirely, or to
establish some arbitrary ordering of the types.

Since it was pure luck which ordering of unequal types we ended up with
previously (the caller was std::sort, not std::stable_sort) I chose to
make the ordering explicit and guaranteed. This seems like the best
conservative approach as I suspect we would want to switch to
stable_sort otherwise in order to have deterministic output.

Differential Revision: http://reviews.llvm.org/D8266

llvm-svn: 231968
2015-03-11 21:34:33 +00:00
..
cmake/modules
docs Fix five of the shared library build targets 2015-01-21 22:54:56 +00:00
include LinkerScript: Add parsing of the MEMORY command 2015-03-11 15:34:44 +00:00
lib Fix a comparison function to actually be a SWO so that it conforms to 2015-03-11 21:34:33 +00:00
test Fix a comparison function to actually be a SWO so that it conforms to 2015-03-11 21:34:33 +00:00
tools Remove YAML/Native round-trip passes. 2015-02-20 22:10:28 +00:00
unittests [LinkerScript] Implement linker script expression evaluation 2015-03-09 21:43:35 +00:00
utils lldReaderWriter.a depends on lldCore.a so make sure 2015-02-05 01:10:40 +00:00
.arcconfig Update Phabricator server. 2014-04-07 04:52:24 +00:00
.clang-format Remove redundant "Standard: Cpp11" tag. The LLVM style has used the 2014-07-04 12:08:03 +00:00
.gitignore Update .gitignore to ignore hidden MacOSX Finder droppings 2014-07-16 21:01:17 +00:00
CMakeLists.txt [CMake] Cleanup 2015-02-27 04:39:16 +00:00
LICENSE.TXT Update the copyright credits -- Happy new year 2014! 2014-01-01 08:27:31 +00:00
Makefile Initial set of Makefiles 2014-06-04 09:54:07 +00:00
README.md

README.md

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.