summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify now that there is only one file. NFC.Rafael Espindola2015-04-241-6/+4
| | | | llvm-svn: 235747
* Return ErrorOr<std::unique_ptr<File>>. NFC.Rafael Espindola2015-04-241-3/+4
| | | | llvm-svn: 235744
* Return an ErrorOr<std::unique_ptr<File>>. NFC.Rafael Espindola2015-04-241-10/+12
| | | | llvm-svn: 235741
* Delete unnecessary generality in loadFile.Rafael Espindola2015-04-242-12/+13
| | | | | | | | | | | | | loadFile could load mulitple files just because yaml has a feature for putting multiple documents in one file. Designing a linker around what yaml can do seems like a bad idea to me. This patch changes it to read a single file. There are further improvements to be done to the api and they will follow shortly. llvm-svn: 235724
* Rename ExecutableAtom.hpp to ExecutableAtom.hDavide Italiano2015-04-142-2/+2
| | | | | | This is for consistency with what's used elsewhere in lld tree. llvm-svn: 234943
* Define make_dynamic_error_code(const char *).Rui Ueyama2015-04-145-27/+26
| | | | | | | | | | | | The function took either StringRef or Twine. Since string literals are ambiguous when resolving the overloading, many code calls used this function with explicit type conversion. That led awkward code like make_dynamic_error_code(Twine("Error occurred")). This patch adds a function definition for string literals, so that you can directly call the function with literals. llvm-svn: 234841
* Do s/_context/_ctx/g globally.Rui Ueyama2015-04-106-80/+72
| | | | | | | | I believe this patch eliminates all remaining uses of _context or _linkingContext variable names. Consistent naming improves readability. llvm-svn: 234645
* Rename atom_collection -> AtomVector.Rui Ueyama2015-04-081-5/+5
| | | | | | Type names should start with an uppercase letter in the LLVM coding style. llvm-svn: 234452
* Separate atom_collection type into two different types. NFC.Rui Ueyama2015-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | atom_collection is basically a wrapper for std::vector. The class provides begin and end member functions, so that it "hides" the other member functions provided by std::vector. However, you can still directly access _atoms member since the member is not protected. We cannot simply make the member private because we need that member when we are constructing atom vectors. This patch splits atom_collection into two types: std::vector<Atom *> and AtomRange. When we are constructing atom vectors, we use the former class. We return instances of the latter class from File objects so that callers cannot add or remove atoms from the lists. std::vector<Atom *> is automatically converted to AtomRange. llvm-svn: 234450
* Merge atom_collection_vector with atom_collection.Rui Ueyama2015-04-081-1/+1
| | | | | | | atom_collection_vector is the only derived class of atom_collection. This patch merges the two. llvm-svn: 234443
* Remove redundant virtual on member functions marked 'override'.David Blaikie2015-04-081-12/+6
| | | | llvm-svn: 234419
* MachO: Remove unused vectors from MachHeaderAliasFile. NFC.Rui Ueyama2015-04-071-6/+3
| | | | llvm-svn: 234369
* Merge MutableFile with SimpleFile.Rui Ueyama2015-04-076-25/+23
| | | | | | | | SimpleFile is the only derived class of MutableFile. This patch reduces the height of class hierarchy by removing MutableFile class. llvm-svn: 234354
* Replace the `createImplicitFiles` method return type with `void`Simon Atanasyan2015-04-062-5/+3
| | | | | | | All instances of the `createImplicitFiles` always return `true` and this return value is used nowhere. llvm-svn: 234205
* Remove a parameter for file extension from canParse.Rui Ueyama2015-04-041-11/+5
| | | | | | | | canParse took three parameters -- file magic, filename extension and memory buffer. All but YAMLReader ignored the second parameter. This patch removes the parameter. llvm-svn: 234080
* Remove Makefiles.Rui Ueyama2015-03-261-14/+0
| | | | | | | | Most developers prefer to not have them, and we agreed to remove them from LLD. http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083368.html llvm-svn: 233313
* Rename align2 -> align.Rui Ueyama2015-03-262-8/+8
| | | | | | I believe "2" stands for log2. Just "align" would be appropriate now. llvm-svn: 233248
* Use arithmetic type to represent alignments (not in log2) everywhere.Rui Ueyama2015-03-264-28/+9
| | | | | | | This is the final step of conversion. Now log2 numbers are removed from everywhere! llvm-svn: 233246
* Use alignment values everywhere instead of log2.Rui Ueyama2015-03-269-26/+23
| | | | | | | | This patch defines implicit conversion between integers and PowerOf2 instances, so uses of the classes is now implicit and look like regular integers. Now we are ready to remove the scaffolding. llvm-svn: 233245
* Define an implicit constructor which takes actual alignment value to PowerOf2.Rui Ueyama2015-03-264-7/+7
| | | | | | | The new constructor's type is the same, but this one takes not a log2 value but an alignment value itself, so the meaning is totally differnet. llvm-svn: 233244
* Make PowerOf2's constructor private.Rui Ueyama2015-03-264-7/+7
| | | | | | | Ban conversion from integers to PowerOf2 even if explicit to make all places we create PowerOf2 instances visible. llvm-svn: 233243
* Remove implicit constructor and operator int from PowerOf2.Rui Ueyama2015-03-267-20/+29
| | | | | | | | | | This patch is to make instantiation and conversion to an integer explicit, so that we can mechanically replace all occurrences of the class with integer in the next step. Now get() returns an alignment value rather than its log2 value. llvm-svn: 233242
* Add a scaffolding to merge alignment representations.Rui Ueyama2015-03-262-7/+6
| | | | | | | | | | | | | | | | | We are using log2 values and values themselves to represent alignments. For example, alignment 8 is sometimes represented as 3 (8 == 2^3). We want to stop using log2 values. Because both types are regular arithmetic types, we cannot get help from a compiler to find places we mix two representations. That makes this merging work surprisingly hard because if I make a mistake, I'll just get wrong results at runtime (Yay types!). In this patch, I introduced a class to represents power-of-two values, which is basically an alias for an integer type. Once the migration is done, the class will be removed. llvm-svn: 233232
* [ELF] Ability to resolve undefined symbols lazilyDenis Protivensky2015-03-141-1/+1
| | | | | | | | | Handle resolution of symbols coming from linked object files lazily. Add implementation of handling _GLOBAL_OFFSET_TABLE_ and __exidx_start/_end symbols for ARM platform. Differential Revision: http://reviews.llvm.org/D8159 llvm-svn: 232261
* Rephrase find loop to use std::find_ifDavid Blaikie2015-03-121-11/+7
| | | | | | Avoids the need for an assert-only variable, among other benefits. llvm-svn: 232088
* Avoid an unused variable warning when assertions are offJustin Bogner2015-03-121-0/+1
| | | | | | Patch by Mike Edwards. Thanks! llvm-svn: 232015
* [MachO] Use setter for globalsAreDeadStripRoots. NFC intended.Davide Italiano2015-03-091-2/+2
| | | | llvm-svn: 231629
* Remove sectionPosition attribute.Rui Ueyama2015-03-081-20/+6
| | | | | | | | This code is simply dead. No one is using it. http://reviews.llvm.org/D8125 llvm-svn: 231583
* Make File non-const in the resolver.Rui Ueyama2015-03-041-1/+1
| | | | | | | | | | | | | | | File objects are not really const in the resolver. We set ordinals to them and call beforeLink hooks. Also, File's member functions marked as const are not really const. ArchiveFile never returns the same member file twice, so it remembers files returned before. find() has side effects. In order to deal with the inconsistencies, we sprinkled const_casts and marked member varaibles as mutable. This patch removes const from there to reflect the reality. llvm-svn: 231212
* Remove include/lld/Core/Endian.h and use llvm/Support/Endian.h instead.Rui Ueyama2015-03-021-1/+2
| | | | llvm-svn: 231005
* Add missing includes for make_unique, lld edition.Benjamin Kramer2015-03-024-2/+4
| | | | llvm-svn: 230925
* Use read{le,be}{16,32}. NFC.Rui Ueyama2015-02-271-24/+10
| | | | llvm-svn: 230728
* Remove unused #includes.Rui Ueyama2015-02-271-1/+0
| | | | llvm-svn: 230726
* [Core,MachO,Test] Remove trailing whitespace.Shankar Easwaran2015-02-2210-99/+99
| | | | llvm-svn: 230192
* Remove YAML/Native round-trip passes.Rui Ueyama2015-02-202-2/+0
| | | | | | | | | | | | | | | | | | | | The round-trip passes were introduced in r193300. The intention of the change was to make sure that LLD is capable of reading end writing such file formats. But that turned out to be yet another over-designed stuff that had been slowing down everyday development. The passes ran after the core linker and before the writer. If you had an additional piece of information that needs to be passed from front-end to the writer, you had to invent a way to save the data to YAML/Native. These passes forced us to do that even if that data was not needed to be represented neither in an object file nor in an executable/DSO. It doesn't make sense. We don't need these passes. http://reviews.llvm.org/D7480 llvm-svn: 230069
* [Mach-O] Remove redundant allocatorJean-Daniel Dupas2015-02-201-2/+1
| | | | llvm-svn: 230007
* Fix heap-buffer-overflow bugs identified by the Address SanitizerGreg Fitzgerald2015-02-192-0/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D7733 llvm-svn: 229912
* [Mach-O] Rename enum typename for consistency. NFCJean-Daniel Dupas2015-02-194-18/+18
| | | | | | | Typename shouldn't mix camel case and underscore. Thanks to Rui for the remark. llvm-svn: 229848
* [ELF] Demangle: don't expose raw info when getter is available.Davide Italiano2015-02-181-1/+1
| | | | | | | Differential Revision: D7693 Reviewed by: shankarke llvm-svn: 229635
* Update ARM and x86 ArchHandler to check switch completeness. NFCJean-Daniel Dupas2015-02-153-17/+25
| | | | | | Define an explicit type for arch specific reference kinds to make sure all cases are covered in switch statements. llvm-svn: 229314
* Break some test. Revert until I got a proper fixJean-Daniel Dupas2015-02-142-76/+72
| | | | llvm-svn: 229249
* Update ARM and x86 ArchHandler to match 64bits counterparts. NFCJean-Daniel Dupas2015-02-142-72/+76
| | | | | | | | | | | | | | | | | | Summary: Define an explicit type for arch specific reference kind and use it in switch statement to make the compiler emit warnings if some case is not cover. It will help to catch such errors when we add new mach-o reference kind. Reviewers: shankarke, kledzik Reviewed By: shankarke Subscribers: shankarke, aemerson, llvm-commits Projects: #lld Differential Revision: http://reviews.llvm.org/D7612 llvm-svn: 229246
* Remove file not used anywhere.Jean-Daniel Dupas2015-02-131-31/+0
| | | | llvm-svn: 229109
* Using 'isa' instead of 'dyn_cast'Jean-Daniel Dupas2015-02-131-1/+1
| | | | llvm-svn: 229107
* Use make_unique.Rui Ueyama2015-02-064-5/+5
| | | | llvm-svn: 228453
* Cleanup. NFC.Rui Ueyama2015-02-052-9/+9
| | | | | | | Make customOrder pareamter mandatory because the argument is always passed. llvm-svn: 228342
* MachO: Move LayoutPass to MachO directory.Rui Ueyama2015-02-055-8/+596
| | | | | | | | | | | | | | | | | | | | | | The real user of the LayoutPass is now only Mach-O, so move that pass out of the common directory to Mach-O directory. "Core" architecture were using the LayoutPass. I modified that to use a simple OrderPass. I think no one actually have authority what feature should be in Core and what's not, but I believe the LayoutPass is not very suitable for Core. Before more code starts depending on the complex pass, it's better to remove that from Core. I could have simplified that pass because Mach-O is the only user of the LayoutPass. For example, the second parameter of the LayoutPass constructor can be converted from optional to mandatory. I didn't do that in this patch to keep it simple. I'll do in a followup patch. http://reviews.llvm.org/D7311 llvm-svn: 228341
* Fix the ELF shared library build targets - take 2Greg Fitzgerald2015-01-242-2/+4
| | | | | | | | | | lldELF is used by each ELF backend. lldELF's ELFLinkingContext also held a reference to each backend, creating a link-time cycle. This patch moves the backend references to lldDriver. Differential Revision: http://reviews.llvm.org/D7119 llvm-svn: 226976
* [MachO] Remove dependency on lldDriverGreg Fitzgerald2015-01-231-2/+20
| | | | | | | | | Moved getMemoryBuffer from DarwnLdDriver to MachOLinkingContext. lldMachO shared library target now builds. Differential Review: http://reviews.llvm.org/D7155 llvm-svn: 226963
* Revert " Fix the ELF shared library build targets"Greg Fitzgerald2015-01-232-4/+2
| | | | | | This reverts commit 6a3f545b44cea46321e025d9ab773786af86cb51. llvm-svn: 226928
OpenPOWER on IntegriCloud