summaryrefslogtreecommitdiff
path: root/lib/Archive/ArchiveReader.cpp
Commit message (Collapse)AuthorAge
* silence a warning, patch by "mike".Chris Lattner2010-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102297 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't write into MemoryBuffers.Benjamin Kramer2010-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101783 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Wcast-qual warnings.Dan Gohman2010-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101779 91177308-0d34-0410-b5e6-96231b3b80d8
* From PR6228:Chris Lattner2010-02-04
| | | | | | | | | | | | | "Attached patch removes the extra NUL bytes from the output and changes test/Archive/MacOSX.toc from a binary to a text file (removes svn:mime-type=application/octet-stream and adds svn:eol-style=native). I can't figure out how to get SVN to include the new contents of the file in the patch so I'm attaching it separately." Patch by James Abbatiello! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95292 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-27
| | | | | | | | | | | | | | | | | | | | | | Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune #includes from llvm/Linker.h and llvm/System/Path.h,Chris Lattner2009-08-23
| | | | | | | | | | | | | | | | | | | | forcing them down into various .cpp files. This change also: 1. Renames TimeValue::toString() and Path::toString() to ::str() for similarity with the STL. 2. Removes all stream insertion support for sys::Path, forcing clients to call .str(). 3. Removes a use of Config/alloca.h from bugpoint, using smallvector instead. 4. Weans llvm-db off <iostream> sys::Path really needs to be gutted, but I don't have the desire to do it at this point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79869 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the use of const with respect to LLVMContext sane. Hopefully this is ↵Owen Anderson2009-07-01
| | | | | | | | | the last time, for the moment, that I will need to make far-reaching changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74655 91177308-0d34-0410-b5e6-96231b3b80d8
* Hold the LLVMContext by reference rather than by pointer.Owen Anderson2009-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson2009-07-01
| | | | | | | | | | | LLVMContext through a lot of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools. Patches for Clang and LLVM-GCC to follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74614 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up #includes, deleting a bunch of unnecessary #includes.Dan Gohman2009-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold the useful features of alist and alist_node into ilist, andDan Gohman2008-07-28
| | | | | | | | | | | | | | | | | a new ilist_node class, and remove them. Unlike alist_node, ilist_node doesn't attempt to manage storage itself, so it avoids the associated problems, including being opaque in gdb. Adjust the Recycler class so that it doesn't depend on alist_node. Also, change it to use explicit Size and Align parameters, allowing it to work when the largest-sized node doesn't have the greatest alignment requirement. Change MachineInstr's MachineMemOperand list from a pool-backed alist to a std::list for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-13
| | | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
* change the archive stuff to use MemoryBuffer instead of mappedfile.Chris Lattner2008-04-01
| | | | | | | | MemoryBuffer is higher level and more closely matches the model needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49029 91177308-0d34-0410-b5e6-96231b3b80d8
* add missing #includesChris Lattner2008-04-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49020 91177308-0d34-0410-b5e6-96231b3b80d8
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* finishing touches of bytecode -> bitcode changes. also unbreak WindowsGabor Greif2007-07-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37950 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate residual cruft related to recognizing bytecodeGabor Greif2007-07-06
| | | | | | | | files. bitcode files are the only LLVM format left. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37945 91177308-0d34-0410-b5e6-96231b3b80d8
* Here is the bulk of the sanitizing.Gabor Greif2007-07-05
| | | | | | | Almost all occurrences of "bytecode" in the sources have been eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch this over to bitcode instead of bytecode.Chris Lattner2007-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36866 91177308-0d34-0410-b5e6-96231b3b80d8
* add bitcode supportChris Lattner2007-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36856 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1302:Reid Spencer2007-04-04
| | | | | | | Adjust useage of sys::Path::FileType for new enumerator names. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35651 91177308-0d34-0410-b5e6-96231b3b80d8
* push bytecode decompressor out through APIs. Now the bytecode readerChris Lattner2007-02-07
| | | | | | | | | | | | | | | | | | | | | api's look like this: ModuleProvider *getBytecodeModuleProvider( const std::string &Filename, ///< Name of file to be read BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer, std::string* ErrMsg = 0, ///< Optional error message holder BytecodeHandler* H = 0 ///< Optional handler for reader events ); This is ugly, but allows a client to say: getBytecodeModuleProvider("foo", 0); If they do this, there is no dependency on the compression libraries, saving codesize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34012 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1050:Reid Spencer2006-12-15
| | | | | | | Convert asserts into error messages. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32607 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-25
| | | | | | | | Remove exception throwing/handling from lib/Bytecode, and adjust its users to compensate for changes in the interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29875 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-24
| | | | | | | | Remove exception handling from the bytecode archiver and adjust the llvm-ar tool to accommodate the new interfaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29866 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish removal of EH usage from the Archive library. The REQUIRES_EH flagReid Spencer2006-07-07
| | | | | | | | in lib/Bytecode/Archive/Makefile is now removed. One small step closer to a smaller LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29067 91177308-0d34-0410-b5e6-96231b3b80d8
* When reading the symbol table, make sure to delete the ArchiveMemberReid Spencer2006-05-12
| | | | | | | created by reading the symbol table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28251 91177308-0d34-0410-b5e6-96231b3b80d8
* more C++ daintinessDuraid Madina2005-12-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25023 91177308-0d34-0410-b5e6-96231b3b80d8
* speed up Archive::isBytecodeArchive in the case when the archive doesn't haveChris Lattner2005-09-23
| | | | | | | | an llvm-ranlib symtab. This speeds up gccld -native on an almost empty .o file from 1.63s to 0.18s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23406 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR495:Reid Spencer2005-07-07
| | | | | | | | | | | | | | | | | | | | | | Get rid of the difference between file paths and directory paths. The Path class now simply stores a path that can refer to either a file or a directory. This required various changes in the implementation and interface of the class with the corresponding impact to its users. Doxygen comments were also updated to reflect these changes. Interface changes are: appendDirectory -> appendComponent appendFile -> appendComponent elideDirectory -> eraseComponent elideFile -> eraseComponent elideSuffix -> eraseSuffix renameFile -> rename setDirectory -> set setFile -> set Changes pass Dejagnu and llvm-test/SingleSource tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22349 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21416 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement an isBytecodeArchive method to determine if an archive containsReid Spencer2005-02-26
| | | | | | | | bytecode file members or not. Patch Contributed By Adam Treat git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20338 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove potential platform portability issue with size of "int".Reid Spencer2004-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19172 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix problems uncovered by VC++ (first time compiled by VC++)Jeff Cohen2004-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19056 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure the Archive gets deleted if there's an error.Reid Spencer2004-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18869 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement error handling in OpenAndLoad* functions so the Linker can handle it.Reid Spencer2004-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18853 91177308-0d34-0410-b5e6-96231b3b80d8
* Path::get -> Path::toStringReid Spencer2004-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18785 91177308-0d34-0410-b5e6-96231b3b80d8
* Compute the firstFileOffset correctly after reading the LLVM symbol table.Reid Spencer2004-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18300 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow reading of member names that begin with an _ character.Reid Spencer2004-11-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18179 91177308-0d34-0410-b5e6-96231b3b80d8
* Distinguish between BSD4.4 and SVR4 symbol tablesReid Spencer2004-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18044 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct the computation of when to add the padding. It is not based on theReid Spencer2004-11-19
| | | | | | | | | member's size. It is based on the oddness/evenness of the file pointer. This fixes a bug with llvm-ar not being able to read archives produced by llvm-ranlib when there are members with odd long file name lengths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17997 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't save an iterator, just use post-increment.Reid Spencer2004-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17981 91177308-0d34-0410-b5e6-96231b3b80d8
* Make findModulesDefiningSymbols modify its symbols argument so we can \Reid Spencer2004-11-19
| | | | | | | eliminate symbols defined by the archive efficiently git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17976 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure we parse bytecode with a module identifier that reflects the fullReid Spencer2004-11-17
| | | | | | | name of the module: "Archive.a(object.o)" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17917 91177308-0d34-0410-b5e6-96231b3b80d8
* Despite documentation to the contrary, Mac OSX and BSD 4.4 archive formatsReid Spencer2004-11-17
| | | | | | | | *do* include the length of the long file in the length of the member and they are *not* null terminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17909 91177308-0d34-0410-b5e6-96231b3b80d8
* Per code review:\Reid Spencer2004-11-16
| | | | | | | | * Make sure we write out the foreign symbol table if we read one \ * Make the padding calculation more efficiently and avoid Solaris warnings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17883 91177308-0d34-0410-b5e6-96231b3b80d8
* * Make sure the string table gets read even if there isn't a foreignReid Spencer2004-11-15
| | | | | | | | | symbol table. * Make sure we update the file pointer for each member when rebuilding the symbol table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17812 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes necessary to enable linking of archives without LLVM symbol tables.Reid Spencer2004-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17811 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely rewritten to allow reading of archives and symbol table lookup in ↵Reid Spencer2004-11-14
| | | | | | a more efficient manner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17767 91177308-0d34-0410-b5e6-96231b3b80d8