summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/CoreDriver.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove CoreDriver.Rui Ueyama2016-03-011-173/+0
| | | | | | | | | | | CoreDriver implements a driver for a hypothetical platform. It is intended to be used in unittests. However, it is actually redundant because the features are tested using the real driver for the real platforms. So we can remove this. http://reviews.llvm.org/D17698 llvm-svn: 262421
* Move parsing of LLVM options to parse() method.Pete Cooper2015-12-161-0/+2
| | | | | | | | | We used to parse the LLVM options in Driver::link. However, that is after parse() where we load files. By moving the LLVM option handling earlier, we can add DEBUG() to code such as MachONormalizedFileToAtoms.cpp and have it enabled correctly by '-mllvm --debug'. llvm-svn: 255819
* Update lld to match llvm r250901. OptTable constructor now takes an ↵Craig Topper2015-10-211-1/+1
| | | | | | ArrayRef. NFC llvm-svn: 250904
* Update for LLVM API change to return by InputArgList directly (rather than ↵David Blaikie2015-06-221-4/+4
| | | | | | by pointer) from ParseArgs llvm-svn: 240347
* Fix missed formatting in prior commit (mostly 80 cols violation and some ↵David Blaikie2015-06-221-3/+4
| | | | | | whitespace around *) llvm-svn: 240346
* ArrayRef-ify Driver::parse and related functions.David Blaikie2015-06-211-5/+4
| | | | llvm-svn: 240236
* ArrayRef-ify ParseArgsDavid Blaikie2015-06-211-2/+2
| | | | llvm-svn: 240235
* Remove the Native file format.Rui Ueyama2015-04-101-1/+0
| | | | | | | | | | | | | The Native file format was designed to be the fastest on-memory or on-disk file format for object files. The problem is that no one is working on that. No LLVM tools can produce object files in the Native, thus the feature of supporting the format is useless in the linker. This patch removes the Native file support. We can add it back if we really want it in future. llvm-svn: 234641
* Fix five of the shared library build targetsGreg Fitzgerald2015-01-211-1/+1
| | | | | | | | | | | | | | | | | | Before this patch there was a cyclic dependency between lldCore and lldReaderWriter. Only lldConfig could be built as a shared library. * Moved Reader and Writer base classes into lldCore. * The following shared libraries can now be built: lldCore lldYAML lldNative lldPasses lldReaderWriter Differential Revision: http://reviews.llvm.org/D7105 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226732
* Update comments.Rui Ueyama2015-01-171-1/+1
| | | | llvm-svn: 226380
* Simplify.Rui Ueyama2015-01-151-4/+2
| | | | llvm-svn: 226225
* Remove InputGraph and use std::vector<Node> instead.Rui Ueyama2015-01-151-6/+2
| | | | | | In total we have removed more than 1000 lines! llvm-svn: 226149
* Rename InputElement Node.Rui Ueyama2015-01-151-1/+1
| | | | | | | | | InputElement was named that because it's an element of an InputGraph. It's losing the origin because the InputGraph is now being removed. InputElement's subclass is FileNode, that naming inconsistency needed to be fixed. llvm-svn: 226147
* Remove InputGraph::addInputElement{,Front}.Rui Ueyama2015-01-151-1/+1
| | | | | | | | They were the last member functions of InputGraph (besides members()). Now InputGraph is just a container of a vector. We are ready to replace InputGraph with plain File vector. llvm-svn: 226146
* Remove WrapperNode.Rui Ueyama2015-01-151-2/+1
| | | | | | | WrapperNode was a useless subclass of FileNode. We should just use FileNode instead. llvm-svn: 226145
* Remove InputGraph::size().Rui Ueyama2015-01-151-1/+1
| | | | llvm-svn: 226140
* Re-commit r225674: Convert other drivers to use WrapperNode.Rui Ueyama2015-01-151-1/+1
| | | | | | | | The original commit had an issue with Mac OS dylib files. It didn't handle fat binary dylib files correctly. This patch includes a fix. A test for that case has already been committed in r225764. llvm-svn: 226123
* Revert "Convert other drivers to use WrapperNode" and subsequent commits.Rui Ueyama2015-01-141-1/+1
| | | | | | | r225764 broke a basic functionality on Mac OS. This change reverts r225764, r225766, r225767, r225769, r225814, r225816, r225829, and r225832. llvm-svn: 225859
* Convert other drivers to use WrapperNode.Rui Ueyama2015-01-131-1/+1
| | | | llvm-svn: 225764
* Convert CoreInputGraph.Rui Ueyama2015-01-061-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a part of InputGraph cleanup to represent input files as a flat list of Files (and some meta-nodes for group etc.) We cannot achieve that goal in one gigantic patch, so I split the task into small steps as shown below. (Recap the progress so far: Currently InputGraph contains a list of InputElements. Each InputElement contain one File (that used to have multiple Files, but I eliminated that use case in r223867). Files are currently instantiated in Driver::link(), but I already made a change to separate file parsing from object instantiation (r224102), so we can safely instantiate Files when we need them, instead of wrapping a file with the wrapper class (FileNode class). InputGraph used to act like a generator class by interpreting groups by itself, but it's now just a container of a list of InputElements (r223867).) 1. Instantiate Files in the driver and wrap them with WrapperNode. WrapperNode is a temporary class that allows us to instantiate Files in the driver while keep using the current InputGraph data structure. This patch demonstrates how this step 1 looks like, using Core driver as an example. 2. Do the same thing for the other drivers. When step 2 is done, an InputGraph consists of GroupEnd objects or WrapperNodes each of which contains one File. Other types of FileNode subclasses are removed. 3. Replace InputGraph with std::vector<std::unique_ptr<InputElement>>. InputGraph is already just a container of list of InputElements, so this step removes that needless class. 4. Remove WrapperNode. We need some code cleanup between each step, because many classes do a bit odd things (e.g. InputGraph::getGroupSize()). I'll straight things up as I need to. llvm-svn: 225313
* Sort include files according to convention.Shankar Easwaran2014-10-181-2/+1
| | | | llvm-svn: 220131
* Greatly simplify InputGraph.Rui Ueyama2014-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | InputGraph has too many knobs and controls that are not being used. This patch is to remove dead code, unused features and a class. There are two things that worth noting, besides simple dead code removal: 1. ControlNode class is removed. We had it as the base class of Group class, but it provides no functionality particularly meaningful. We now have shallower class hierarchy that is easier to understand. 2. InputGraph provides a feature to replace a node with its internal data. It is being used to "expand" some type of node, such as a Linker Script node, with its actual files. We used to have two options when replacing it -- ExpandOnly or ExpandAndReplace. ExpandOnly was to expand it but not remove the node from the tree. There is no use of that option in the code, so it was a dead feature. Differential Revision: http://llvm-reviews.chandlerc.com/D3252 llvm-svn: 205363
* Fix copy/paste error.Joey Gouly2013-12-241-1/+1
| | | | llvm-svn: 197990
* Restore vertical alignment lost by clang-formatNick Kledzik2013-12-201-4/+4
| | | | llvm-svn: 197834
* Run clang-format on r197727.Rui Ueyama2013-12-201-10/+7
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes are in: include/lld/Core/Reference.h include/lld/ReaderWriter/Reader.h Everything else is details to support the main change. 1) Registration based Readers Previously, lld had a tangled interdependency with all the Readers. It would have been impossible to make a streamlined linker (say for a JIT) which just supported one file format and one architecture (no yaml, no archives, etc). The old model also required a LinkingContext to read an object file, which would have made .o inspection tools awkward. The new model is that there is a global Registry object. You programmatically register the Readers you want with the registry object. Whenever you need to read/parse a file, you ask the registry to do it, and the registry tries each registered reader. For ease of use with the existing lld code base, there is one Registry object inside the LinkingContext object. 2) Changing kind value to be a tuple Beside Readers, the registry also keeps track of the mapping for Reference Kind values to and from strings. Along with that, this patch also fixes an ambiguity with the previous Reference::Kind values. The problem was that we wanted to reuse existing relocation type values as Reference::Kind values. But then how can the YAML write know how to convert a value to a string? The fix is to change the 32-bit Reference::Kind into a tuple with an 8-bit namespace (e.g. ELF, COFFF, etc), an 8-bit architecture (e.g. x86_64, PowerPC, etc), and a 16-bit value. This tuple system allows conversion to and from strings with no ambiguities. llvm-svn: 197727
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-1/+1
| | | | | | | | | | | | Changes :- a) Functionality in InputGraph to insert Input elements at any position b) Functionality in the Resolver to use nextFile c) Move the functionality of assigning file ordinals to InputGraph d) Changes all inputs to MemoryBuffers e) Remove LinkerInput, InputFiles, ReaderArchive llvm-svn: 192081
* Make Driver::link and LinkingContext::validate return true on success.Rui Ueyama2013-09-241-5/+4
| | | | | | | | | | | | | This patch inverts the return value of these functions, so that they return "true" on success and "false" on failure. The meaning of boolean return value was mixed in LLD; for example, InputGraph::validate() returns true on success. With this patch they'll become consistent. CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1748 llvm-svn: 191341
* Change the parseFile argument from MemoryBuffer pointer to LinkerInputJoerg Sonnenberger2013-09-071-5/+0
| | | | | | reference. Move readFile logic into FileNode::createLinkerInput. llvm-svn: 190253
* Remove unused identifiers.Rui Ueyama2013-09-051-2/+1
| | | | llvm-svn: 190095
* [lld] handle the case of errors from createLinkerInputShankar Easwaran2013-09-031-2/+2
| | | | | | | | | | This changes the interface of createLinkerInput to use ErrorOr, so that errors from the linker can be captured. Also adds a convenience function for error strings to be returned from file nodes. llvm-svn: 189871
* Cosmetic changesRui Ueyama2013-09-031-2/+2
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1577 llvm-svn: 189777
* add InputGraph functionalityShankar Easwaran2013-08-211-71/+74
| | | | llvm-svn: 188958
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-5/+4
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* Remove the SUPPORT_ALIASARGS defineHans Wennborg2013-08-011-2/+0
| | | | | | It is not needed after LLVM r187546. llvm-svn: 187551
* Option parsing tables: pick up AliasArgs from the OPTION macro.Hans Wennborg2013-07-311-3/+6
| | | | | | | | | This depends on LLVM r187537. The SUPPORT_ALIASARGS macro will be removed once all option parsing clients have been updated. llvm-svn: 187541
* Revert "Don't pass llvm::errs() all over the place. Diagnostics always go to ↵Rafael Espindola2013-07-151-7/+9
| | | | | | | | stderr." This reverts commit 185657. It will be used by unit tests. llvm-svn: 186366
* Don't pass llvm::errs() all over the place. Diagnostics always go to stderr.Rafael Espindola2013-07-041-9/+7
| | | | llvm-svn: 185657
* [Driver][Core] Handle -mllvm option.Rui Ueyama2013-06-051-1/+6
| | | | llvm-svn: 183347
* This is my Driver refactoring patch. Nick Kledzik2013-04-041-0/+158
The major changes are: 1) LinkerOptions has been merged into TargetInfo 2) LinkerInvocation has been merged into Driver 3) Drivers no longer convert arguments into an intermediate (core) argument list, but instead create a TargetInfo object and call setter methods on it. This is only how in-process linking would work. That is, you can programmatically set up a TargetInfo object which controls the linking. 4) Lots of tweaks to test suite to work with driver changes 5) Add the DarwinDriver 6) I heavily doxygen commented TargetInfo.h Things to do after this patch is committed: a) Consider renaming TargetInfo, given its new roll. b) Consider pulling the list of input files out of TargetInfo. This will enable in-process clients to create one TargetInfo the re-use it with different input file lists. c) Work out a way for Drivers to format the warnings and error done in core linking. llvm-svn: 178776
OpenPOWER on IntegriCloud