summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core
Commit message (Collapse)AuthorAgeFilesLines
* [lld] Fix trivial typos in commentsKazuaki Ishizaki2020-01-061-1/+1
| | | | | | Reviewed By: ruiu, MaskRay Differential Revision: https://reviews.llvm.org/D72196
* Revert "Fix shared lib build."Rui Ueyama2019-11-191-3/+2
| | | | | | | This reverts commit 17e37ba57a696198c9744eeba4f8f293f155587a because it introduced a circular dependency between Core and Common. Because d0371f473675ede1d79a615ec4fdf0cf5368944c fixed a build issue, we no longer need that dependency.
* Fix component buildRui Ueyama2019-11-192-18/+18
| | | | | b11386f9be9b2dc7276a758d64f66833da10bdea broke lld build if `-DBUILD_SHARED_LIBS=ON` is passed to CMake.
* Fix shared lib build.Michael Liao2019-11-181-2/+3
|
* Make it possible to redirect not only errs() but also outs()Rui Ueyama2019-11-182-25/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is for those who use lld as a library. Context: https://reviews.llvm.org/D70287 This patch adds a new parmeter to lld::*::link() so that we can pass an raw_ostream object representing stdout. Previously, lld::*::link() took only an stderr object. Justification for making stdoutOS and stderrOS mandatory: I wanted to make link() functions to take stdout and stderr in that order. However, if we change the function signature from bool link(ArrayRef<const char *> args, bool canExitEarly, raw_ostream &stderrOS = llvm::errs()); to bool link(ArrayRef<const char *> args, bool canExitEarly, raw_ostream &stdoutOS = llvm::outs(), raw_ostream &stderrOS = llvm::errs()); , then the meaning of existing code that passes stderrOS silently changes (stderrOS would be interpreted as stdoutOS). So, I chose to make existing code not to compile, so that developers can fix their code. Differential Revision: https://reviews.llvm.org/D70292
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-198-32/+24
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Darwin] Use errorHandler from liblldCommonBrian Gesiak2018-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Error handling in liblldCore and the Darwin toolchain prints to an output stream. A TODO in the project explained that a diagnostics interface resembling Clang's should be added. For now, the simple diagnostics interface defined in liblldCommon seems like an improvement. It prints colors when they're available, uses locks for thread-safety, and abstracts away the `"error: "` and newline literal strings that litter the Darwin toolchain code. To use the liblldCommon error handler, a link dependency is added to the liblldDriver library. Test Plan: 1. check-lld 2. Invoke `ld64.lld -r` in a terminal that supports color output. Confirm that "ld64.lld: error: -arch not specified and could not be inferred" is output, and that the "error:" is colored red! Reviewers: ruiu, smeenai Reviewed By: ruiu Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D47998 llvm-svn: 334466
* 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
OpenPOWER on IntegriCloud