Commit Graph

5022 Commits

Author SHA1 Message Date
Aaron Ballman 80930af374 Silencing some -Wcast-qual warnings and removing some C-style casts at the same time. NFC.
llvm-svn: 215643
2014-08-14 13:53:19 +00:00
Rafael Espindola 5f2bb7d9b8 Simplify ownership with std::unique_ptr. NFC.
llvm-svn: 215566
2014-08-13 18:49:01 +00:00
Benjamin Kramer a7c40ef022 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.

llvm-svn: 215558
2014-08-13 16:26:38 +00:00
Tim Northover 39c70bbf56 llvm-objdump: print contents of MachO __unwind_info sections
llvm-svn: 215437
2014-08-12 11:52:59 +00:00
Rafael Espindola 55b3254ea2 Fix using -plugin-opt=apiflie when also using -plugin-opt=emit-llvm.
llvm-svn: 215378
2014-08-11 19:06:54 +00:00
Tim Northover 63a2562552 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.

llvm-svn: 215349
2014-08-11 09:14:06 +00:00
Rafael Espindola 676223170f getLoadName is only implemented for ELF, make it ELF only.
llvm-svn: 215219
2014-08-08 16:39:22 +00:00
Rafael Espindola 72318b47fc Use a simpler predicate. NFC.
llvm-svn: 215218
2014-08-08 16:30:17 +00:00
Tim Northover 06af260b85 llvm-objdump: add missing % in format specifier.
llvm-svn: 215198
2014-08-08 12:08:51 +00:00
Tim Northover b911bf84dc 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.

llvm-svn: 215196
2014-08-08 12:00:09 +00:00
Eric Christopher b9fd9ed37e 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.

llvm-svn: 215154
2014-08-07 22:02:54 +00:00
Rafael Espindola ea9c317000 fix configure+make build
llvm-svn: 215116
2014-08-07 14:38:49 +00:00
Rafael Espindola f8b27c41e8 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!

llvm-svn: 215111
2014-08-07 14:21:18 +00:00
Kevin Enderby c959562092 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.

llvm-svn: 215032
2014-08-06 23:24:41 +00:00
Lang Hames ae17268a7e [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.

llvm-svn: 214925
2014-08-05 20:51:46 +00:00
Rafael Espindola f9e52cf015 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

llvm-svn: 214919
2014-08-05 20:10:38 +00:00
Eric Christopher d913448b38 Remove the TargetMachine forwards for TargetSubtargetInfo based
information and update all callers. No functional change.

llvm-svn: 214781
2014-08-04 21:25:23 +00:00
Duncan P. N. Exon Smith a5a8d3f6f2 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.

llvm-svn: 214596
2014-08-01 23:49:41 +00:00
Duncan P. N. Exon Smith 9a2017bfc3 verify-uselistorder: Add missing `static`
llvm-svn: 214595
2014-08-01 23:31:13 +00:00
Duncan P. N. Exon Smith 3da117d272 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.

llvm-svn: 214592
2014-08-01 23:03:36 +00:00
Duncan P. N. Exon Smith 36d57a2303 verify-uselistorder: Make the verification logic easier to reuse
llvm-svn: 214587
2014-08-01 22:52:06 +00:00
Rafael Espindola e192341de7 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.

llvm-svn: 214535
2014-08-01 18:31:17 +00:00
Rafael Espindola ce47a05c7c Replace comment about ownership with std::unique_ptr.
llvm-svn: 214533
2014-08-01 18:09:32 +00:00
Rafael Espindola 77f1f8f170 Remove lto_codegen_set_attr.
It was never exported, so no functionality change.

llvm-svn: 214519
2014-08-01 14:57:05 +00:00
Rafael Espindola 3f6481d0d3 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
2014-08-01 14:31:55 +00:00
Tim Northover 4bd286ab53 llvm-objdump: implement printing for MachO __compact_unwind info.
llvm-svn: 214509
2014-08-01 13:07:19 +00:00
Sylvestre Ledru 2eadfd6da8 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

llvm-svn: 214482
2014-08-01 06:16:03 +00:00
Rafael Espindola ceb23381ec Replaces a few pointers with references in llvm-nm.cpp.
This opens the way for a few std::uinque_ptr cleanups.

llvm-svn: 214439
2014-07-31 21:00:10 +00:00
Hans Wennborg 914efc7239 msbuild integration: remove duplicated lines and BOM from 2014 integration (PR20341)
llvm-svn: 214435
2014-07-31 20:33:22 +00:00
Rafael Espindola a04bb5b1e1 Use a reference instead of a pointer.
This makes using a std::unique_ptr in the caller more convenient.

llvm-svn: 214433
2014-07-31 20:19:36 +00:00
Rafael Espindola 0c54419d5d Remove unused argument.
Thanks to Justin Bogner for noticing it.

llvm-svn: 214426
2014-07-31 19:32:04 +00:00
Rafael Espindola 3f0549f66b Move MCObjectSymbolizer.h to MC/MCAnalysis.
The cpp file is already in lib/MC/MCAnalysis.

llvm-svn: 214424
2014-07-31 19:29:23 +00:00
Duncan P. N. Exon Smith 852e00e3d1 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`.

llvm-svn: 214419
2014-07-31 18:46:24 +00:00
Eric Christopher 42040ed753 Create a default symver on Linux like ELF OSes.
Patch by Adam Jackson.

llvm-svn: 214418
2014-07-31 18:43:43 +00:00
Rafael Espindola 437b0d5887 Use std::unique_ptr to make the ownership explicit.
llvm-svn: 214377
2014-07-31 03:12:45 +00:00
Duncan P. N. Exon Smith a12e023c8a Rename llvm-uselistorder => verify-uselistorder
llvm-svn: 214318
2014-07-30 17:11:27 +00:00
Duncan P. N. Exon Smith e8387a5d2b llvm-uselistorder: Improve the tool description
llvm-svn: 214317
2014-07-30 16:59:19 +00:00
Duncan P. N. Exon Smith 8a0adeac97 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<>`).

llvm-svn: 214313
2014-07-30 16:50:22 +00:00
Lang Hames 375385fed6 [MCJIT] Actually remap sections based llvm-rtdyld options added in r214255.
This line was accidentally left out of that patch.

llvm-svn: 214282
2014-07-30 03:12:41 +00:00
Rafael Espindola d2aac5795e Use range loops.
llvm-svn: 214280
2014-07-30 01:52:40 +00:00
Rafael Espindola 54f82b72cc Convert a few more function pointer calls to just "f()".
llvm-svn: 214276
2014-07-30 01:36:32 +00:00
Rafael Espindola b6393291b4 Don't duplicate the function name in a comment.
llvm-svn: 214272
2014-07-30 01:23:45 +00:00
Rafael Espindola 5ad21fa696 Use function pointers with just f(1,2) instead of (*f)(1,2).
llvm-svn: 214265
2014-07-30 00:38:58 +00:00
Lang Hames 9cb7353e0b [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.

llvm-svn: 214255
2014-07-29 23:43:13 +00:00
Rafael Espindola 176e664198 Use nullptr instead of NULL.
llvm-svn: 214229
2014-07-29 21:46:05 +00:00
Rafael Espindola a9716f8925 Remove unused includes.
llvm-svn: 214226
2014-07-29 21:38:05 +00:00
Rafael Espindola 9d2250ad43 Delete dead code.
The gold plugin doesn't call lseek or read directly any more.

llvm-svn: 214221
2014-07-29 21:09:43 +00:00
Rafael Espindola 6c472e5e14 gold plugin: Fix handling of corrupted bitcode files.
We should still claim them and tell gold about the error.

llvm-svn: 214214
2014-07-29 20:46:19 +00:00
Rafael Espindola 125b9244ca Small gold plugin simplifications.
* Use a range loop.
* Store the extra options as "const char *".

llvm-svn: 214199
2014-07-29 19:17:44 +00:00
Simon Atanasyan b5adb21240 Install the `obj2yaml` and `yaml2obj` utilities together with other LLVM tools.
llvm-svn: 214191
2014-07-29 18:28:16 +00:00