summaryrefslogtreecommitdiffstats
path: root/lld/include
Commit message (Collapse)AuthorAgeFilesLines
* [lld] Fix trivial typos in commentsKazuaki Ishizaki2020-01-064-4/+4
| | | | | | Reviewed By: ruiu, MaskRay Differential Revision: https://reviews.llvm.org/D72196
* LLD: Don't use the stderrOS stream in link before it's reassigned.James Y Knight2019-11-211-2/+0
| | | | | | | | | | | | | | | | Remove the lld::enableColors function, as it just obscures which stream it's affecting, and replace with explicit calls to the stream's enable_colors. Also, assign the stderrOS and stdoutOS globals first in link function, just to ensure nothing might use them. (Either change individually fixes the issue of using the old stream, but both together seems best.) Follow-up to b11386f9be9b2dc7276a758d64f66833da10bdea. Differential Revision: https://reviews.llvm.org/D70492
* Fix Windows buildbotsRui Ueyama2019-11-181-5/+5
| | | | | `stdout` and `stderr` might be defined as macros, so we needed to avoid using them as variable names.
* Make it possible to redirect not only errs() but also outs()Rui Ueyama2019-11-183-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* typo fix test commitLLVM GN Syncbot2019-10-221-1/+1
|
* fix a few typos to test git committingNico Weber2019-10-221-2/+2
|
* [LLD] Move duplicated dwarf parsing code to the Common library. NFC.Martin Storsjo2019-10-211-0/+47
| | | | | | Differential Revision: https://reviews.llvm.org/D69197 llvm-svn: 375390
* Move endian constant from Host.h to SwapByteOrder.h, prune includeReid Kleckner2019-10-192-0/+2
| | | | | | | | | | | | | | Works on this dependency chain: ArrayRef.h -> Hashing.h -> --CUT-- Host.h -> StringMap.h / StringRef.h ArrayRef is very popular, but Host.h is rarely needed. Move the IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are more likely to need it. llvm-svn: 375316
* [LLD] Simplify the demangleItanium function. NFC.Martin Storsjo2019-09-271-2/+2
| | | | | | | | | Instead of returning an optional, just return the input string if demangling fails, as that's what all callers use anyway. Differential Revision: https://reviews.llvm.org/D68015 llvm-svn: 373077
* [LLD] [COFF] Use the unified llvm demangle frontend function. NFC.Martin Storsjo2019-09-271-1/+0
| | | | | | | | Add test cases for some cases where we don't want demangling to happen. Differential Revision: https://reviews.llvm.org/D67301 llvm-svn: 373075
* [LLD] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-1/+1
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368936
* Re-submit r367649: Improve raw_ostream so that you can "write" colors using ↵Rui Ueyama2019-08-071-4/+5
| | | | | | | | | operator<< The original patch broke buildbots, perhaps because it changed the default setting whether colors are enabled or not. llvm-svn: 368131
* Revert r367649: Improve raw_ostream so that you can "write" colors using ↵Rui Ueyama2019-08-021-3/+4
| | | | | | | | operator<< This reverts commit r367649 in an attempt to unbreak Windows bots. llvm-svn: 367658
* Improve raw_ostream so that you can "write" colors using operator<<Rui Ueyama2019-08-021-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. raw_ostream supports ANSI colors so that you can write messages to the termina with colors. Previously, in order to change and reset color, you had to call `changeColor` and `resetColor` functions, respectively. So, if you print out "error: " in red, for example, you had to do something like this: OS.changeColor(raw_ostream::RED); OS << "error: "; OS.resetColor(); With this patch, you can write the same code as follows: OS << raw_ostream::RED << "error: " << raw_ostream::RESET; 2. Add a boolean flag to raw_ostream so that you can disable colored output. If you disable colors, changeColor, operator<<(Color), resetColor and other color-related functions have no effect. Most LLVM tools automatically prints out messages using colors, and you can disable it by passing a flag such as `--disable-colors`. This new flag makes it easy to write code that works that way. Differential Revision: https://reviews.llvm.org/D65564 llvm-svn: 367649
* [ELF] With --vs-diagnostics, print a separate message for each location of a ↵Igor Kudrin2019-08-011-0/+2
| | | | | | | | | | | | | duplicate symbol. We extract and print the source location in the message header so that Visual Studio is able to parse it and jump there. As duplicate symbols are defined in several locations, it is more convenient to have separate error messages, which allows a user to easily access all the locations. Differential Revision: https://reviews.llvm.org/D65213 llvm-svn: 367536
* [ELF] Support explicitly overriding relocation model in LTOPetr Hosek2019-07-201-0/+1
| | | | | | | | lld currently selects the relocation model automatically depending on the link flags specified, but in some cases it'd be useful to allow explicitly overriding the relocation model using a flag. llvm-svn: 366644
* [lld] Add Visual Studio compatible diagnosticsChris Jackson2019-07-171-1/+2
| | | | | | | | | | | | Summary: Add a --vs-diagnostics flag that alters the format of diagnostic output to enable source hyperlinks in Visual Studio. Differential Revision: https://reviews.llvm.org/D58484 Reviewed by: ruiu llvm-svn: 366333
* [Coding style change][lld] Rename variables for non-ELF portsRui Ueyama2019-07-119-108/+108
| | | | | | | | | | | This patch does the same thing as r365595 to other subdirectories, which completes the naming style change for the entire lld directory. With this, the naming style conversion is complete for lld. Differential Revision: https://reviews.llvm.org/D64473 llvm-svn: 365730
* [lld] Allow args::getInterger to parse args larger than 2^31-1Sam Clegg2019-06-071-1/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D62933 llvm-svn: 362770
* [WebAssebmly] Add support for --wrapSam Clegg2019-05-241-0/+2
| | | | | | | | | | | The code for implementing this features is taken almost verbatim from the ELF backend. Fixes: https://bugs.llvm.org/show_bug.cgi?id=41681 Differential Revision: https://reviews.llvm.org/D62380 llvm-svn: 361639
* Fail early if an output file is not writableRui Ueyama2019-03-111-0/+20
| | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=36478 Differential Revision: https://reviews.llvm.org/D43664 llvm-svn: 355834
* [LLD][COFF] Support /threads[:no] like the ELF driverAlexandre Ganea2019-02-271-0/+7
| | | | | | Differential review: https://reviews.llvm.org/D58594 llvm-svn: 355029
* Remove a function from header and move the implementation to a .cpp file. NFC.Rui Ueyama2019-02-221-4/+0
| | | | llvm-svn: 354703
* Fix names of functions in TargetOptionsCommandFlags.h. NFC.Sam Clegg2019-02-011-4/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D57555 llvm-svn: 352825
* [LTO] Set CGOptLevel in LTO config.Sam Clegg2019-01-301-0/+5
| | | | | | | | | Previously we were never setting this which means it was always being set to Default (-O2/-Os). Differential Revision: https://reviews.llvm.org/D57422 llvm-svn: 352667
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1933-132/+99
| | | | | | | | | | | | | | | | | 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
* lld/include/lld/Core/TODO.txtNico Weber2019-01-141-14/+0
| | | | | | | | | | | - fix minor grammar stuff (I'm not a native speaker either, but it's hopefully a net improvement) - mention that lld/coff is used in production - update AArch64, ARM to production quality - remove lld/include/lld/Core/TODO.txt which looks outdated Differential Revision: https://reviews.llvm.org/D56600 llvm-svn: 351030
* [WebAssembly] Add support for the event sectionHeejin Ahn2018-12-081-0/+4
| | | | | | | | | | | | | | | | | Summary: This adds support for the 'event section' specified in the exception handling proposal. Wasm exception handling binary model spec: https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model Reviewers: sbc100, ruiu Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54875 llvm-svn: 348703
* clang-format LLVM.h (NFC)Heejin Ahn2018-12-071-54/+54
| | | | | | | | | | | | | | Summary: - LLVM style does not indent inside namespaces - Alphabetize Reviewers: ruiu Subscribers: sbc100, llvm-commits Differential Revision: https://reviews.llvm.org/D55406 llvm-svn: 348652
* Remove SaveAndRestore and SmallVectorImpl from lld/Common/LLVM.h. NFC.Rui Ueyama2018-11-271-17/+4
| | | | llvm-svn: 347680
* [WebAssembly] Remove `using` statements from header files. NFC.Sam Clegg2018-11-271-0/+25
| | | | | | Differential Revision: https://reviews.llvm.org/D54758 llvm-svn: 347621
* [Common] Threads: use function_ref instead of std::functionFangrui Song2018-11-271-1/+1
| | | | | | | | | | | | | | | | | The benefits are: a) Performance (very minor): it removes a heap allocation of the std::function constructor (template<class F> function(F f)) b) Clarity: it suggests that the callable's lifetime should end after the callee returns. Such callback is widely used in llvm. lld also uses it a lot. Reviewers: ruiu, rnk, pcc Reviewed By: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54813 llvm-svn: 347620
* Set MAttrs in LTO modeFangrui Song2018-11-011-0/+1
| | | | | | | | | | | | | | | | Summary: Without this patch, MAttrs are not set. Patch by Yin Ma Reviewers: espindola, MaskRay, ruiu, pcc Reviewed By: MaskRay, pcc Subscribers: pcc, emaste, sbc100, inglorion, arichardson, aheejin, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D53446 llvm-svn: 345884
* Use llvm::arrayRefFromStringRefSam Clegg2018-10-221-3/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D53432 llvm-svn: 344888
* Add paretntheses around a C macro parameter.Rui Ueyama2018-09-201-1/+1
| | | | llvm-svn: 342673
* Rename a function to follow the LLVM coding style.Rui Ueyama2018-08-271-1/+1
| | | | llvm-svn: 340716
* win: Omit ".exe" from lld warning and error messages.Nico Weber2018-08-221-0/+3
| | | | | | | | | | | This is a minor follow-up to https://reviews.llvm.org/D49189. On Windows, lld used to print "lld-link.exe: error: ...". Now it just prints "lld-link: error: ...". This matches what link.exe does (it prints "LINK : ...") and makes lld's output less dependent on the host system. https://reviews.llvm.org/D51133 llvm-svn: 340487
* [Darwin] Use errorHandler from liblldCommonBrian Gesiak2018-06-124-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Expand the file comment for the error handlers.Rui Ueyama2018-06-071-11/+52
| | | | | | Differential Revision: https://reviews.llvm.org/D47790 llvm-svn: 334148
* Code cleanup in preparation for adding LTO for wasm. NFC.Sam Clegg2018-05-222-1/+11
| | | | | | | | | | | | | | - Move some common code into Common/rrorHandler.cpp and Common/Strings.h. - Don't use `fatal` when incompatible bitcode files are encountered. - Rename NameRef variable to just Name See D47162 Differential Revision: https://reviews.llvm.org/D47206 llvm-svn: 333021
* Remove \brief commands from doxygen comments.Fangrui Song2018-05-1512-74/+74
| | | | | | | | | | | | Summary: This is similar to D46290 D46320. Reviewers: ruiu, grimar Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D46861 llvm-svn: 332372
* Migrate from std::pointer_to_unary_function as it is removed in C++17Fangrui Song2018-04-281-4/+2
| | | | llvm-svn: 331097
* Remove unused features from StringRefZ and move it to Symbols.h.Rui Ueyama2018-04-251-33/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D46087 llvm-svn: 330879
* Pack symbols a bit more.Rafael Espindola2018-04-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Before this patch: Symbol 56 Defined 80 Undefined 56 SharedSymbol 88 LazyArchive 72 LazyObject 56 With this patch Symbol 48 Defined 72 Undefined 48 SharedSymbol 80 LazyArchive 64 LazyObject 48 The result is that peak allocation when linking chromium (according to heaptrack) goes from 578 to 568 MB. llvm-svn: 330874
* Merge {COFF,ELF}/Strings.cpp to Common/Strings.cpp.Rui Ueyama2018-02-281-0/+53
| | | | | | | | | This should resolve the issue that lld build fails in some hosts that uses case-insensitive file system. Differential Revision: https://reviews.llvm.org/D43788 llvm-svn: 326339
* Re-land: "[Support] Replace HashString with djbHash."Jonas Devlieghere2018-02-261-2/+2
| | | | | | | | | | | | | | | | | | | | | This patch removes the HashString function from StringExtraces and replaces its uses with calls to djbHash from DJB.h. This change is *almost* NFC. While the algorithm is identical, the djbHash implementation in StringExtras used 0 as its default seed while the implementation in DJB uses 5381. The latter has been shown to result in less collisions and improved avalanching and is used by the DWARF accelerator tables. Because some test were implicitly relying on the hash order, I've reverted to using zero as a seed for the following two files: lld/include/lld/Core/SymbolTable.h llvm/lib/Support/StringMap.cpp Differential revision: https://reviews.llvm.org/D43615 llvm-svn: 326091
* Revert "[Support] Replace HashString with djbHash."Jonas Devlieghere2018-02-261-2/+2
| | | | | | | | | | | | | It looks like some of our tests depend on the ordering of hashed values. I'm reverting my changes while I try to reproduce and fix this locally. Failing builds: lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/18388 lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/6743 lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/15607 llvm-svn: 326082
* [Support] Replace HashString with djbHash.Jonas Devlieghere2018-02-261-2/+2
| | | | | | | | | | | | | | | This removes the HashString function from StringExtraces and replaces its uses with calls to djbHash from DJB.h This is *almost* NFC. While the algorithm is identical, the djbHash implementation in StringExtras used 0 as its seed while the implementation in DJB uses 5381. The latter has been shown to result in less collisions and improved avalanching. https://reviews.llvm.org/D43615 (cherry picked from commit 77f7f965bc9499a9ae768a296ca5a1f7347d1d2c) llvm-svn: 326081
* Pass CPU string to LTO pipeline.Rafael Espindola2018-01-301-0/+1
| | | | | | | | | | Previously an empty CPU string was passed to the LTO engine which resulted in a generic CPU for which certain features like NOPL were disabled. This fixes that. Patch by Pratik Bhatu! llvm-svn: 323801
* [coff] Print detailed timing information with /TIME.Zachary Turner2018-01-171-0/+59
| | | | | | | | | The classes used to print and update time information are in common, so other linkers could use this as well if desired. Differential Revision: https://reviews.llvm.org/D41915 llvm-svn: 322736
OpenPOWER on IntegriCloud