History log of /llvm-project/llvm/lib/Object/ObjectFile.cpp (Results 76 – 100 of 116)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 2e60ca96 24-Jun-2014 Rafael Espindola <rafael.espindola@gmail.com>

Pass a unique_ptr<MemoryBuffer> to the constructors in the Binary hierarchy.

Once the objects are constructed, they own the buffer. Passing a unique_ptr
makes that clear.

llvm-svn: 211595


# 6304e941 23-Jun-2014 Rafael Espindola <rafael.espindola@gmail.com>

Pass a std::unique_ptr& to the create??? methods is lib/Object.

This makes the buffer ownership on error conditions very natural. The buffer
is only moved out of the argument if an object is constru

Pass a std::unique_ptr& to the create??? methods is lib/Object.

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

show more ...


# c3f9b5a5 23-Jun-2014 Rafael Espindola <rafael.espindola@gmail.com>

Make ObjectFile and BitcodeReader always own the MemoryBuffer.

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 t

Make ObjectFile and BitcodeReader always own the MemoryBuffer.

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

show more ...


# db4ed0bd 13-Jun-2014 Rafael Espindola <rafael.espindola@gmail.com>

Remove 'using std::errro_code' from lib.

llvm-svn: 210871


# 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, llvmorg-3.4.1-rc1
# 56440fd8 06-Mar-2014 Ahmed Charles <ahmedcharles@gmail.com>

Replace OwningPtr<T> with std::unique_ptr<T>.

This compiles with no changes to clang/lld/lldb with MSVC and includes
overloads to various functions which are used by those projects and llvm
which ha

Replace OwningPtr<T> with std::unique_ptr<T>.

This compiles with no changes to clang/lld/lldb with MSVC and includes
overloads to various functions which are used by those projects and llvm
which have OwningPtr's as parameters. This should allow out of tree
projects some time to move. There are also no changes to libs/Target,
which should help out of tree targets have time to move, if necessary.

llvm-svn: 203083

show more ...


# 96c9d95f 05-Mar-2014 Ahmed Charles <ahmedcharles@gmail.com>

[C++11] Replace OwningPtr::take() with OwningPtr::release().

llvm-svn: 202957


# 40066cce 21-Feb-2014 Aaron Ballman <aaron@aaronballman.com>

Shankar kindly pointed out that I wasn't following the coding convention properly, so moving raw_ostream.h above system_error.h.

llvm-svn: 201885


# b1f8a5a5 21-Feb-2014 Aaron Ballman <aaron@aaronballman.com>

Fixing the MSVC build by including a file.

llvm-svn: 201884


# f12b8282 21-Feb-2014 Rafael Espindola <rafael.espindola@gmail.com>

Add a SymbolicFile interface between Binary and ObjectFile.

This interface allows IRObjectFile to be implemented without having dummy
methods for all section and segment related methods.

Both llvm-

Add a SymbolicFile interface between Binary and ObjectFile.

This interface allows IRObjectFile to be implemented without having dummy
methods for all section and segment related methods.

Both llvm-ar and llvm-nm are changed to use it. Unfortunately the mangler is
still not plugged in since it requires some refactoring to make a Module hold
a DataLayout.

llvm-svn: 201881

show more ...


# afcc3df7 24-Jan-2014 Rafael Espindola <rafael.espindola@gmail.com>

Make ObjectFile ownership of the MemoryBuffer optional.

This allows llvm-ar to mmap the input files only once.

llvm-svn: 200040


# ec46f318 22-Jan-2014 Rafael Espindola <rafael.espindola@gmail.com>

Pass the computed magic to createBinary and createObjectFile if available.

identify_magic is not free, so we should avoid calling it twice. The argument
also makes it cheap for createBinary to just

Pass the computed magic to createBinary and createObjectFile if available.

identify_magic is not free, so we should avoid calling it twice. The argument
also makes it cheap for createBinary to just forward to createObjectFile.

llvm-svn: 199813

show more ...


# 51cc3602 22-Jan-2014 Rafael Espindola <rafael.espindola@gmail.com>

Change createObjectFile to return an ErrorOr.

llvm-svn: 199776


# 692410ef 21-Jan-2014 Rafael Espindola <rafael.espindola@gmail.com>

Be a bit more consistent about using ErrorOr when constructing Binary objects.

The constructors of classes deriving from Binary normally take an error_code
as an argument to the constructor. My orig

Be a bit more consistent about using ErrorOr when constructing Binary objects.

The constructors of classes deriving from Binary normally take an error_code
as an argument to the constructor. My original intent was to change them
to have a trivial constructor and move the initial parsing logic to a static
method returning an ErrorOr. I changed my mind because:

* A constructor with an error_code out parameter is extremely convenient from
the implementation side. We can incrementally construct the object and give
up when we find an error.
* It is very efficient when constructing on the stack or when there is no
error. The only inefficient case is where heap allocating and an error is
found (we have to free the memory).

The result is that this is a much smaller patch. It just standardizes the
create* helpers to return an ErrorOr.

Almost no functionality change: The only difference is that this found that
we were trying to read past the end of COFF import library but ignoring the
error.

llvm-svn: 199770

show more ...


Revision tags: llvmorg-3.4.0, llvmorg-3.4.0-rc3, llvmorg-3.4.0-rc2, llvmorg-3.4.0-rc1
# e448f9e4 15-Nov-2013 Rui Ueyama <ruiu@google.com>

Path: Recognize COFF import library file magic.

Summary: Make identify_magic to recognize COFF import file.

Reviewers: Bigcheese

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandl

Path: Recognize COFF import library file magic.

Summary: Make identify_magic to recognize COFF import file.

Reviewers: Bigcheese

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2165

llvm-svn: 194852

show more ...


# fc149a69 15-Oct-2013 Rui Ueyama <ruiu@google.com>

Path: Recognize Windows compiled resource file.

Some background: One can pass compiled resource files (.res files) directly
to the linker on Windows. If a resource file is given, the linker will run

Path: Recognize Windows compiled resource file.

Some background: One can pass compiled resource files (.res files) directly
to the linker on Windows. If a resource file is given, the linker will run
"cvtres" command in background to convert the resource file to a COFF file
to link it.

What I'm trying to do with this patch is to make the linker to recognize
the resource file by file magic, so that it can run cvtres command.

Differential Revision: http://llvm-reviews.chandlerc.com/D1943

llvm-svn: 192742

show more ...


# 4d76a21b 24-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com>

Delete the buffer in createObjectFile if it fails.

The Binary constructor takes ownership of the memory buffer. This is a fairly
unfortunate interface, but for now make createObjectFile consistent w

Delete the buffer in createObjectFile if it fails.

The Binary constructor takes ownership of the memory buffer. This is a fairly
unfortunate interface, but for now make createObjectFile consistent with it
by also deleting the buffer if it fails.

Fixes a leak in llvm-ar found by the valgrind bots.

llvm-svn: 187039

show more ...


Revision tags: llvmorg-3.3.1-rc1
# e6388e62 18-Jun-2013 Alexey Samsonov <samsonov@google.com>

Basic support for parsing Mach-O universal binaries in LLVMObject library

llvm-svn: 184191


# 447d2d12 11-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com>

Fix variable name style. Don't cast to and from int.

This enables the compiler to see the enum and produce warnings about a switch
not being fully covered. Fix one of these warnings.

llvm-svn: 1837

Fix variable name style. Don't cast to and from int.

This enables the compiler to see the enum and produce warnings about a switch
not being fully covered. Fix one of these warnings.

llvm-svn: 183749

show more ...


# cd81b909 11-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com>

Convert another use of sys::identifyFileType.

No functionality change.

llvm-svn: 183747


# 1dc43065 10-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com>

Pass a StringRef to sys::identifyFileType.

llvm-svn: 183669


Revision tags: llvmorg-3.3.0, llvmorg-3.3.0-rc3
# 4f60a38f 30-May-2013 Rafael Espindola <rafael.espindola@gmail.com>

Change how we iterate over relocations on ELF.

For COFF and MachO, sections semantically have relocations that apply to them.
That is not the case on ELF.

In relocatable objects (.o), a section wit

Change how we iterate over relocations on ELF.

For COFF and MachO, sections semantically have relocations that apply to them.
That is not the case on ELF.

In relocatable objects (.o), a section with relocations in ELF has offsets to
another section where the relocations should be applied.

In dynamic objects and executables, relocations don't have an offset, they have
a virtual address. The section sh_info may or may not point to another section,
but that is not actually used for resolving the relocations.

This patch exposes that in the ObjectFile API. It has the following advantages:

* Most (all?) clients can handle this more efficiently. They will normally walk
all relocations, so doing an effort to iterate in a particular order doesn't
save time.

* llvm-readobj now prints relocations in the same way the native readelf does.

* probably most important, relocations that don't point to any section are now
visible. This is the case of relocations in the rela.dyn section. See the
updated relocation-executable.test for example.

llvm-svn: 182908

show more ...


Revision tags: llvmorg-3.3.0-rc2, llvmorg-3.3.0-rc1
# e4dd2e01 29-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com>

Add getSymbolAlignment to the ObjectFile interface.

For regular object files this is only meaningful for common symbols. An object
file format with direct support for atoms should be able to provide

Add getSymbolAlignment to the ObjectFile interface.

For regular object files this is only meaningful for common symbols. An object
file format with direct support for atoms should be able to provide alignment
information for all symbols.

This replaces getCommonSymbolAlignment and fixes
test-common-symbols-alignment.ll on darwin. This also includes a fix to
MachOObjectFile::getSymbolFlags. It was marking undefined symbols as common
(already tested by existing mcjit tests now that it is used).

llvm-svn: 180736

show more ...


# 717c4d44 07-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com>

Remove unused argument.

llvm-svn: 178987


12345