summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core
Commit message (Collapse)AuthorAgeFilesLines
...
* Mark a few functions noexcept.Rafael Espindola2014-06-101-11/+24
| | | | llvm-svn: 210590
* Add SymbolTable::isCoalescedAwayRui Ueyama2014-06-052-21/+8
| | | | | | | isCoalescedAway(x) is faster than replacement(x) != x as the former does not follow the replacement atom chain. Also it's easier to use. llvm-svn: 210242
* Print error message in LinkOnce handler.Rui Ueyama2014-06-051-14/+12
| | | | | | Rather than outside of the handler function to make the code simple. llvm-svn: 210241
* Initial set of MakefilesIain Sandoe2014-06-041-0/+13
| | | | | | | | This provides support for the autoconfing & make build style. The format, style and implementation follows that used within the llvm and clang projects. TODO: implement out-of-source documentation builds. llvm-svn: 210177
* Fix build breakage.Rui Ueyama2014-06-031-1/+0
| | | | llvm-svn: 210087
* Inline short member function.Rui Ueyama2014-06-031-23/+0
| | | | llvm-svn: 210086
* Remove group-parent references.Rui Ueyama2014-06-031-2/+4
| | | | | | | | | | | | | | | | | | | Previously section groups are doubly linked to their children. That is, an atom representing a group has group-child references to its group contents, and content atoms also have group-parent references to the group atom. That relationship was invariant; if X has a group-child edge to Y, Y must have a group-parent edge to X. However we were not using group-parent references at all. The resolver only needs group-child edges. This patch simplifies the section group by removing the unused reverse edge. No functionality change intended. Differential Revision: http://reviews.llvm.org/D3945 llvm-svn: 210066
* Make dead-striping to handle reverse edges.Rui Ueyama2014-06-031-2/+17
| | | | | | | | | | | | | | | Layout-before edges are no longer used for layout, but they are still there for dead-stripping. If we would just remove them from code, LLD would wrongly remove live atoms that were referenced by layout-befores. This patch fixes the issue. Before dead-stripping, it scans all atoms to construct a reverse map for layout-after edges. Dead- stripping pass uses the map to traverse the graph. Differential Revision: http://reviews.llvm.org/D3986 llvm-svn: 210057
* Simplify markLive().Rui Ueyama2014-06-021-6/+5
| | | | | | | | Reference::target() never returns a nullptr, so NULL check is not needed and is more harmful than doing nothing. No functionality change. llvm-svn: 210008
* There is no std::errc:success, remove the llvm one.Rafael Espindola2014-05-311-5/+5
| | | | llvm-svn: 209958
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-312-2/+2
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209948
* [mach-o] Support parsing of non-lazy-pointer sectionsNick Kledzik2014-05-281-3/+4
| | | | llvm-svn: 209704
* Add make_dynamic_error_code().Nick Kledzik2014-05-271-0/+54
| | | | | | | | | | | This is a short-term fix to allow lld Readers to return error messages with dynamic content. The long term fix will be to enhance ErrorOr<> to work with errors other than error_code. Or to change the interface to Readers to pass down a diagnostics object through which all error messages are written. llvm-svn: 209681
* Move alias symbols from ELFLinkingContext to LinkingContext.Rui Ueyama2014-05-221-2/+22
| | | | | | | | | | Alias symbols are SimpleDefinedAtoms and are platform neutral. They don't have to belong ELF. This patch is to make it available to all platforms. No functionality change intended. Differential Revision: http://reviews.llvm.org/D3862 llvm-svn: 209475
* Simplify nullptr check.Rui Ueyama2014-05-221-7/+4
| | | | llvm-svn: 209357
* Fix regression introduced in r205566.Rui Ueyama2014-05-142-21/+28
| | | | | | | | | | | | | | | In r205566, I made a change to Resolver so that Resolver revisit only archive files in --start-group and --end-group pair. That's not correct, as it also has to revisit DSO files. This patch is to fix the issue. Added a test to demonstrate the fix. I confirmed that it succeeded before r205566, failed after r205566, and is ok with this patch. Differential Revision: http://reviews.llvm.org/D3734 llvm-svn: 208797
* Add observers to Input GraphRui Ueyama2014-05-141-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | Make it possible to add observers to an Input Graph, so that files returned from an Input Graph can be examined before they are passed to Resolver. To implement some PE/COFF features we need to know all the symbols that *can* be solved, including ones in archive files that are not yet to be read. Currently, Resolver only maintains a set of symbols that are already read. It has no knowledge on symbols in skipped files in an archive file. There are many ways to implement that. I chose to apply the observer pattern here because it seems most non-intrusive. We don't want to mess up Resolver with architecture specific features. Even in PE/COFF, the feature that needs this mechanism is minor. So I chose not to modify Resolver, but add a hook to Input Graph. Differential Revision: http://reviews.llvm.org/D3735 llvm-svn: 208753
* Revert "temporary commit."Rui Ueyama2014-05-091-10/+3
| | | | | | This reverts accidental commit r208427. llvm-svn: 208433
* temporary commit.Rui Ueyama2014-05-091-3/+10
| | | | llvm-svn: 208427
* Simplify InputGraph::getNextFile. No functionality change.Rui Ueyama2014-05-071-20/+11
| | | | llvm-svn: 208256
* Expand nested input elements.Rui Ueyama2014-05-061-7/+5
| | | | | | | | Previously only the toplevel elements were expanded by expandElements(). Now we recursively call getReplacements() to expand input elements even if they are in, say, in a group. llvm-svn: 208144
* Don't return value rather than always returning true.Rui Ueyama2014-05-061-2/+1
| | | | | | | addInputElement() never fails, and no one checks its return value except tests. Let's simplify the signature. llvm-svn: 208109
* Return the expression result directly.Rui Ueyama2014-05-021-3/+1
| | | | llvm-svn: 207878
* Don't use "auto" where the actual type is not obvious.Rui Ueyama2014-05-021-2/+2
| | | | llvm-svn: 207875
* Split a utility function not to use goto statement.Rui Ueyama2014-04-041-14/+17
| | | | llvm-svn: 205643
* useNew is set to false in all branches, so set it to false outside the if-else.Rui Ueyama2014-04-041-21/+15
| | | | llvm-svn: 205642
* Replace dyn_cast<T>s immediately followed by asserts with cast<T>s.Rui Ueyama2014-04-041-9/+4
| | | | llvm-svn: 205641
* Fix indentation.Rui Ueyama2014-04-041-34/+28
| | | | llvm-svn: 205639
* Revert "temporary commit."Rui Ueyama2014-04-041-28/+34
| | | | | | This reverts commit r205635 that was submitted by mistake. llvm-svn: 205637
* temporary commit.Rui Ueyama2014-04-041-34/+28
| | | | llvm-svn: 205635
* SymbolTable::size() returns an unsigned int.Rui Ueyama2014-04-041-1/+1
| | | | | | | It's better to use the same type rather than a fixed width integer type that may be different from the return type. llvm-svn: 205597
* Use range-based for loop. No functionality change.Rui Ueyama2014-04-041-16/+9
| | | | llvm-svn: 205594
* Do not use temporary variables to pass them to forEachUndefines.Rui Ueyama2014-04-041-14/+13
| | | | | | So that it's obvious that we pass these callbacks only to forEachUndefines. llvm-svn: 205593
* Return a vector rather than mutating a given one.Rui Ueyama2014-04-042-12/+13
| | | | | | | | This is cleaner and as efficient as before. Differential Revision: http://llvm-reviews.chandlerc.com/D3284 llvm-svn: 205590
* Rename getInputGraph() and getNextFile().Rui Ueyama2014-04-042-9/+8
| | | | | | | | | Seems getSomething() is more common naming scheme than just a noun to get something, so renaming these members. Differential Revision: http://llvm-reviews.chandlerc.com/D3285 llvm-svn: 205589
* Update comment.Rui Ueyama2014-04-031-1/+2
| | | | llvm-svn: 205579
* Minor cleanups.Rui Ueyama2014-04-032-11/+5
| | | | llvm-svn: 205578
* Replace a recursion with a loop for speed.Rui Ueyama2014-04-031-5/+7
| | | | llvm-svn: 205576
* Do not check deadStripNever twice.Rui Ueyama2014-04-031-28/+8
| | | | | | | | | | Atoms with deadStripNever attribute has already been added to the dead strip root set at end of Resolver::doDefinedAtom, so no need to check it for each atom again. Differential Revision: http://llvm-reviews.chandlerc.com/D3282 llvm-svn: 205575
* Move code into a helper function.Rui Ueyama2014-04-031-19/+15
| | | | | | | Move code that always runs after doUndefinedAtom into doUndefinedAtom for readability. llvm-svn: 205574
* Minor cleanup.Rui Ueyama2014-04-031-9/+5
| | | | llvm-svn: 205570
* Simplify two if's.Rui Ueyama2014-04-031-5/+3
| | | | llvm-svn: 205569
* Fix comments.Rui Ueyama2014-04-031-1/+1
| | | | llvm-svn: 205568
* Early return.Rui Ueyama2014-04-031-7/+9
| | | | llvm-svn: 205567
* Fix ELFFileNode::resetNextIndex().Rui Ueyama2014-04-031-25/+16
| | | | | | | | | | | | | | | | | | | ELFLinkingContext has a method addUndefinedAtomsFromSharedLibrary(). The method is being used to skip a shared library within --start-group and --end-group if it's not the first iteration of the group. We have the same, incomplete mechanism to skip a shared library within a group too. That's implemented in ELFFileNode. It's intended to not return a shared library on the second or further iterations in the first place. This mechanism is preferred over addUndefinedAtomsFromSharedLibrary because the policy is implemented in Input Graph -- that's what Input Graph is for. This patch removes the dupluicate feature and fixes ELFFileNode. Differential Revision: http://llvm-reviews.chandlerc.com/D3280 llvm-svn: 205566
* Expand 'auto' that's hard for human to deduce its real type.Rui Ueyama2014-04-032-2/+2
| | | | llvm-svn: 205564
* Add empty() to atom_collection.Rui Ueyama2014-04-031-3/+3
| | | | | | | | | "x.empty()" is more idiomatic than "x.size() == 0". This patch is to add such method and use it in LLD. Differential Revision: http://llvm-reviews.chandlerc.com/D3279 llvm-svn: 205558
* Remove "this->".Rui Ueyama2014-04-031-10/+10
| | | | | | | For most member function calls we do not use "this->" in this file. Remove the rest for consistency. llvm-svn: 205550
* Remove ordinals from Input Graph elements.Rui Ueyama2014-04-031-30/+0
| | | | | | | | | | | | | An ordinal is set to each child of Input Graph, but no one actually uses it. The only piece of code that gets ordinaly values is sortInputElements in InputGraph.cpp, but it does not actually do anything -- we assign ordinals in increasing order just before calling sort, so when sort is called it's already sorted. It's no-op. We can simply remove it. No functionality change. Differential Revision: http://llvm-reviews.chandlerc.com/D3270 llvm-svn: 205501
* Simplify communication between Resolver and Input Graph.Rui Ueyama2014-04-022-47/+22
| | | | | | | | | | | | | | | | | | | | | | | | Resolver is sending too much information to Input Graph than Input Graph actually needs. In order to collect the detailed information, which wouldn't be consumed by anyone, we have a good amount of code in Resolver, Input Graph and Input Elements. This patch is to simplify it. No functionality change. Specifically, this patch replaces ResolverState enum with a boolean value. The enum defines many bits to notify the progress about linking to Input Graph using bit masks, however, what Input Graph actually does is to compare a given value with 0. The details of the bit mask is simply being ignored, so the efforts to collect such data is wasted. This patch also changes the name of the notification interface from setResolverState to notifyProgress, to make it sounds more like message passing style. It's not a setter but something to notify of an update, so the new name should be more appropriate than before. Differential Revision: http://llvm-reviews.chandlerc.com/D3267 llvm-svn: 205463
OpenPOWER on IntegriCloud