#
e3bf4fd5 |
| 21-Oct-2015 |
Kevin Enderby <enderby@apple.com> |
This removes the eating of the error in Archive::Child::getSize() when the characters in the size field in the archive header for the member is not a number. To do this we have all of the needed met
This removes the eating of the error in Archive::Child::getSize() when the characters in the size field in the archive header for the member is not a number. To do this we have all of the needed methods return ErrorOr to push them up until we get out of lib. Then the tools and can handle the error in whatever way is appropriate for that tool.
So the solution is to plumb all the ErrorOr stuff through everything that touches archives. This include its iterators as one can create an Archive object but the first or any other Child object may fail to be created due to a bad size field in its header.
Thanks to Lang Hames on the changes making child_iterator contain an ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add operator overloading for * and -> .
We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash” and using report_fatal_error() to move the error checking will cause the program to stop, neither of which are really correct in library code. There are still some uses of these that should be cleaned up in this library code for other than the size field.
Also corrected the code where the size gets us to the “at the end of the archive” which is OK but past the end of the archive will return object_error::parse_failed now.
The test cases use archives with text files so one can see the non-digit character, in this case a ‘%’, in the size field.
llvm-svn: 250906
show more ...
|
#
f0acbbfd |
| 03-Oct-2015 |
Davide Italiano <davide@freebsd.org> |
[llvm-size] Fix time to check if time of use bug.
This was the last tool relying on this pattern.
llvm-svn: 249244
|
Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1 |
|
#
572e03a3 |
| 19-Jun-2015 |
Eric Christopher <echristo@gmail.com> |
Fix "the the" in comments.
llvm-svn: 240112
|
#
d319c4fb |
| 03-Jun-2015 |
Alexey Samsonov <vonosmas@gmail.com> |
[Object, MachO] Introduce MachOObjectFile::load_commands() range iterator.
Summary: Now users don't have to manually deal with getFirstLoadCommandInfo() / getNextLoadCommandInfo(), calculate the num
[Object, MachO] Introduce MachOObjectFile::load_commands() range iterator.
Summary: Now users don't have to manually deal with getFirstLoadCommandInfo() / getNextLoadCommandInfo(), calculate the number of load segments, etc.
No functionality change.
Test Plan: regression test suite
Reviewers: rafael, lhames, loladiro
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10144
llvm-svn: 238983
show more ...
|
Revision tags: llvmorg-3.6.1, llvmorg-3.6.1-rc1, llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2 |
|
#
e71fb5ce |
| 22-Jan-2015 |
Chris Bieneman <beanz@apple.com> |
Assigning and copying command line option objects shouldn't be allowed.
Summary: The default copy and assignment operators for these objects probably don't actually do what the clients intend, so th
Assigning and copying command line option objects shouldn't be allowed.
Summary: The default copy and assignment operators for these objects probably don't actually do what the clients intend, so they should be deleted.
Places using the assignment operator to set the value of an option should cast to the option's data type first to call into the override for operator=. Places using the copy constructor just need to be changed to not copy (i.e. passing by const reference instead of value).
Reviewers: dexonsmith, chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7114
llvm-svn: 226762
show more ...
|
Revision tags: llvmorg-3.6.0-rc1 |
|
#
d9903888 |
| 14-Jan-2015 |
Chandler Carruth <chandlerc@gmail.com> |
[cleanup] Re-sort all the #include lines in LLVM using utils/sort_includes.py.
I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the Inst
[cleanup] Re-sort all the #include lines in LLVM using utils/sort_includes.py.
I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order.
llvm-svn: 225974
show more ...
|
Revision tags: llvmorg-3.5.1, llvmorg-3.5.1-rc2 |
|
#
0bfe828f |
| 09-Dec-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Return ErrorOr<std::unique_ptr<Archive>> form getAsArchive.
This is the same return type of Archive::create.
llvm-svn: 223827
|
Revision tags: llvmorg-3.5.1-rc1 |
|
#
80291274 |
| 08-Oct-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove bogus std::error_code returns form SectionRef.
There are two methods in SectionRef that can fail:
* getName: The index into the string table can be invalid. * getContents: The section might
Remove bogus std::error_code returns form SectionRef.
There are two methods in SectionRef that can fail:
* getName: The index into the string table can be invalid. * getContents: The section might point to invalid contents.
Every other method will always succeed and returning and std::error_code just complicates the code. For example, a section can have an invalid alignment, but if we are able to get to the section structure at all and create a SectionRef, we will always be able to read that invalid alignment.
llvm-svn: 219314
show more ...
|
#
3e5cc65e |
| 11-Sep-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use the simpler sys::fs:;exists. NFC.
llvm-svn: 217617
|
Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3 |
|
#
48af1c2a |
| 19-Aug-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't own the buffer in object::Binary.
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
Don't own the buffer in object::Binary.
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
show more ...
|
#
72318b47 |
| 08-Aug-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use a simpler predicate. NFC.
llvm-svn: 215218
|
Revision tags: llvmorg-3.5.0-rc2 |
|
#
3f6481d0 |
| 01-Aug-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove some calls to std::move.
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
|
#
437b0d58 |
| 31-Jul-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use std::unique_ptr to make the ownership explicit.
llvm-svn: 214377
|
Revision tags: llvmorg-3.5.0-rc1 |
|
#
10769747 |
| 01-Jul-2014 |
Kevin Enderby <enderby@apple.com> |
Run clang-format on llvm-size.cpp to tidy things up. No functional changes.
llvm-svn: 212141
|
#
afef4c99 |
| 01-Jul-2014 |
Kevin Enderby <enderby@apple.com> |
Add the -arch flag support to llvm-size like what was done to llvm-nm to select the slice out of a Mach-O universal file. This also includes support for -arch all, selecting the host architecture by
Add the -arch flag support to llvm-size like what was done to llvm-nm to select the slice out of a Mach-O universal file. This also includes support for -arch all, selecting the host architecture by default from a universal file and checking if -arch is used with a standard Mach-O it matches that architecture.
llvm-svn: 212108
show more ...
|
#
4f7932b2 |
| 23-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Convert a few methods to use ErrorOr.
It used to be inconvenient to mix ErrorOr and UniquePtr, but with c++11 they work OK together.
llvm-svn: 211532
|
#
14a96ac3 |
| 20-Jun-2014 |
Kevin Enderby <enderby@apple.com> |
Added the -m option as an alias for -format=darwin to llvm-nm and llvm-size which is what the darwin tools use for the Mach-O format output.
llvm-svn: 211326
|
#
1983fcf8 |
| 19-Jun-2014 |
Kevin Enderby <enderby@apple.com> |
Change the output of llvm-nm and llvm-size for Mach-O universal files (aka fat files) to print “ (for architecture XYZ)” for fat files with more than one architecture to be like what the darwin tools
Change the output of llvm-nm and llvm-size for Mach-O universal files (aka fat files) to print “ (for architecture XYZ)” for fat files with more than one architecture to be like what the darwin tools do for fat files.
Also clean up the Mach-O printing of archive membernames in llvm-nm to use the darwin form of "libx.a(foo.o)".
llvm-svn: 211316
show more ...
|
#
4b8fc281 |
| 18-Jun-2014 |
Kevin Enderby <enderby@apple.com> |
Teach llvm-size to know about Mach-O universal files (aka fat files) and fat files containing archives.
Also fix a bug in MachOUniversalBinary::ObjectForArch::ObjectForArch() where it needed a >= wh
Teach llvm-size to know about Mach-O universal files (aka fat files) and fat files containing archives.
Also fix a bug in MachOUniversalBinary::ObjectForArch::ObjectForArch() where it needed a >= when comparing the Index with the number of objects in a fat file. As the index starts at 0.
llvm-svn: 211230
show more ...
|
#
246a460d |
| 17-Jun-2014 |
Kevin Enderby <enderby@apple.com> |
Add "-format darwin" to llvm-size to be like darwin's size(1) -m output, and and the -l option for the long format. Also when the object is a Mach-O file and the format is berkeley produce output li
Add "-format darwin" to llvm-size to be like darwin's size(1) -m output, and and the -l option for the long format. Also when the object is a Mach-O file and the format is berkeley produce output like darwin’s default size(1) summary berkeley derived output.
Like System V format, there are also some small changes in how and where the file names and archive member names are printed for darwin and Mach-O.
Like the changes to llvm-nm these are the first steps in seeing if it is possible to make llvm-size produce the same output as darwin's size(1).
llvm-svn: 211117
show more ...
|
#
ae460027 |
| 16-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Convert the Archive API to use ErrorOr.
Now that we have c++11, even things like ErrorOr<std::unique_ptr<...>> are easy to use.
No intended functionality change.
llvm-svn: 211033
|
#
4453e429 |
| 13-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove 'using std::error_code' from tools.
llvm-svn: 210876
|
#
3acea398 |
| 12-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't use 'using std::error_code' in include/llvm.
This should make sure that most new uses use the std prefix.
llvm-svn: 210835
|
#
a6e9c3e4 |
| 12-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove system_error.h.
This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch.
llvm-svn: 210803
|
Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1, llvmorg-3.4.1, llvmorg-3.4.1-rc2 |
|
#
e6cb63e4 |
| 25-Apr-2014 |
Craig Topper <craig.topper@gmail.com> |
[C++] Use 'nullptr'. Tools edition.
llvm-svn: 207176
|