Commit Graph

5096 Commits

Author SHA1 Message Date
Rafael Espindola
78e8d52a58 llvm-objdump: don't print relocations in non-relocatable files.
This matches the behavior of GNU objdump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215844 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-17 19:09:37 +00:00
Rafael Espindola
4c511cd88f Fix an off-by-one bug in the target independent llvm-objdump.
It would prevent the display of a single byte instruction before a label.

Patch by Steve King!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215837 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-17 16:31:39 +00:00
Aaron Ballman
1ab70ef650 Silencing some -Wcast-qual warnings and removing some C-style casts at the same time. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215643 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-14 13:53:19 +00:00
Rafael Espindola
d6448b21bf Simplify ownership with std::unique_ptr. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215566 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13 18:49:01 +00:00
Benjamin Kramer
00e08fcaa0 Canonicalize header guards into a common format.
Add header guards to files that were missing guards. Remove #endif comments
as they don't seem common in LLVM (we can easily add them back if we decide
they're useful)

Changes made by clang-tidy with minor tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215558 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13 16:26:38 +00:00
Tim Northover
48bfab80aa llvm-objdump: print contents of MachO __unwind_info sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215437 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 11:52:59 +00:00
Rafael Espindola
b2d2f28351 Fix using -plugin-opt=apiflie when also using -plugin-opt=emit-llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215378 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-11 19:06:54 +00:00
Tim Northover
835cfaa11b llvm-objdump: fix remaining use of %x format specifier for 64-bit values
Third time lucky. This should finally fix the ARM (& MIPS, I think) bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215349 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-11 09:14:06 +00:00
Rafael Espindola
0bd9423c27 getLoadName is only implemented for ELF, make it ELF only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215219 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 16:39:22 +00:00
Rafael Espindola
015f57679d Use a simpler predicate. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215218 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 16:30:17 +00:00
Tim Northover
b56b256896 llvm-objdump: add missing % in format specifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215198 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 12:08:51 +00:00
Tim Northover
5ccbb28fc9 llvm-objdump: use portable format specifiers for info.
ARM bots (& others, I think, now that I look) were failing because we
were using incorrect printf-style format specifiers. They were wrong
on almost any platform, actually, just mostly harmlessly so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215196 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 12:00:09 +00:00
Eric Christopher
aa5b9c0f6f Temporarily Revert "Nuke the old JIT." as it's not quite ready to
be deleted. This will be reapplied as soon as possible and before
the 3.6 branch date at any rate.

Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reverts commits r215111, 215115, 215116, 215117, 215136.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215154 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 22:02:54 +00:00
Rafael Espindola
7b232e2bb6 fix configure+make build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215116 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 14:38:49 +00:00
Rafael Espindola
875710a2fd Nuke the old JIT.
I am sure we will be finding bits and pieces of dead code for years to
come, but this is a good start.

Thanks to Lang Hames for making MCJIT a good replacement!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215111 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 14:21:18 +00:00
Kevin Enderby
75d423feed Add the -mcpu= option to llvm-objdump for use with the disassemblers.
Also make the disassembler created with the Mach-O parser (the -m option)
pick up the Target specific attributes specified with -mattr option.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-06 23:24:41 +00:00
Lang Hames
416ea4bfa7 [MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify
mode.

This will cause -verify mode to report failure when RuntimeDyld encounters an
internal error (e.g. overflows in relocation computations). Previously we had
let these errors slip past unreported.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214925 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-05 20:51:46 +00:00
Rafael Espindola
0ca286752e Don't internalize all but main by default.
This is mostly a cleanup, but it changes a fairly old behavior.

Every "real" LTO user was already disabling the silly internalize pass
and creating the internalize pass itself. The difference with this
patch is for "opt -std-link-opts" and the C api.

Now to get a usable behavior out of opt one doesn't need the funny
looking command line:

opt -internalize -disable-internalize -internalize-public-api-list=foo,bar -std-link-opts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214919 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-05 20:10:38 +00:00
Eric Christopher
9f85dccfc6 Remove the TargetMachine forwards for TargetSubtargetInfo based
information and update all callers. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214781 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 21:25:23 +00:00
Duncan P. N. Exon Smith
1d3169155b verify-uselistorder: Reverse use-lists at every verification
Updated `verify-uselistorder` to more than double the number of use-list
orders it checks.

  - Every time it verifies an order, it then reverses the order and
    verifies again.

  - It now verifies the initial order, before running any shuffles.

Changed the default to `-num-shuffles=1`, since this is already four
checks, and after r214584 shuffling is guaranteed to make a new order.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214596 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 23:49:41 +00:00
Duncan P. N. Exon Smith
4277019a75 verify-uselistorder: Add missing static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214595 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 23:31:13 +00:00
Duncan P. N. Exon Smith
b2b0ad4c75 verify-uselistorder: Move shuffleUseLists() out of lib/IR
`shuffleUseLists()` is only used in `verify-uselistorder`, so move it
there to avoid bloating other executables.  As a drive-by, update some
of the header docs.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214592 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 23:03:36 +00:00
Duncan P. N. Exon Smith
236c1ac873 verify-uselistorder: Make the verification logic easier to reuse
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214587 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 22:52:06 +00:00
Rafael Espindola
fff7ba35a3 Use object::Archive::create instead of new object::Archive.
Also fix the error handling. No testcaes, issue found by inspection.

Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214535 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 18:31:17 +00:00
Rafael Espindola
6312816b42 Replace comment about ownership with std::unique_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214533 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 18:09:32 +00:00
Rafael Espindola
09237b8968 Remove lto_codegen_set_attr.
It was never exported, so no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214519 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 14:57:05 +00:00
Rafael Espindola
9aa0b5e11e 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214516 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 14:31:55 +00:00
Tim Northover
f28a36e527 llvm-objdump: implement printing for MachO __compact_unwind info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214509 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 13:07:19 +00:00
Sylvestre Ledru
2fd13bbae0 Revert of 214418:
"Create a default symver on Linux like ELF OSes."

Fails the build under Debian with ld.gold:
/usr/bin/ld.gold: --default-symver: unknown option




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214482 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 06:16:03 +00:00
Rafael Espindola
03c8d18ced Replaces a few pointers with references in llvm-nm.cpp.
This opens the way for a few std::uinque_ptr cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214439 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 21:00:10 +00:00
Hans Wennborg
36daac3759 msbuild integration: remove duplicated lines and BOM from 2014 integration (PR20341)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214435 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 20:33:22 +00:00
Rafael Espindola
81becb73ab Use a reference instead of a pointer.
This makes using a std::unique_ptr in the caller more convenient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214433 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 20:19:36 +00:00
Rafael Espindola
72c5355bbe Remove unused argument.
Thanks to Justin Bogner for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214426 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 19:32:04 +00:00
Rafael Espindola
1023307a7d Move MCObjectSymbolizer.h to MC/MCAnalysis.
The cpp file is already in lib/MC/MCAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214424 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 19:29:23 +00:00
Duncan P. N. Exon Smith
94f7c7aeaa verify-uselistorder: Change the default -num-shuffles=5
Change the default for `-num-shuffles` to 5 and better document the
algorithm in the header docs of `verify-uselistorder`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 18:46:24 +00:00
Eric Christopher
26d83150b4 Create a default symver on Linux like ELF OSes.
Patch by Adam Jackson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214418 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 18:43:43 +00:00
Rafael Espindola
79002da926 Use std::unique_ptr to make the ownership explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214377 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 03:12:45 +00:00
Duncan P. N. Exon Smith
89c4197256 Rename llvm-uselistorder => verify-uselistorder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214318 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 17:11:27 +00:00
Duncan P. N. Exon Smith
4a9efdaf9f llvm-uselistorder: Improve the tool description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214317 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 16:59:19 +00:00
Duncan P. N. Exon Smith
e188fa672b llvm-uselistorder: Fix memory leak from r214125
Turns out `parseBitcodeFile()` does *not* take ownership of the buffer.
This was already clear in the header docs, but I obviously didn't read
them (having noticed that it gets stored in a `unique_ptr<>`).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214313 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 16:50:22 +00:00
Lang Hames
e1681c941e [MCJIT] Actually remap sections based llvm-rtdyld options added in r214255.
This line was accidentally left out of that patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214282 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 03:12:41 +00:00
Rafael Espindola
562fd7a830 Use range loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214280 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 01:52:40 +00:00
Rafael Espindola
3bff0d2b95 Convert a few more function pointer calls to just "f()".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214276 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 01:36:32 +00:00
Rafael Espindola
fe580aaa2b Don't duplicate the function name in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214272 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 01:23:45 +00:00
Rafael Espindola
601bb093ef Use function pointers with just f(1,2) instead of (*f)(1,2).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214265 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-30 00:38:58 +00:00
Lang Hames
41364b7d54 [MCJIT] Add options to llvm-rtdyld to describe a phony target address space for
use in -verify mode.

This patch adds three hidden command line options to llvm-rtdyld:

 -target-addr-start <start-addr> : Specify the start of the virtual address
                                   space on the phony target.

 -target-addr-end   <end-addr>   : Specify the end of the virtual address space
                                   on the phony target.

 -target-section-sep <sep>       : Specify the separation (in bytes) between the
                                   end of one section and the start of the next.

These options automatically default to sane values for the target platform. In
particular, they allow narrow (e.g. 32-bit, 16-bit) targets to be tested from
wider (e.g. 64-bit, 32-bit) hosts without overflowing pointers.

The section separation option defaults to zero, but can be set to a large number
(e.g. 1 << 32) to force large separations between sections in order to
stress-test large-code-model code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214255 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 23:43:13 +00:00
Rafael Espindola
3c08473236 Use nullptr instead of NULL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214229 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 21:46:05 +00:00
Rafael Espindola
9a3b1ebcb1 Remove unused includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214226 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 21:38:05 +00:00
Rafael Espindola
ee7f2db4d0 Delete dead code.
The gold plugin doesn't call lseek or read directly any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214221 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 21:09:43 +00:00
Rafael Espindola
df7568e9f3 gold plugin: Fix handling of corrupted bitcode files.
We should still claim them and tell gold about the error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214214 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 20:46:19 +00:00