Commit Graph

6242 Commits

Author SHA1 Message Date
Rafael Espindola
ef85994685 Simplify boolean conditional return statements in tools/llvm-symbolizer.
Patch by Richard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251216 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 23:23:25 +00:00
Rafael Espindola
51c6afaf85 Simplify boolean expressions in tools/llvm-objdump.
Patch by Richard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 23:19:10 +00:00
Rafael Espindola
715bccae4a Add a RAW mode to StringTableBuilder.
In this mode it just tries to tail merge the strings without imposing any other
format constrains. It will not, for example, add a null byte between them.

Also add support for keeping a tentative size and offset if we decide to
not optimize after all.

This will be used shortly in lld for merging SHF_STRINGS sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251153 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 21:48:05 +00:00
Oleg Ranevskyy
cd69ab5ddf Test commit: fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 17:10:44 +00:00
Davide Italiano
9d03be0459 [llvm-readobj] Don't cast qualifiers away. Now gcc is happy again.
Reported by: mikael.holmen at ericsson.com


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251117 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 16:52:22 +00:00
Davide Italiano
8c651fbc41 [JIT] Towards a working small memory model.
This commit introduces an option, --preallocate, so that we can get memory
upfront and use it in small memory model tests (in order to get
reliable results).

Differential Revision:	http://reviews.llvm.org/D13630


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250956 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21 22:12:03 +00:00
Kevin Enderby
da785374d9 Backing out commit r250906 as it broke lld.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250908 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21 17:13:20 +00:00
Kevin Enderby
e36c14fbed 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250906 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21 16:59:24 +00:00
Vedant Kumar
f890225b78 [llvm-cov] Adjust column widths for function and file reports
Previously, we only expanded function and filename column widths when
rendering file reports. This commit makes the change for function
reports as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250900 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21 16:03:32 +00:00
Mehdi Amini
33ee997b37 Revert "Add missing #include, found by modules build."
This reverts commit r250239.
It seems unwanted changes got committed here, and part of
the patch does not seem correct.
For instance RoundUpToAlignment() is called without its returned
value actually used.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250882 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21 06:10:55 +00:00
Duncan P. N. Exon Smith
1e221d5c2c bugpoint: Remove implicit ilist iterator conversions, NFC
This is the last of the implicit ilist iterator conversions in LLVM.
Still up for debate whether we let these bitrot back:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/091617.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250852 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 19:36:39 +00:00
Duncan P. N. Exon Smith
00f8d5fdf7 llvm-diff: Remove implicit ilist iterator conversions, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250842 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 18:17:05 +00:00
Manuel Klimek
1df0e84c25 Make class final to pacify -Wnon-virtual-dtor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250805 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 08:21:01 +00:00
Teresa Johnson
ca21c56a5f Pass FunctionInfoIndex by reference to WriteFunctionSummaryToFile (NFC)
Implemented suggestion by dblakie in review for r250704.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250723 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 19:06:06 +00:00
Lang Hames
65040b23fb [Orc] Add support for emitting indirect stubs directly into the JIT target's
memory, rather than representing the stubs in IR. Update the CompileOnDemand
layer to use this functionality.

Directly emitting stubs is much cheaper than building them in IR and codegen'ing
them (see below). It also plays well with remote JITing - stubs can be emitted
directly in the target process, rather than having to send them over the wire.

The downsides are:

(1) Care must be taken when resolving symbols, as stub symbols are held in a
    separate symbol table. This is only a problem for layer writers and other
    people using this API directly. The CompileOnDemand layer hides this detail.

(2) Aliases of function stubs can't be symbolic any more (since there's no
    symbol definition in IR), but must be converted into a constant pointer
    expression. This means that modules containing aliases of stubs cannot be
    cached. In practice this is unlikely to be a problem: There's no benefit to
    caching such a module anyway.

On balance I think the extra performance is more than worth the trade-offs: In a
simple stress test with 10000 dummy functions requiring stubs and a single
executed "hello world" main function, directly emitting stubs reduced user time
for JITing / executing by over 90% (1.5s for IR stubs vs 0.1s for direct
emission).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250712 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 17:43:51 +00:00
Teresa Johnson
aa8954c114 Convert gold-plugin unnecessary unique_ptr into local (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250704 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 15:23:03 +00:00
Teresa Johnson
bf3fb71116 Fix required library for r250699 to BitWriter instead of BitReader.
This should fix the mingw3 bot failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250703 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 15:21:46 +00:00
Teresa Johnson
d6e77b7d15 llvm-lto support for generating combined function indexes
Summary:
This patch adds support to llvm-lto that mirrors the support added by
r249270 to the gold plugin. This enables better testing of combined
index generation for ThinLTO.

Added a new test, and this support will be used in the test in D13515.

Reviewers: joker.eph

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13847

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250699 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 14:30:44 +00:00
Craig Topper
44bf343ec1 Make a bunch of static arrays const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 05:15:34 +00:00
Matthias Braun
cc2082e98f StreamWriter: List basic types instead of derived ones in HexNumber
This avoids problems with different (u)intXX definition on different
platforms. Specifically this fixes a case on OS/X which had uint64_t
defined as unsigned long long.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250589 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-17 00:08:45 +00:00
Reid Kleckner
9f85b269f8 Speculative fix for GCC build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250585 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 23:53:12 +00:00
Reid Kleckner
dd65b7a9f5 [llvm-symbolizer] Use the export table if no symbols are present
This lets us make guesses about symbols in third party DLLs without
debug info, like MSVCR120.dll or kernel32.dll. dbghelp does the same
thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250582 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 23:43:22 +00:00
Davide Italiano
c813f4ca03 [llvm-readobj] Teach ELFDumper about symbol versioning.
Differential Revision:	 http://reviews.llvm.org/D13824


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250575 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 23:19:01 +00:00
Davide Italiano
600b09339d [llvm-readobj/ELF] Dump DT_VERDEF/DT_VERDEFNUM correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250464 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 22:04:55 +00:00
Chris Bieneman
e0e13ae1e3 [CMake] [Darwin] Add support for generating Xcode-compatible toolchains that xcodebuild and xcrun can search
Summary:
Sometimes you want to install a custom compiler and use it like the system compiler without overriding the system compiler. This patch lets you create xctoolchains that the darwin command line tools can use.

To use this patch set LLVM_CREATE_XCODE_TOOLCHAIN=On in your CMake invocation and build the `install-code-toolchain` target.

After installation you can set the envar EXTERNAL_TOOLCHAINS_DIR to your installed Toolchains directory, and the TOOLCHAINS envar to the toolchain identifier (ex org.llvm.3.8.0svn). This will then cause /usr/bin/clang to call your newly installed clang.

Reviewers: Bigcheese, bogner

Subscribers: tobiasfar, llvm-commits

Differential Revision: http://reviews.llvm.org/D13605

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250450 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 20:09:01 +00:00
Benjamin Kramer
44b610a614 Make windows.h less evil.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250386 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 09:38:45 +00:00
Benjamin Kramer
44702c85e2 [llvm-pdbdump] Remove oddly placed parens that MSVC doesn't like
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 09:32:54 +00:00
David Majnemer
a1079b7d51 Speculatively unbreak Windows build
<windows.h> defines macros named min and max in conflict with
<algorithm>.  Prevent macro expansion by wrapping std::min in
parenthesis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250383 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 09:17:15 +00:00
David Majnemer
4e486b6a4d [llvm-pdbdump] Provide a mechanism to dump the raw contents of a PDB
A PDB can be thought of as a very simple file system.  It is
occasionally illuminating to see the contents of the underlying files.

Differential Revision: http://reviews.llvm.org/D13674

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 01:27:19 +00:00
Davide Italiano
bd133e68d8 [bugpoint] llvm-gcc doesn't exist anymore ...
... so this comment is stale. Remove it. Range-loopify while here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250354 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 01:12:01 +00:00
Davide Italiano
d88454bff7 [JIT] TrivialMemoryManager: Fail if we can't allocate memory.
TrivialMemoryManager currently doesn't check the return type of AllocateRWX --
and returns a 'null' MemoryBlock to its caller. As pointed out by Lang,
this exposes some serious issues with the MemoryManager interface. There's,
in fact, no way to report back an error to clients rather than aborting in
case memory can't be allocated. Eventually the interface will grow to support
this, but for now, fail sooner rather than later.

Differential Revision:	http://reviews.llvm.org/D13627


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 00:05:32 +00:00
Davide Italiano
f7b2acbdba [Bugpoint] Use 'CC' instead of 'GCC' for variable naming.
We now use clang by default and fallback to gcc when requested.
With this commit, names reflect reality. No functional change
intended.

Discussed with: Rafael Espindola.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 20:29:54 +00:00
Davide Italiano
e99d2083cf [Bugpoint] Use clang by default.
We now rely on gcc only if either of the following is true:
1) -gcc option is passed by the user
2) clang is not found in the default path.

Differential Revision:	 http://reviews.llvm.org/D13642


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250318 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 19:48:01 +00:00
Igor Kudrin
4598154b64 [llvm-readobj/ELF] Print GNU Hash section
Add a new command line switch, -gnu-hash-table, to print the content of that section.

Differential Revision: http://reviews.llvm.org/D13696


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 12:11:50 +00:00
Chris Bieneman
8f0bf9255c [CMake] Add LLVM_VERSION_PATCH to the -current_version flag for libLTO and libLLVM.
This is to match autoconf where LLVM_SUBMIT_SUBVERSION is usually set to ${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 07:50:21 +00:00
Richard Smith
1184005c1e Rename one of our two llvm::GCOVOptions classes to llvm::GCOV::Options. We used
to get away with this because llvm/Support/GCOV.h was an implementation detail
of the llvm-gcov tool, but it's now being used by FDO.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250258 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-14 00:04:19 +00:00
Chris Bieneman
b5348ec6af [CMake] Add compatibility and current versioning to libLTO to match autoconf support.
This also adds LLVM_LTO_VERSION_OFFSET to support functional equivalence to autoconf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-13 22:54:29 +00:00
Chris Bieneman
3038b3fcf2 [CMake] libLLVM's compatibility version should be 1.
This is in matching with the autoconf build system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-13 22:54:27 +00:00
Richard Smith
9c4cdfd521 Add missing #include, found by modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250239 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-13 22:24:10 +00:00
Vedant Kumar
337f9bbdd1 [uselistorder] Insert blank line, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250231 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-13 21:51:02 +00:00
Hemant Kulkarni
e8d28f3d7a [llvm-symbolizer] Add -print-address option
Differential Revision: http://reviews.llvm.org/D13518


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250086 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-12 19:26:44 +00:00
Colin LeMahieu
7e08dd1195 [llvm-symbolizer] Reverting r250067
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250072 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-12 17:57:02 +00:00
Hemant Kulkarni
6bd07138eb [llvm-symbolizer] Add -print-address option
Differential Revision  http://reviews.llvm.org/D13518


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250067 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-12 17:31:22 +00:00
Davide Italiano
dc7bc46ccd [llvm-rtdyld] General modernization/cleanup in preparation for (bigger) changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-12 00:57:29 +00:00
Davide Italiano
6dc307b5fd [Bugpoint] Get rid of dead code. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-11 21:36:11 +00:00
Davide Italiano
f2e1e0eaf4 [llvm-rtdyld] Use range-based loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249923 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-10 00:45:24 +00:00
Kevin Enderby
3d5fd2a768 Fix a bugs in the Mach-O disassembler when disassembling from a
malformed Mach-O file that caused a crash.  This was because of an
assert where the code was incorrectly attempting to parse relocation
entries off of the sections and the filetype was not an MH_OBJECT.

rdar://22983603


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249921 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-10 00:05:01 +00:00
Richard Smith
213ae79e1a Fix use of uninitialized bool, found by ubsan in portion of
test/tools/llvm-objdump/malformed-machos.test added in r249845.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09 22:09:56 +00:00
Chris Bieneman
0c1b206804 [CMake] If LLVM_DYLIB_EXPORT_ALL is On don't generate an export list at all, just export the world.
This should resolve Bug 24157 - CMake built shared library does not export all public symbols

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249862 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09 17:55:21 +00:00
Kevin Enderby
af90719473 Fixed two bugs in llvm-objdump’s printing of Objective-C meta data
from malformed Mach-O files that caused crashes.  The first because the
offset in a dyld bind table entry was out of range.  The second because their
was no image info section and the routine printing it did not have the
need check to see the section did not exist.

rdar://22983603


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249845 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09 16:48:44 +00:00