summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-ar
Commit message (Collapse)AuthorAgeFilesLines
* For new archive member we only need to store the full path.Rafael Espindola2015-07-151-9/+7
| | | | | | | We were storing both the path and the file name, which was redundant and easy to get confused up with. llvm-svn: 242347
* Handle the error of trying to convert a regular archive to a thin one.Rafael Espindola2015-07-151-2/+13
| | | | | | While at it, test that we can add to a thin archive. llvm-svn: 242330
* Initial support for writing thin archives.Rafael Espindola2015-07-151-3/+7
| | | | llvm-svn: 242269
* Add support for reading members out of thin archives.Rafael Espindola2015-07-141-2/+4
| | | | | | | | | | For now the Archive owns the buffers of the thin archive members. This makes for a simple API, but all the buffers are destructed only when the archive is destructed. This should be fine since we close the files after mmap so we should not hit an open file limit. llvm-svn: 242215
* llvm-ar: Don't try to extract from thin archives.Rafael Espindola2015-07-141-0/+5
| | | | | | This matches the gnu ar behavior. llvm-svn: 242162
* llvm-ar: print an error when the requested member is not found.Rafael Espindola2015-07-141-3/+12
| | | | llvm-svn: 242156
* Use a range loop. NFC.Rafael Espindola2015-07-141-19/+17
| | | | llvm-svn: 242153
* Add support deterministic output in llvm-ar and make it the default.Rafael Espindola2015-07-131-2/+10
| | | | llvm-svn: 242061
* Create BSD archives by default on OS X.Rafael Espindola2015-07-091-3/+9
| | | | | | | | | They should probably be created on anything that is not windows or linux, but I will test on freebsd before changing that. With this it is possible to bootstrap with llvm-ar instead of ar+ranlib on OS X. llvm-svn: 241849
* Disallow Archive::child_iterator that don't point to an archive.Rafael Espindola2015-07-081-1/+2
| | | | | | NFC, just less error prone. llvm-svn: 241747
* Start adding support for writing archives in BSD format.Rafael Espindola2015-07-081-2/+24
| | | | | | | | No support for the symbol table yet (but will hopefully add it today). We always use the long filename format so that we can align the member, which is an advantage of the BSD format. llvm-svn: 241721
* ArrayRef-ify libDriverMainDavid Blaikie2015-06-211-1/+1
| | | | llvm-svn: 240234
* LibDriver, llvm-lib: introduce.Peter Collingbourne2015-06-094-7/+31
| | | | | | | | | | llvm-lib is intended to be a lib.exe compatible utility that also understands bitcode. The implementation lives in a library so that lld can use it to implement /lib. Differential Revision: http://reviews.llvm.org/D10297 llvm-svn: 239434
* llvm-ar: Move archive writer to Object.Peter Collingbourne2015-06-081-326/+6
| | | | | | | | | No functional change intended, other than some minor changes to certain diagnostics. Differential Revision: http://reviews.llvm.org/D10296 llvm-svn: 239278
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-0/+1
| | | | | | NFC. llvm-svn: 232976
* llvm-ar: Remove unimplemented -N option from -helpDavid Majnemer2015-01-281-1/+0
| | | | | | This fixes PR22358. llvm-svn: 227296
* Manually specify the folder that llvm-ranlib should reside in for ↵Aaron Ballman2015-01-071-0/+2
| | | | | | CMake-produced solutions that care about such things (like MSVC). This takes llvm-ranlib out of the root solution folder and places it into the Tools folder where it belongs. llvm-svn: 225353
* Only seek once before writing the member offsets.Rafael Espindola2014-12-111-18/+20
| | | | | | | This cuts down the number on system calls done by a static llvm-ar producing lib/libclangSema.a from 9164 to 442. llvm-svn: 224025
* llvm-ar: close input files early.Rafael Espindola2014-12-111-16/+13
| | | | | | We already have them mapped into memory, so we can just close the file. llvm-svn: 224020
* [CMake] Fix installation of llvm-ranlib on multiconfig builder.NAKAMURA Takumi2014-12-082-1/+26
| | | | | | | Introduce install_symlink.cmake from clang/tools/driver/clang_symlink.cmake. FIXME: Would it be generalized? llvm-svn: 223655
* Introduce "llvm-ranlib" as a name of targets since ↵NAKAMURA Takumi2014-12-041-1/+1
| | | | | | Object/archive-symtab.test requires llvm-ranlib. llvm-svn: 223332
* For copy, cmake needs the full path to llvm-ar.Rafael Espindola2014-12-041-1/+2
| | | | | | This should fix the windows build. llvm-svn: 223324
* Add missing dependency on llvm-ar. Should hopefully fix the bots.Rafael Espindola2014-12-041-1/+2
| | | | llvm-svn: 223321
* Make llvm-ar a real build target and install it.Rafael Espindola2014-12-031-10/+5
| | | | llvm-svn: 223309
* Remove unused variable.Rafael Espindola2014-11-071-2/+2
| | | | llvm-svn: 221549
* Make two helper functions static.Rafael Espindola2014-10-221-2/+2
| | | | llvm-svn: 220389
* Handle spaces and quotes in file names in MRI scripts.Rafael Espindola2014-10-221-0/+3
| | | | llvm-svn: 220364
* MRI scripts: Add addlib support.Rafael Espindola2014-10-211-1/+20
| | | | llvm-svn: 220346
* Use a range loop. NFC.Rafael Espindola2014-10-211-7/+6
| | | | llvm-svn: 220344
* Overwrite instead of adding to archives when creating them in mri scripts.Rafael Espindola2014-10-211-67/+75
| | | | | | | This matches the behavior of GNU ar and also makes it easier to implemnt support for the addlib command. llvm-svn: 220336
* Convert a few std::string with StringRef. NFC.Rafael Espindola2014-10-211-24/+30
| | | | | | | | | This is a micro optimization, but also makes the code a bit more flexible. The MRIMembers variable is a short term hack. It is going away in the next commit. llvm-svn: 220334
* Use a StringRef. No functionality change.Rafael Espindola2014-10-211-5/+4
| | | | llvm-svn: 220327
* Move code a bit to avoid a few declarations. NFC.Rafael Espindola2014-10-211-45/+40
| | | | llvm-svn: 220317
* Comment cleanup. NFC.Rafael Espindola2014-10-211-16/+14
| | | | | | | Don't duplicate names in comments and remove useless ones. Hopefully anyone reading this knows what main is. llvm-svn: 220298
* Add support for addmod to mri scripts.Rafael Espindola2014-10-211-1/+5
| | | | llvm-svn: 220294
* llvm-ar: Start adding support for mri scripts.Rafael Espindola2014-10-101-2/+57
| | | | | | | | | | | | | | | | | | | | | | I was quiet surprised to find this feature being used. Fortunately the uses I found look fairly simple. In fact, they are just a very verbose version of the regular ar commands. Start implementing it then by parsing the script and setting the command variables as if we had a regular command line. This patch adds just enough support to create an empty archive and do a bit of error checking. In followup patches I will implement at least addmod and addlib. From the description in the manual, even the more general case should not be too hard to implement if needed. The features that don't map 1:1 to the simple command line are * Reading from multiple archives. * Creating multiple archives. llvm-svn: 219521
* Don't own the buffer in object::Binary.Rafael Espindola2014-08-191-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
* Remove some calls to std::move.Rafael Espindola2014-08-011-5/+4
| | | | | | | | | Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-311-2/+2
| | | | llvm-svn: 214377
* [CMake] Update libdeps.NAKAMURA Takumi2014-07-141-0/+1
| | | | llvm-svn: 212920
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-061-7/+8
| | | | llvm-svn: 212405
* Add support for inline asm symbols in llvm-ar.Rafael Espindola2014-07-033-1/+7
| | | | | | | This should allow llvm-ar to be used instead of gnu ar + plugin in a LTO build. I will add a release note about it once I finish a LTO bootstrap with it. llvm-svn: 212287
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-261-1/+2
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-261-2/+1
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* Pass a unique_ptr<MemoryBuffer> to the constructors in the Binary hierarchy.Rafael Espindola2014-06-241-1/+1
| | | | | | | Once the objects are constructed, they own the buffer. Passing a unique_ptr makes that clear. llvm-svn: 211595
* Pass a std::unique_ptr& to the create??? methods is lib/Object.Rafael Espindola2014-06-231-3/+3
| | | | | | | | This makes the buffer ownership on error conditions very natural. The buffer is only moved out of the argument if an object is constructed that now owns the buffer. llvm-svn: 211546
* Make ObjectFile and BitcodeReader always own the MemoryBuffer.Rafael Espindola2014-06-231-1/+2
| | | | | | | | | | This allows us to just use a std::unique_ptr to store the pointer to the buffer. The flip side is that they have to support releasing the buffer back to the caller. Overall this looks like a more efficient and less brittle api. llvm-svn: 211542
* Simplify memory management with std::unique_ptr.Rafael Espindola2014-06-231-12/+8
| | | | llvm-svn: 211538
* Add a symbols() range and use a range loop.Rafael Espindola2014-06-181-5/+3
| | | | llvm-svn: 211222
* Simplify code.Rafael Espindola2014-06-181-10/+1
| | | | | | We can delete the objects earlier now that we are copying the names to a buffer. llvm-svn: 211221
OpenPOWER on IntegriCloud