summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core/File.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Fix some Clang-tidy modernize-use-default and Include What You Use warnings; ↵Eugene Zelenko2016-11-051-3/+2
| | | | | | | | other minor fixes. Differential revision: https://reviews.llvm.org/D26320 llvm-svn: 286030
* Use owning pointers instead of raw pointers for Atom's to fix leaks.Pete Cooper2016-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* Rename atom_collection -> AtomVector.Rui Ueyama2015-04-081-4/+4
| | | | | | Type names should start with an uppercase letter in the LLVM coding style. llvm-svn: 234452
* Merge atom_collection_vector with atom_collection.Rui Ueyama2015-04-081-4/+4
| | | | | | | atom_collection_vector is the only derived class of atom_collection. This patch merges the two. llvm-svn: 234443
* Remove atom_collection_empty class.Rui Ueyama2015-04-081-4/+4
| | | | llvm-svn: 234442
* Run the resolver in parallel with the reader.Rui Ueyama2015-01-161-0/+8
| | | | | | | | | | | | | | | | | | | | This patch makes File::parse() multi-thread safe. If one thread is running File::parse(), other threads will block if they try to call the same method. File::parse() is idempotent, so you can safely call multiple times. With this change, we don't have to wait for all worker threads to finish in Driver::link(). Previously, Driver::link() calls TaskGroup::sync() to wait for all threads running File::parse(). This was not ideal because we couldn't start the resolver until we parse all files. This patch increase parallelism by making Driver::link() to not wait for worker threads. The resolver calls parse() to make sure that the file being read has been parsed, and then uses the file. In this approach, the resolver can run with the parser threads in parallel. http://reviews.llvm.org/D6994 llvm-svn: 226281
* Partially roll back r217324.Rui Ueyama2014-09-081-0/+2
| | | | llvm-svn: 217392
* Remove dead code.Rui Ueyama2014-09-071-6/+0
| | | | llvm-svn: 217324
* Remove extraneous curly braces and blank lines.Rui Ueyama2013-11-191-4/+0
| | | | llvm-svn: 195107
* Fix spelling error. s/Libary/Library/g.Rui Ueyama2013-08-091-1/+1
| | | | llvm-svn: 188049
* Add SectionPosition and OrderPassNick Kledzik2013-01-231-1/+4
| | | | llvm-svn: 173300
* fix typoNick Kledzik2013-01-081-1/+1
| | | | llvm-svn: 171916
* Removes files for separate ReaderYAML.cpp and WriterYAML.cpp Nick Kledzik2013-01-051-0/+6
| | | | | | | | and adds a new file ReaderWriterYAML.cpp that uses YAML I/O. Lots of tweaks to test suite for slightly different YAML encoding. llvm-svn: 171592
* Factor out core linking options from Platform in a new ResolverOptionsNick Kledzik2012-04-181-4/+0
| | | | | | | | | | class. Change Resolver to no longer use Platform. Core linking now issues errors directly. We need to factor that out later. Rework how Darwin executable writer finds "main" atom. It now adds to core linking an Atom which has a Reference to "main". llvm-svn: 155060
* First implementation of Darwin Platform. It is rich enough to generateNick Kledzik2012-04-071-0/+3
| | | | | | | | | | a hello world executable from atoms. There is still much to be flushed out. Added one test case, test/darwin/hello-world.objtxt, which exercises the darwin platform. Added -platform option to lld-core tool to dynamically select platform. llvm-svn: 154242
* Steal LLVM.h from Clang. This brings in very commonly used LLVM ADT/SupportMichael J. Spencer2012-04-031-2/+3
| | | | | | types into the lld namespace. llvm-svn: 153963
* Sources now require C++11 to build.Nick Kledzik2012-03-081-2/+2
| | | | | | | | | | | | | | | | | Add first linker pass (StubsPass) which looks for calls to shared library symbols and replaces them with calls to a StubAtom. On ELF system, a "stub" is a PLT entry. Added a simple test case. Pass a Platform object to YAML reader and writer for converting fixup kinds between names and values. Change output of Resolver to be a File object instead of a vector of Atoms. Thus, passes operate on a File instead of just Atoms. Rework how to walk through a File's Atoms. Now iterator based instead of a method that visits each atom. llvm-svn: 152269
* Cleaned up Atom attribues some more. Added lots of doxygen commentsNick Kledzik2011-12-211-0/+5
| | | | llvm-svn: 147105
* Initial commit. Code by Nick Kledzik. Cleanups and build system by me.Michael J. Spencer2011-12-181-0/+16
llvm-svn: 146844
OpenPOWER on IntegriCloud