- Jan 12, 2017
-
-
George Rimar authored
Intention of change is to get rid of code duplication. Decompressor was introduced in D28105. Change allows to get rid of few methods relative to decompression. Differential revision: https://reviews.llvm.org/D28106 llvm-svn: 291758
-
- Nov 24, 2016
-
-
Rui Ueyama authored
llvm-svn: 287850
-
Rui Ueyama authored
HasError was always true if ErrorCount > 0, so we can use ErrorCount instead. llvm-svn: 287849
-
- Nov 23, 2016
-
-
Rui Ueyama authored
This is in the context of https://llvm.org/bugs/show_bug.cgi?id=31109. When LLD prints out errors for relocations, it tends to print out extremely large number of errors (like millions) because it would print out one error per relocation. This patch makes LLD bail out if it prints out more than 20 errors. You can configure the limitation using -error-limit argument. -error-limit=0 means no limit. I chose the flag name because Clang has the same feature as -ferror-limit. "f" doesn't make sense to us, so I omitted it. Differential Revision: https://reviews.llvm.org/D26981 llvm-svn: 287789
-
- Nov 16, 2016
-
-
Rui Ueyama authored
Also add a comment saying that check() returns a value. llvm-svn: 287136
-
Davide Italiano authored
llvm-svn: 287082
-
- Nov 12, 2016
-
-
Rui Ueyama authored
llvm-svn: 286698
-
- Oct 27, 2016
-
-
Rafael Espindola authored
Instead of having 3 section allocators per file, have 3 for all files. This is a substantial performance improvement for some cases. Linking chromium without gc speeds up by 1.065x. This requires using _exit in fatal since we have to avoid destructing an InputSection if fatal is called from the constructor. Thanks to Rui for the suggestion. llvm-svn: 285290
-
- Oct 19, 2016
-
-
Rui Ueyama authored
This is what other linkers and clang driver do. Differential Revision: https://reviews.llvm.org/D25780 llvm-svn: 284634
-
- Oct 07, 2016
-
-
George Rimar authored
createELFObj() may call error(...), for example when file is too short. In that case header is not set and following line lead to crash: EMachine = ELFObj.getHeader()->e_machine; Patch fixes the issue. Differential revision: https://reviews.llvm.org/D25233 llvm-svn: 283532
-
- Oct 06, 2016
-
-
Rui Ueyama authored
llvm-svn: 283488
-
- Sep 29, 2016
-
-
Rui Ueyama authored
We have a few "check" functions in Error.h. All of them are to check for an error and strip an error object if there was no error, except "void check(Error E)", which doesn't return anything. This patch renames it and moves it to the .cpp file where it is used. llvm-svn: 282764
-
Rui Ueyama authored
It's better because it's a verb. llvm-svn: 282763
-
Rui Ueyama authored
llvm-svn: 282664
-
Davide Italiano authored
Differential Revision: https://reviews.llvm.org/D24492 llvm-svn: 282656
-
- Sep 16, 2016
-
-
Rui Ueyama authored
llvm-svn: 281671
-
- Jul 15, 2016
-
-
Rui Ueyama authored
This patch corresponds to r275511 for COFF. llvm-svn: 275521
-
- Jul 14, 2016
-
-
Lang Hames authored
llvm-svn: 275362
-
- Jun 29, 2016
-
-
Kevin Enderby authored
Matching change for lld for the llvm change of Archive::create() from ErrorOr<...> to Expected<...> in r274160. llvm-svn: 274161
-
- May 04, 2016
-
-
Rafael Espindola authored
This is both simpler and safer. If we crash at any point, there is a valid cpio file to reproduce the crash. Thanks to Rui for the suggestion. llvm-svn: 268495
-
- May 03, 2016
-
-
Rafael Espindola authored
We want --reproduce to * not rewrite scripts and thin archives * work with absolute paths Given that, it pretty much has to create a full directory tree. On windows that is problematic because of the very short maximum path limit. On most cases users can still work around it with "--repro c:\r", but that is annoying and not viable for automated testing. We then need to produce some form of archive with the files. The first option that comes to mind is .a files since we already have code for writing them. There are a few problems with them The format has a dedicated string table, so we cannot start writing it until all members are known. Regular implementations don't support creating directories. We could make llvm-ar support that, but that is probably not a good idea. The next natural option would be tar. The problem is that to support long path names (which is how this started) it needs a "pax extended header" making this an annoying format to write. The next option I looked at seems a natural fit: cpio files. They are available on pretty much every unix, support directories and long path names and are really easy to write. The only slightly annoying part is a terminator, but at least gnu cpio only prints a warning if it is missing, which is handy for crashes. This patch still makes an effort to always create it. llvm-svn: 268404
-
- Apr 20, 2016
-
-
Kevin Enderby authored
Needed change to lld for the change to libObject’s getName() for symbols now returning Expected<...> With the llvm change in r266919 this is the matching needed change to the lld code now that libObject’s getName() for symbols now returning Expected<...> . llvm-svn: 266920
-
- Mar 13, 2016
-
-
Rui Ueyama authored
llvm-svn: 263363
-
Rui Ueyama authored
error returned true if there was an error. This allows us to replace the code like this if (EC) { error(EC, "something failed"); return; } with if (error(EC, "something failed")) return; I thought that that was a good idea, but it turned out that we only have two places to use this pattern. So this patch removes that feature. llvm-svn: 263362
-
- Mar 03, 2016
-
-
Rafael Espindola authored
llvm-svn: 262666
-
Rui Ueyama authored
llvm-svn: 262662
-
Rafael Espindola authored
llvm-svn: 262653
-
Rafael Espindola authored
This makes fatal return T when there is no error. This avoids the need for quite a few temporaries. llvm-svn: 262626
-
- Feb 28, 2016
-
-
Rafael Espindola authored
llvm-svn: 262159
-
- Feb 25, 2016
-
-
Rui Ueyama authored
llvm-svn: 261919
-
- Feb 02, 2016
-
-
Rui Ueyama authored
http://reviews.llvm.org/D16668 llvm-svn: 259597
-
Rui Ueyama authored
This reverts r259395 which reverted r259143. llvm-svn: 259572
-
- Feb 01, 2016
-
-
Nico Weber authored
llvm-svn: 259395
-
- Jan 29, 2016
-
-
Rui Ueyama authored
This patch let the driver keep going until it parses all command line options. http://reviews.llvm.org/D16645 llvm-svn: 259143
-
- Jan 28, 2016
-
-
Rui Ueyama authored
In many situations, we don't want to exit at the first error even in the process model. For example, it is better to report all undefined symbols rather than reporting the first one that the linker picked up randomly. In order to handle such errors, we don't need to wrap everything with ErrorOr (thanks for David Blaikie for pointing this out!) Instead, we can set a flag to record the fact that we found an error and keep it going until it reaches a reasonable checkpoint. This idea should be applicable to other places. For example, we can ignore broken relocations and check for errors after visiting all relocs. In this patch, I rename error to fatal, and introduce another version of error which doesn't call exit. That function instead sets HasError to true. Once HasError becomes true, it stays true, so that we know that there was an error if it is true. I think introducing a non-noreturn error reporting function is by itself a good idea, and it looks to me that this also provides a gradual path towards lld-as-a-library (or at least embed-lld-to-your-program) without sacrificing code readability with lots of ErrorOr's. http://reviews.llvm.org/D16641 llvm-svn: 259069
-
- Sep 24, 2015
-
-
Rui Ueyama authored
Patch from George Rimar! llvm-svn: 248524
-
- Aug 14, 2015
-
-
Rafael Espindola authored
llvm-svn: 245050
-
- Aug 06, 2015
-
-
Rafael Espindola authored
llvm-svn: 244216
-
Rafael Espindola authored
This has a few advantages * Less C++ code (about 300 lines less). * Less machine code (about 14 KB of text on a linux x86_64 build). * It is more debugger friendly. Just set a breakpoint on the exit function and you get the complete lld stack trace of when the error was found. * It is a more robust API. The errors are handled early and we don't get a std::error_code hot potato being passed around. * In most cases the error function in a better position to print diagnostics (it has more context). llvm-svn: 244215
-
- Jun 01, 2015
-
-
Denis Protivensky authored
This is a follow-on to r238732 llvm-svn: 238733
-