summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/GOTPass.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [lld] Fix trivial typos in commentsKazuaki Ishizaki2020-01-061-1/+1
| | | | | | Reviewed By: ruiu, MaskRay Differential Revision: https://reviews.llvm.org/D72196
* [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
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* Move new lld's code to Common subdirectory.Rui Ueyama2017-10-021-1/+1
| | | | | | | | | | New lld's files are spread under lib subdirectory, and it isn't easy to find which files are actually maintained. This patch moves maintained files to Common subdirectory. Differential Revision: https://reviews.llvm.org/D37645 llvm-svn: 314719
* Fix wrong formatting in lld introduced in r286561 (NFC)Mehdi Amini2016-11-111-1/+1
| | | | | | Pointed out by Davide. llvm-svn: 286649
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-111-1/+1
| | | | | | | | This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
* Convert lld Pass::runOnFile to llvm::Error from std::error_code. NFC.Pete Cooper2016-03-301-2/+2
| | | | | | | Pretty mechanical change here. Just replacing all the std::error_code() with llvm::Error() and make_dynamic_error_code with make_error<GenericError> llvm-svn: 264917
* Use owning pointers instead of raw pointers for Atom's to fix leaks.Pete Cooper2016-03-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This is a re-commit of r264022 with a fix for MSVC. The issue there was that the code was running DefinedAtom::~Atom() for some value and instead needed to cast to Atom before running ~Atom. Original commit message follows. Currently each File contains an BumpPtrAllocator in which Atom's are allocated. Some Atom's contain data structures like std::vector which leak as we don't run ~Atom when they are BumpPtrAllocate'd. Now each File actually owns its Atom's using an OwningAtomPtr. This is analygous to std::unique_ptr and may be replaced by it if possible. An Atom can therefore only be owned by a single File, so the Resolver now moves them from one File to another. The MachOLinkingContext owns the File's and so clears all the Atom's in ~MachOLinkingContext, then delete's all the File's. This makes sure all Atom's have been destructed before any of the BumpPtrAllocator's in which they run have gone away. Should hopefully fix the remaining leaks. Will keep an eye on the bots to make sure. llvm-svn: 264067
* Revert "Use owning pointers instead of raw pointers for Atom's to fix leaks."Pete Cooper2016-03-221-2/+0
| | | | | | | | | | | | This reverts commit r264022. This breaks the Window's bots which don't like that i'm calling ~Atom when the this pointer is a sublcass of Atom. Reverting for now until I try find a better fix. I tried using std::unique_ptr with a custom deleter as a quick fix, but it didn't work well in the YAML parser. llvm-svn: 264023
* Use owning pointers instead of raw pointers for Atom's to fix leaks.Pete Cooper2016-03-221-0/+2
| | | | | | | | | | | | | | | | | | | | Currently each File contains an BumpPtrAllocator in which Atom's are allocated. Some Atom's contain data structures like std::vector which leak as we don't run ~Atom when they are BumpPtrAllocate'd. Now each File actually owns its Atom's using an OwningAtomPtr. This is analygous to std::unique_ptr and may be replaced by it if possible. An Atom can therefore only be owned by a single File, so the Resolver now moves them from one File to another. The MachOLinkingContext owns the File's and so clears all the Atom's in ~MachOLinkingContext, then delete's all the File's. This makes sure all Atom's have been destructed before any of the BumpPtrAllocator's in which they run have gone away. Should hopefully fix the remaining leaks. Will keep an eye on the bots to make sure. llvm-svn: 264022
* Move ownership of Pass File's to the MachoLinkingContext.Pete Cooper2016-03-211-2/+2
| | | | | | | | | In trying to fix the leaks in the MachO lld codebase, we need to have a better model for file and atom ownership. Having the context own everything seems like the simplest model, so change all the passes to allocate File's on the context instead of owning files as a member. llvm-svn: 264004
* Set ordinals of all File's created in MachO passes.Pete Cooper2016-02-021-1/+3
| | | | | | | | | | | When we do debug printing of atoms, they expect their parent file to have an ordinal. Right now we trigger a bunch of asserts. This doesn't actually manifest in differences in any real tests, but even if the only thing it does is improve debuggability then its still useful. llvm-svn: 259450
* Fix Clang-tidy modernize-use-auto warnings, other minor fixes.Eugene Zelenko2015-11-101-7/+2
| | | | | | Differential revision: http://reviews.llvm.org/D14553 llvm-svn: 252661
* Simplify Pass::perform to take a SimpleFile& instead of unique_ptr<SimpleFile>&David Blaikie2015-06-191-3/+3
| | | | | | | | None of the implementations replace the SimpleFile with some other file, they just modify the SimpleFile in-place, so a direct reference to the file is sufficient. llvm-svn: 240167
* [lld] Allow LLD passes to return error codes.Lang Hames2015-06-191-1/+3
| | | | llvm-svn: 240147
* Do s/_context/_ctx/g globally.Rui Ueyama2015-04-101-5/+4
| | | | | | | | I believe this patch eliminates all remaining uses of _context or _linkingContext variable names. Consistent naming improves readability. llvm-svn: 234645
* Merge MutableFile with SimpleFile.Rui Ueyama2015-04-071-2/+1
| | | | | | | | SimpleFile is the only derived class of MutableFile. This patch reduces the height of class hierarchy by removing MutableFile class. llvm-svn: 234354
* Use alignment values everywhere instead of log2.Rui Ueyama2015-03-261-1/+1
| | | | | | | | 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
* Add missing includes for make_unique, lld edition.Benjamin Kramer2015-03-021-1/+1
| | | | llvm-svn: 230925
* [Core,MachO,Test] Remove trailing whitespace.Shankar Easwaran2015-02-221-6/+6
| | | | llvm-svn: 230192
* Use make_unique.Rui Ueyama2015-02-061-1/+1
| | | | llvm-svn: 228453
* [mach-o] Sort GOT entries by name to make links reproducibleNick Kledzik2014-11-121-5/+18
| | | | | | | | | | | | | The GOT slots were being laid out in a random order by the GOTPass which caused randomness in the output file. Note: With this change lld now bootstraps on darwin. That is: 1) link lld using system linker to make lld.1 2) link lld using lld.1 to make lld.2 3) link lld using lld.2 to make lld.3 Now lld.2 and lld.3 are identical. llvm-svn: 221831
* Sort include files according to convention.Shankar Easwaran2014-10-181-2/+0
| | | | llvm-svn: 220131
* Use isa<> instead of checking return value of definition().Rui Ueyama2014-10-141-1/+1
| | | | | | | definition() is supposed to be used through isa, dyn_cast or cast. It's better to not call that directly. llvm-svn: 219723
* [mach-o] refactor KindHandler into ArchHandler and simplify passes.Nick Kledzik2014-07-161-55/+121
| | | | | | | | | | | All architecture specific handling is now done in the appropriate ArchHandler subclass. The StubsPass and GOTPass have been simplified. All architecture specific variations in stubs are now encoded in a table which is vended by the current ArchHandler. llvm-svn: 213187
* Move GOTPass and StubsPass from Core to MachONick Kledzik2014-07-091-0/+108
llvm-svn: 212652
OpenPOWER on IntegriCloud