summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core
Commit message (Collapse)AuthorAgeFilesLines
* Move new lld's code to Common subdirectory.Rui Ueyama2017-10-025-104/+4
| | | | | | | | | | New lld's files are spread under lib subdirectory, and it isn't easy to find which files are actually maintained. This patch moves maintained files to Common subdirectory. Differential Revision: https://reviews.llvm.org/D37645 llvm-svn: 314719
* Update for llvm change.Rafael Espindola2017-08-031-2/+2
| | | | llvm-svn: 309913
* Use StringRef::contains().Rui Ueyama2017-07-191-3/+3
| | | | llvm-svn: 308526
* Add BinaryFormat to lld librariesSam Clegg2017-06-071-1/+2
| | | | | | | | | | | | Without this, when building with shared BUILD_SHARED_LIBS=ON I get errors such as: lib/Core/Reader.cpp:40: error: undefined reference to 'llvm::identify_magic(llvm::StringRef)' Differential Revision: https://reviews.llvm.org/D34004 llvm-svn: 304932
* Removed the redundant comment. NFC.Galina Kistanova2017-06-071-1/+0
| | | | llvm-svn: 304874
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-071-0/+1
| | | | llvm-svn: 304873
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-071-1/+5
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* [Support] Move Parallel algorithms from LLD to LLVM.Zachary Turner2017-05-112-142/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D33024 llvm-svn: 302748
* Rename variables to conform to LLVM naming conventions.Zachary Turner2017-05-101-5/+5
| | | | llvm-svn: 302697
* Fix undefined pthread references when building against libc++Eric Fiselier2017-05-061-0/+3
| | | | llvm-svn: 302363
* Fix build breakage on Linux.Rui Ueyama2017-05-051-0/+1
| | | | llvm-svn: 302295
* Fix #include case sensitivity problem.Zachary Turner2017-05-051-1/+1
| | | | llvm-svn: 302291
* Split up Parallel and LLVM'ize naming conventions.Zachary Turner2017-05-052-0/+141
| | | | | | | | | | | | This is one step in preparation of raising this up to LLVM. This hides all of the Executor stuff in a private implementation file, leaving only the core algorithms and the TaskGroup class exposed. In doing so, fix up all the variable names to conform to LLVM style. Differential Revision: https://reviews.llvm.org/D32890 llvm-svn: 302288
* [ELF] - Allow the Code Model flag when using LTOMartell Malone2017-02-281-0/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D29445 llvm-svn: 296542
* Fix shared build after r293965 (Core) and r293967 (COFF)Ismail Donmez2017-02-031-0/+1
| | | | llvm-svn: 293996
* added missing dependency on intrinsics_gen to lib/CoreBob Haarman2017-02-031-0/+7
| | | | llvm-svn: 293986
* added missing files for r293965Bob Haarman2017-02-021-0/+28
| | | | llvm-svn: 293966
* add the ability to call InitTargetOptionsFromCodeGenFlags from multiple objectsBob Haarman2017-02-021-0/+1
| | | | | | | | | | | | | | Summary: llvm/CodeGen/CommandFlags.h a utility function InitTargetOptionsFromCodeGenFlags which is used to set target options from flags based on the command line. The command line flags are stored in globals defined in the same file, and including the file in multiple places causes the globals to be defined multiple times, leading to linker errors. This change adds a single place in lld where these globals are defined and exports only the utility function. This makes it possible to call InitTargetOptionsFromCodeGenFlags from multiple places in lld, which a follow-up change will do. Reviewers: davide, ruiu Reviewed By: davide, ruiu Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D29058 llvm-svn: 293965
* [lld][cmake] Fix LLVM_LINK_LLVM_DYLIB buildPavel Labath2017-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: Lld's build had a couple of issues which prevented a successfull LLVM_LINK_LLVM_DYLIB compilation. - add_llvm_library vs llvm_add_library: One adds a library to libLLVM.so, other one doesn't. Lld was using the wrong one, causing symbols to be mupltiply defined in things linking to libLLVM. - confusion when to use LINK_LIBS vs LINK_COMPONENTS in llvm_add_library - not using LLVM_LINK_COMPONENTS for add_lld_tool With these fixes lld compiles and it's test suite passes both in LLVM_LINK_LLVM_DYLIB mode and without it. Reviewers: ruiu, beanz Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28397 llvm-svn: 291432
* Define sys::path::convert_to_slashRui Ueyama2017-01-091-11/+1
| | | | | | | | This patch moves convertToUnixPathSeparator from LLD to LLVM. Differential Revision: https://reviews.llvm.org/D28444 llvm-svn: 291414
* Revert r291221.Rafael Espindola2017-01-061-1/+11
| | | | | | Should bring back the windows bots. llvm-svn: 291263
* Rename lld::stringize -> lld::toString.Rui Ueyama2017-01-061-1/+1
| | | | llvm-svn: 291223
* Remove lld::convertToUnixPathSeparator.Rui Ueyama2017-01-061-11/+1
| | | | | | | Now TarWriter takes care of path separator conversion, so we don't need to handle that in LLD. llvm-svn: 291221
* Use TarWriter to create tar archives instead of cpio.Rui Ueyama2017-01-061-54/+2
| | | | | | | | | | This is how we use TarWriter in LLD. Now LLD does not append a file extension, so you need to pass `--reproduce foo.tar` instead of `--reproduce foo`. Differential Revision: https://reviews.llvm.org/D28103 llvm-svn: 291210
* Fix Windows buildbots.Rui Ueyama2016-12-071-1/+1
| | | | llvm-svn: 288975
* Make convertToUnixPathSeparator return a new string instead of mutating ↵Rui Ueyama2016-12-071-7/+8
| | | | | | argument. llvm-svn: 288972
* [ELF] - Print absolute file name in errors when possible.George Rimar2016-12-071-8/+6
| | | | | | | | | | | | | | | | | | | Currently LLD prints basename of source file name in error messages, for example: $ mkdir foo $ echo 'void _start(void) { foobar(); }' > foo/bar.c $ gcc -g -c foo/bar.c $ bin/ld.lld -o out bar.o bin/ld.lld: error: bar.c:1: undefined symbol 'foobar' $ This should say: bin/ld.lld: error: foo/bar.c:1: undefined symbol 'foobar' This is PR31299 Differential revision: https://reviews.llvm.org/D27506 llvm-svn: 288966
* [ELF] Don't replace path separators on *NIX.Davide Italiano2016-11-161-0/+2
| | | | | | | | | Apparently this is wrong because it's legal to have a filename on UNIX which contains a backslash. Differential Revision: https://reviews.llvm.org/D26734 llvm-svn: 287143
* [ELF] - Fixed comment. NFC.George Rimar2016-11-121-1/+1
| | | | llvm-svn: 286712
* [ELF] - Use backward slashes inside response filesGeorge Rimar2016-11-111-4/+10
| | | | | | | | | | Patch replaces forward slashes with backward inside response.txt This is https://llvm.org/bugs/show_bug.cgi?id=30951. Differential revision: https://reviews.llvm.org/D26443 llvm-svn: 286589
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-111-1/+1
| | | | | | | | This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
* Create a vector containing all input sections.Rui Ueyama2016-11-051-2/+2
| | | | | | | | | | | | | | | | Previously, we do this piece of code to iterate over all input sections. for (elf::ObjectFile<ELFT> *F : Symtab.getObjectFiles()) for (InputSectionBase<ELFT> *S : F->getSections()) It turned out that this mechanisms doesn't work well with synthetic input sections because synthetic input sections don't belong to any input file. This patch defines a vector that contains all input sections including synthetic ones. llvm-svn: 286051
* Fix some Clang-tidy modernize-use-default and Include What You Use warnings; ↵Eugene Zelenko2016-11-053-12/+10
| | | | | | | | other minor fixes. Differential revision: https://reviews.llvm.org/D26320 llvm-svn: 286030
* Fix some Clang-tidy modernize-use-default and Include What You Use warnings; ↵Eugene Zelenko2016-11-041-5/+6
| | | | | | | | other minor fixes. Differential revision: https://reviews.llvm.org/D26293 llvm-svn: 286000
* Use noexcept directly now that all compilers support itReid Kleckner2016-10-191-2/+2
| | | | llvm-svn: 284671
* [Core] Retire yet another unused member function.Davide Italiano2016-08-121-6/+0
| | | | | | The code in lib/ could use a lot of love :( llvm-svn: 278506
* [Core] Simplify a bit. NFCI.Davide Italiano2016-08-121-6/+2
| | | | llvm-svn: 278505
* [Core] Retire addReplacement() member function.Davide Italiano2016-08-111-5/+0
| | | | llvm-svn: 278327
* [Core] tentativeDefinition() is now unused.Davide Italiano2016-08-101-13/+0
| | | | llvm-svn: 278181
* Unpollute the global namespace. lld edition.Benjamin Kramer2016-08-061-0/+2
| | | | llvm-svn: 277926
* [MachO/Core] Remove (now) unused static member function. NFCI.Davide Italiano2016-08-041-12/+0
| | | | llvm-svn: 277760
* Add qualification to fix MSVC build.Peter Collingbourne2016-07-261-1/+1
| | | | llvm-svn: 276720
* COFF: Implement /linkrepro flag.Peter Collingbourne2016-07-262-0/+122
| | | | | | | | | | | | | | | | This flag is implemented similarly to --reproduce in the ELF linker. This patch implements /linkrepro by moving the cpio writer and associated utility functions to lldCore, and using that implementation in both linkers. One COFF-specific detail is that we store the object file from which the resource files were created in our reproducer, rather than the resource files themselves. This allows the reproducer to be used on non-Windows systems for example. Differential Revision: https://reviews.llvm.org/D22418 llvm-svn: 276719
* Remove unused variants of make_dynamic_error_code. NFC.Pete Cooper2016-03-311-8/+0
| | | | | | | | | | | | | | | | | make_dynamic_error_code was used to create a std::error_code with a std::string message. Now that we are migrating to llvm::Error, there are no calls to these make_dynamic_error_code methods. There is one single call to make_dynamic_error_code remaining, the one inside GenericError::convertToErrorCode(). That method is only called from File::doParse() which should be a temporary situation. We need to work out how to deal with File::parse() caching the error result from doParse(). Caching errors isn't supported in the new scheme, and probably isn't needed here, but we need to work that out. Once thats done, dynamic error and all utilities around it can be deleted. llvm-svn: 264982
* Convert lld file writing to llvm::Error. NFC.Pete Cooper2016-03-301-1/+1
| | | | | | | This converts the writeFile method, as well as some of the ones it calls in the normalized binary file writer and yaml writer. llvm-svn: 264961
* Fix -Wpessimizing-move warnings.Rui Ueyama2016-03-301-2/+2
| | | | llvm-svn: 264951
* Convert file handle* methods to llvm::Error instead of std::error_code. NFC.Pete Cooper2016-03-301-22/+31
| | | | | | | This updates most of the file handling methods in the linking context and resolver to use the new API. llvm-svn: 264924
* Change getReferenceInfo/getPairReferenceInfo to use new Error handling. NFC.Pete Cooper2016-03-301-0/+8
| | | | | | | | | | | | Adds a GenericError class to lld/Core which can carry a string. This is analygous to the dynamic_error we currently use in lld/Core. Use this GenericError instead of make_dynamic_error_code. Also, provide an implemention of GenericError::convertToErrorCode which for now converts it in to the dynamic_error_code we used to have. This will go away once all the APIs are converted. llvm-svn: 264910
* Remove dead flags.Rui Ueyama2016-03-281-35/+11
| | | | | | | | | | | searchArchivesToOverrideTentativeDefinitions and searchSharedLibrariesToOverrideTentativeDefinitions are always false. For the dead flags, we have a fairly large amount of code which is never be executed. http://reviews.llvm.org/D17791 llvm-svn: 264653
* Use owning pointers instead of raw pointers for Atom's to fix leaks.Pete Cooper2016-03-222-72/+71
| | | | | | | | | | | | | | | | | | | | | | | | This is a re-commit of r264022 with a fix for MSVC. The issue there was that the code was running DefinedAtom::~Atom() for some value and instead needed to cast to Atom before running ~Atom. Original commit message follows. Currently each File contains an BumpPtrAllocator in which Atom's are allocated. Some Atom's contain data structures like std::vector which leak as we don't run ~Atom when they are BumpPtrAllocate'd. Now each File actually owns its Atom's using an OwningAtomPtr. This is analygous to std::unique_ptr and may be replaced by it if possible. An Atom can therefore only be owned by a single File, so the Resolver now moves them from one File to another. The MachOLinkingContext owns the File's and so clears all the Atom's in ~MachOLinkingContext, then delete's all the File's. This makes sure all Atom's have been destructed before any of the BumpPtrAllocator's in which they run have gone away. Should hopefully fix the remaining leaks. Will keep an eye on the bots to make sure. llvm-svn: 264067
OpenPOWER on IntegriCloud