1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 22:42:46 +02:00
Commit Graph

6170 Commits

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

llvm-svn: 251216
2015-10-24 23:23:25 +00:00
Rafael Espindola
1149216eae Simplify boolean expressions in tools/llvm-objdump.
Patch by Richard.

llvm-svn: 251215
2015-10-24 23:19:10 +00:00
Rafael Espindola
a6bc23879a 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.

llvm-svn: 251153
2015-10-23 21:48:05 +00:00
Oleg Ranevskyy
4d25723e05 Test commit: fix typo in comment.
llvm-svn: 251122
2015-10-23 17:10:44 +00:00
Davide Italiano
23e7cc7366 [llvm-readobj] Don't cast qualifiers away. Now gcc is happy again.
Reported by: mikael.holmen at ericsson.com

llvm-svn: 251117
2015-10-23 16:52:22 +00:00
Davide Italiano
dbd9dcfcf6 [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

llvm-svn: 250956
2015-10-21 22:12:03 +00:00
Kevin Enderby
1d015d1179 Backing out commit r250906 as it broke lld.
llvm-svn: 250908
2015-10-21 17:13:20 +00:00
Kevin Enderby
bcb0d035e4 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
2015-10-21 16:59:24 +00:00
Vedant Kumar
34ef13aeba [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.

llvm-svn: 250900
2015-10-21 16:03:32 +00:00
Mehdi Amini
3e5272af34 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>
llvm-svn: 250882
2015-10-21 06:10:55 +00:00
Duncan P. N. Exon Smith
cc73874cf4 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

llvm-svn: 250852
2015-10-20 19:36:39 +00:00
Duncan P. N. Exon Smith
a03b90372e llvm-diff: Remove implicit ilist iterator conversions, NFC
llvm-svn: 250842
2015-10-20 18:17:05 +00:00
Manuel Klimek
fa13a98a8a Make class final to pacify -Wnon-virtual-dtor.
llvm-svn: 250805
2015-10-20 08:21:01 +00:00
Teresa Johnson
4655ffb0a6 Pass FunctionInfoIndex by reference to WriteFunctionSummaryToFile (NFC)
Implemented suggestion by dblakie in review for r250704.

llvm-svn: 250723
2015-10-19 19:06:06 +00:00
Lang Hames
4bba9adcc4 [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).

llvm-svn: 250712
2015-10-19 17:43:51 +00:00
Teresa Johnson
0fb3f39b16 Convert gold-plugin unnecessary unique_ptr into local (NFC)
llvm-svn: 250704
2015-10-19 15:23:03 +00:00
Teresa Johnson
e92d7c468f Fix required library for r250699 to BitWriter instead of BitReader.
This should fix the mingw3 bot failure.

llvm-svn: 250703
2015-10-19 15:21:46 +00:00
Teresa Johnson
8fa2a4762b 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

llvm-svn: 250699
2015-10-19 14:30:44 +00:00
Craig Topper
c8409f4435 Make a bunch of static arrays const.
llvm-svn: 250642
2015-10-18 05:15:34 +00:00
Matthias Braun
9dcf26ed04 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.

llvm-svn: 250589
2015-10-17 00:08:45 +00:00
Reid Kleckner
2cc4abce13 Speculative fix for GCC build
llvm-svn: 250585
2015-10-16 23:53:12 +00:00
Reid Kleckner
43d4930f19 [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.

llvm-svn: 250582
2015-10-16 23:43:22 +00:00
Davide Italiano
af14715a42 [llvm-readobj] Teach ELFDumper about symbol versioning.
Differential Revision:	 http://reviews.llvm.org/D13824

llvm-svn: 250575
2015-10-16 23:19:01 +00:00
Davide Italiano
47737b25b7 [llvm-readobj/ELF] Dump DT_VERDEF/DT_VERDEFNUM correctly.
llvm-svn: 250464
2015-10-15 22:04:55 +00:00
Chris Bieneman
d34bb8a756 [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

llvm-svn: 250450
2015-10-15 20:09:01 +00:00
Benjamin Kramer
ab434b357e Make windows.h less evil.
llvm-svn: 250386
2015-10-15 09:38:45 +00:00
Benjamin Kramer
79ff9a3d34 [llvm-pdbdump] Remove oddly placed parens that MSVC doesn't like
llvm-svn: 250385
2015-10-15 09:32:54 +00:00
David Majnemer
3d207d083d 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.

llvm-svn: 250383
2015-10-15 09:17:15 +00:00
David Majnemer
6f3ef70e32 [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

llvm-svn: 250356
2015-10-15 01:27:19 +00:00
Davide Italiano
eac74efe76 [bugpoint] llvm-gcc doesn't exist anymore ...
... so this comment is stale. Remove it. Range-loopify while here.

llvm-svn: 250354
2015-10-15 01:12:01 +00:00
Davide Italiano
c86d3309a5 [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

llvm-svn: 250350
2015-10-15 00:05:32 +00:00
Davide Italiano
9fca22ddf4 [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.

llvm-svn: 250321
2015-10-14 20:29:54 +00:00
Davide Italiano
b2aad5775a [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

llvm-svn: 250318
2015-10-14 19:48:01 +00:00
Igor Kudrin
9a3f5f5cf9 [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

llvm-svn: 250291
2015-10-14 12:11:50 +00:00
Chris Bieneman
20487687e5 [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}.

llvm-svn: 250277
2015-10-14 07:50:21 +00:00
Richard Smith
b279442823 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.

llvm-svn: 250258
2015-10-14 00:04:19 +00:00
Chris Bieneman
4b5a0d9544 [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.

llvm-svn: 250245
2015-10-13 22:54:29 +00:00
Chris Bieneman
a190c153d6 [CMake] libLLVM's compatibility version should be 1.
This is in matching with the autoconf build system.

llvm-svn: 250244
2015-10-13 22:54:27 +00:00
Richard Smith
61ae84603b Add missing #include, found by modules build.
llvm-svn: 250239
2015-10-13 22:24:10 +00:00
Vedant Kumar
cdd66aa708 [uselistorder] Insert blank line, NFC
llvm-svn: 250231
2015-10-13 21:51:02 +00:00
Hemant Kulkarni
0464ae6dc8 [llvm-symbolizer] Add -print-address option
Differential Revision: http://reviews.llvm.org/D13518

llvm-svn: 250086
2015-10-12 19:26:44 +00:00
Colin LeMahieu
d73327a49c [llvm-symbolizer] Reverting r250067
llvm-svn: 250072
2015-10-12 17:57:02 +00:00
Hemant Kulkarni
7dd48fdc72 [llvm-symbolizer] Add -print-address option
Differential Revision  http://reviews.llvm.org/D13518

llvm-svn: 250067
2015-10-12 17:31:22 +00:00
Davide Italiano
35bfd00e5a [llvm-rtdyld] General modernization/cleanup in preparation for (bigger) changes.
llvm-svn: 250004
2015-10-12 00:57:29 +00:00
Davide Italiano
2fa01ffad6 [Bugpoint] Get rid of dead code. No functional change.
llvm-svn: 249999
2015-10-11 21:36:11 +00:00
Davide Italiano
8b3ac7fec5 [llvm-rtdyld] Use range-based loop. NFC.
llvm-svn: 249923
2015-10-10 00:45:24 +00:00
Kevin Enderby
ad8640ff94 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

llvm-svn: 249921
2015-10-10 00:05:01 +00:00
Richard Smith
8f98b3dd2c Fix use of uninitialized bool, found by ubsan in portion of
test/tools/llvm-objdump/malformed-machos.test added in r249845.

llvm-svn: 249909
2015-10-09 22:09:56 +00:00
Chris Bieneman
02ac6a064f [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

llvm-svn: 249862
2015-10-09 17:55:21 +00:00
Kevin Enderby
deb345cf57 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

llvm-svn: 249845
2015-10-09 16:48:44 +00:00