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

7775 Commits

Author SHA1 Message Date
David Blaikie
2dbd650938 Remove unused lambda capture
llvm-svn: 297675
2017-03-13 21:46:14 +00:00
Jonas Devlieghere
9840ae61ae [Linker] Provide callback for internalization
Differential Revision: https://reviews.llvm.org/D30738

llvm-svn: 297649
2017-03-13 18:08:11 +00:00
Zachary Turner
84ce56f415 Use the new member accessors of llvm::enumerate.
The value_type is no longer a struct, it's a class whose
members you have to access via a method.

llvm-svn: 297635
2017-03-13 16:32:08 +00:00
Zachary Turner
7513c7f0d9 [llvm-pdbdump] Add support for dumping symbols from Yaml -> PDB.
Previously we could round-trip type records from PDB -> Yaml ->
PDB, but for symbols we could only go from PDB -> Yaml.  This
completes the round-tripping for symbols as well.

llvm-svn: 297625
2017-03-13 14:57:45 +00:00
Simon Atanasyan
1dc8afc38d [llvm-readobj] Support SHT_MIPS_DWARF section type flag
llvm-svn: 297448
2017-03-10 08:22:25 +00:00
Rong Xu
78ba7376be [PGO] Refactor profile dumping function for ease of adding other profile kind
Refactor the dumping function so that we can add other value profile kind easily.

Differential Revision: https://reviews.llvm.org/D30752

llvm-svn: 297399
2017-03-09 19:03:57 +00:00
Arnold Schwaighofer
7fa3c1a350 Fix bugpoint to work with swifterror values
llvm-svn: 297196
2017-03-07 20:28:59 +00:00
Konstantin Zhuravlyov
44645fc525 llvm-objdump: handle line numbers and source options for amdgpu objects
Differential Revision: https://reviews.llvm.org/D30679

llvm-svn: 297193
2017-03-07 20:17:11 +00:00
Chris Bieneman
5a909a43a0 [ObjectYAML] Add support for DWARF5 Unit header
In DWARF5 the Unit header added a new field, UnitType, and swapped the order of the address size and abbreviation offset fields.

llvm-svn: 297183
2017-03-07 18:50:58 +00:00
Teresa Johnson
49123ecd70 Fix test and add missing return for llvm-lto2 error case
Summary:
This test was missing the target triple.
Once I fixed that, the case with the invalid character error stopped
returning 1 from llvm-lto2 and the test reported a failure. Fixed by
adding the missing return from llvm-lto2. Apparently we were failing
when we eventually tried to get the target.

Reviewers: pcc

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D30585

llvm-svn: 297173
2017-03-07 18:15:13 +00:00
Chris Bieneman
b5fda14554 [ObjectYAML] Support for DW_FORM_implicit_const DWARF5 form
This patch adds support to the DWARF YAML reader and writer for the new DWARF5 abbreviation form, DW_FORM_implicit_const.

The attribute was added in r291599.

llvm-svn: 297091
2017-03-06 23:22:49 +00:00
Paul Robinson
f43d55037e [DWARFv5] Update definitions to match published spec.
Some late additions to DWARF v5 were not in Dwarf.def; also one form
was redefined.  Add the new cases to relevant switches in different
parts of LLVM.  Replace DW_FORM_ref_sup with DW_FORM_ref_sup[4,8].

I did not add support for DW_FORM_strx3/addrx3 other that defining the
constants. We don't have any infrastructure to support these.

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

llvm-svn: 297085
2017-03-06 22:20:03 +00:00
Chris Bieneman
9876c44779 [ObjectYAML] [DWARF] Abstract DWARF Initial Length values
In the DWARF 4 Spec section 7.2.2, data in many DWARF sections, and some DWARF structures start with "Initial Length Values", which are a 32-bit length, and an optional 64-bit length if the 32 bit value == UINT32_MAX.

This patch abstracts the Initial Length type in YAML, and extends its use to all the DWARF structures that are supported in the DWARFYAML code that have Initial Length values.

llvm-svn: 296911
2017-03-03 21:11:55 +00:00
Mike Aizatsky
df0432e5e2 [sancov] better input parameters validation
Differential Revision: https://reviews.llvm.org/D30370

llvm-svn: 296900
2017-03-03 18:22:20 +00:00
Zachary Turner
2c68c634a9 [Support] Move Stream library from MSF -> Support.
After several smaller patches to get most of the core improvements
finished up, this patch is a straight move and header fixup of
the source.

Differential Revision: https://reviews.llvm.org/D30266

llvm-svn: 296810
2017-03-02 20:52:51 +00:00
David Bozier
ac4898f283 Allow use of spaces in Bugpoint ‘--compile-command’ argument
Bug-Point functionality needs extending due to the patch D29185 by bd1976llvm (Allow llvm's build and test systems to support paths with spaces ). It requires Bugpoint to accept the use of spaces within ‘--compile-command’ tokens.

Details
Bugpoint uses the argument ‘--compile-command’ to pass in a command line argument as a string, the string is tokenized by the ‘lexCommand’ function using spaces as a delimiter. Patch D29185 will cause the unit test compile-custom.ll to fail as spaces are now required within tokens and as a delimiter. This patch allows the use of escape characters as below:

Two consecutive '\' evaluate to a single '\'.
A space after a '\' evaluates to a space that is not interpreted as a delimiter.
Any other instances of the '\' character are removed.

Committed on behalf of Owen Reynolds

Differential revision: https://reviews.llvm.org/D29940

llvm-svn: 296763
2017-03-02 16:50:48 +00:00
Peter Collingbourne
dfbe8f3dfb LTO: When creating a local cache, create the cache directory if it does not already exist.
Differential Revision: https://reviews.llvm.org/D30519

llvm-svn: 296726
2017-03-02 02:02:38 +00:00
Paul Robinson
9a35b79f37 [DWARFv5] llvm-mc support for new unit header.
This is for running the assembler with -g (to emit DWARF describing
the assembler source).

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

llvm-svn: 296541
2017-02-28 23:40:46 +00:00
Peter Collingbourne
50bcef8d40 gold-plugin: Remove unused variable.
llvm-svn: 296533
2017-02-28 22:40:30 +00:00
Kevin Enderby
96b6ebab4e Actually add error handling to unpacking the dyld compact bind and
other tables.  Providing a helpful error message to what the error is and
where the error occurred based on which opcode it was associated with.

There have been handful of bug fixes dealing with bad bind info in
object files, r294021 and r249845, which only put a band aid on the
problem after a bad bind table was created after unpacking from
its compact info.  In these cases a bind table should have never been
created and an error should have simply been generated.

This change puts in place the plumbing to allow checking and returning
of an error when the compact info is unpacked.  This follows the model
of iterators that can fail that Lang Hanes designed when fixing the problem
for bad archives r275316 (or r275361).

This change uses one of the existing test cases that now causes an
error instead of printing <<bad library ordinal>> after a bad bind table
is created.  The error uses the offset into the opcode table as shown with
the macOS dyldinfo(1) tool to indicate where the error is and which
opcode and which parameter is in error.

For example the exiting test case has this lazy binding opcode table:

% dyldinfo -opcodes test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 
…
lazy binding opcodes:
0x0000 BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(0x02, 0x00000010)
0x0002 BIND_OPCODE_SET_DYLIB_ORDINAL_IMM(2)

In the test case the binary only has one library so setting the library 
ordinal to the value of 2 in the BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
opcode at 0x0002 above is an error.  This now produces this error message:

% llvm-objdump -lazy-bind bad-ordinal.macho-x86_64 
…
llvm-objdump: 'bad-ordinal.macho-x86_64': truncated or malformed object (for BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB bad library ordinal: 2 (max 1) for opcode at: 0x2)

This change provides the plumbing for the error handling and one example
of an error message.  Other error checks and test cases will be added in follow
on commits.

llvm-svn: 296527
2017-02-28 21:47:07 +00:00
Vedant Kumar
32c8d92826 [llvm-cov] Error-out when an unsupported format is used (PR32087)
llvm-svn: 296487
2017-02-28 16:57:28 +00:00
Sanne Wouda
ef778d0fcb [Assembler] Add test for !srcloc references in assembler diags
Summary:
clang adds !srcloc metadata to inline assembly in LLVM bitcode generated
for inline assembly in C.  The value of this !srcloc is passed to the
diagnostics handler if the inline assembly generates a diagnostic.
clang is able to turn this cookie back to a location in the C source
file.

To test this functionality without a dependency, make llc print the
!srcloc metadata if it is present.  The added test uses this mechanism
to test that the correct !srclocs are passed to the diag handler.

Reviewers: rengolin, rnk, echristo, grosbach, mehdi_amini

Reviewed By: mehdi_amini

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D30167

llvm-svn: 296465
2017-02-28 10:34:48 +00:00
Zachary Turner
cd226b0757 [PDB] Make streams carry their own endianness.
Before the endianness was specified on each call to read
or write of the StreamReader / StreamWriter, but in practice
it's extremely rare for streams to have data encoded in
multiple different endiannesses, so we should optimize for the
99% use case.

This makes the code cleaner and more general, but otherwise
has NFC.

llvm-svn: 296415
2017-02-28 00:04:07 +00:00
Zachary Turner
f7fd863005 [PDB] Partial resubmit of r296215, which improved PDB Stream Library.
This was reverted because it was breaking some builds, and
because of incorrect error code usage.  Since the CL was
large and contained many different things, I'm resubmitting
it in pieces.

This portion is NFC, and consists of:

1) Renaming classes to follow a consistent naming convention.
2) Fixing the const-ness of the interface methods.
3) Adding detailed doxygen comments.
4) Fixing a few instances of passing `const BinaryStream& X`.  These
   are now passed as `BinaryStreamRef X`.

llvm-svn: 296394
2017-02-27 22:11:43 +00:00
Brian Cain
bcfe1c3171 llvm-mc-fuzzer: add support for assembly
This creates an llvm-mc-disassemble-fuzzer from the existing llvm-mc-fuzzer
and finishing the assemble support in llvm-mc-assemble-fuzzer.

llvm-svn: 296323
2017-02-27 06:22:17 +00:00
NAKAMURA Takumi
046a844fb7 Revert r296215, "[PDB] General improvements to Stream library." and followings.
r296215, "[PDB] General improvements to Stream library."
r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily."
r296220, "Re-enable BinaryStreamTest.StreamReaderObject."
r296244, "[PDB] Disable some tests that are breaking bots."
r296249, "Add static_cast to silence -Wc++11-narrowing."

std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission.
(Seek discussions around llvm/xray.)

I could substitute s/no_buffer_space/others/g, but I revert whole them ATM.

Could we define and use LLVM errors there?

llvm-svn: 296258
2017-02-25 17:04:23 +00:00
Zachary Turner
c0166260b8 [PDB] General improvements to Stream library.
This adds various new functionality and cleanup surrounding the
use of the Stream library.  Major changes include:

* Renaming of all classes for more consistency / meaningfulness
* Addition of some new methods for reading multiple values at once.
* Full suite of unit tests for reader / writer functionality.
* Full set of doxygen comments for all classes.
* Streams now store their own endianness.
* Fixed some bugs in a few of the classes that were discovered
  by the unit tests.

llvm-svn: 296215
2017-02-25 00:44:30 +00:00
Zachary Turner
5260228d29 [PDB] Rename Stream related source files.
This is part of a larger effort to get the Stream code moved
up to Support.  I don't want to do it in one large patch, in
part because the changes are so big that it will treat everything
as file deletions and add, losing history in the process.
Aside from that though, it's just a good idea in general to
make small changes.

So this change only changes the names of the Stream related
source files, and applies necessary source fix ups.

llvm-svn: 296211
2017-02-25 00:33:34 +00:00
Dean Michael Berris
b3879b8ab0 [XRAY] A Color Choosing helper for XRay Graph
Summary:
In Preparation for graph comparison, this patch breaks out the color
choice code from xray-graph into a library and adds polynomials for
the Sequential and Difference sets from ColorBrewer.

Depends on D29005

Reviewers: dblaikie, chandlerc, dberris

Reviewed By: dberris

Subscribers: chandlerc, llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D29363

llvm-svn: 296210
2017-02-25 00:26:42 +00:00
Mike Aizatsky
dae9b41484 [sancov] extending sancov --help documentation
Differential Revision: https://reviews.llvm.org/D30361

llvm-svn: 296205
2017-02-24 23:55:18 +00:00
Vedant Kumar
340a374fe7 [llvm-cov] Strip redundant path components from filenames (fix PR31982)
Instead of stripping the longest common prefix off of the filenames in a
report, strip out the longest chain of redundant path components. This
fixes the case in PR31982, where there are two files with the same
prefix, and stripping out the LCP makes things less intelligible.

llvm-svn: 296029
2017-02-23 22:20:32 +00:00
Rafael Espindola
98752fcfe6 Don't modify archive members unless really needed.
For whatever reason ld64 requires that member headers (not the member
themselves) should be aligned. The only way to do that is to edit the
previous member so that it ends at an aligned boundary.

Since modifying data put in an archive is an undesirable property,
llvm-ar should only do it when it is absolutely necessary.

llvm-svn: 295765
2017-02-21 20:40:54 +00:00
Lang Hames
982396d819 [Orc] Rename ObjectLinkingLayer -> RTDyldObjectLinkingLayer.
The current ObjectLinkingLayer (now RTDyldObjectLinkingLayer) links objects
in-process using MCJIT's RuntimeDyld class. In the near future I hope to add new
object linking layers (e.g. a remote linking layer that links objects in the JIT
target process, rather than the client), so I'm renaming this class to be more
descriptive.

llvm-svn: 295636
2017-02-20 05:45:14 +00:00
Igor Kudrin
94f3f93b77 [llvm-cov] Respect Windows line endings when parsing demangled symbols.
Differential Revision: https://reviews.llvm.org/D30096

llvm-svn: 295605
2017-02-19 14:26:52 +00:00
Zachary Turner
a6279ab220 Don't assume little endian in StreamReader / StreamWriter.
In an effort to generalize this so it can be used by more than
just PDB code, we shouldn't assume little endian.

llvm-svn: 295525
2017-02-18 01:35:33 +00:00
Peter Collingbourne
4974f41ade opt: Rename -default-data-layout flag to -data-layout and make it always override the layout.
There isn't much point in a flag that only works if the data layout is empty.

Differential Revision: https://reviews.llvm.org/D30014

llvm-svn: 295468
2017-02-17 17:36:52 +00:00
Dean Michael Berris
cdc62f0bc3 [XRAY] [x86_64] Adding a Flight Data filetype reader to the llvm-xray Trace implementation.
Summary:
The file type packs function trace data onto disk from potentially multiple
threads that are aggregated and flushed during the course of an instrumented
program's runtime.

It is named FDR mode or Flight Data recorder as an analogy to plane
blackboxes, which instrument a running system without access to IO.

The writer code is defined in compiler-rt in xray_fdr_logging.h/cc

Reviewers: rSerge, kcc, dberris

Reviewed By: dberris

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29697

llvm-svn: 295397
2017-02-17 01:47:16 +00:00
Zachary Turner
f0a0b7f3ae [pdb] Add the ability to resolve TypeServer PDBs.
Some PDBs or object files can contain references to other PDBs
where the real type information lives.  When this happens,
all type indices in the original PDB are meaningless because
their records are not there.

With this patch we add the ability to pull type info from those
secondary PDBs.

Differential Revision: https://reviews.llvm.org/D29973

llvm-svn: 295382
2017-02-16 23:35:45 +00:00
Marshall Clow
0eaf285460 Remove uses of deprecated std::random_shuffle in the LLVM code base. Reviewed as https://reviews.llvm.org/D29780.
llvm-svn: 295325
2017-02-16 14:37:03 +00:00
Tobias Edler von Koch
fddccdb0f9 [LTO] Add ability to emit assembly to new LTO API
Summary:
Add a field to LTO::Config, CGFileType, to select the file type to emit (object
or assembly). This is useful for testing and to implement -save-temps.

Reviewers: tejohnson, mehdi_amini, pcc

Reviewed By: mehdi_amini

Subscribers: davide, llvm-commits

Differential Revision: https://reviews.llvm.org/D29475

llvm-svn: 295226
2017-02-15 20:36:36 +00:00
Dimitry Andric
3101e6c84d Disable wrapping llvm-xray YAML output
Summary:
The YAML output produced by llvm-xray is supposed to be wrapped at the
arbitrary default of 70 columns set by `yaml:Output`.  Unfortunately,
the wrapping is rather unpredictable, and can easily go past the set
number of columns, depending on the execution environment.

To make the YAML output environment-independent, disable wrapping
instead.

Reviewers: dberris

Reviewed By: dberris

Subscribers: fhahn, llvm-commits

Differential Revision: https://reviews.llvm.org/D29962

llvm-svn: 295116
2017-02-14 22:49:49 +00:00
Davide Italiano
4a2f3539a0 [llvm-lto2] Fix typo spotted by Teresa (r294885 post-commit review).
llvm-svn: 294962
2017-02-13 16:08:36 +00:00
Saleem Abdulrasool
0d4bc5e5d5 llvm-readobj: process FreeBSD core notes
core files on FreeBSD have additional notes to capture state.  Process
those notes when dumping the notes.

llvm-svn: 294909
2017-02-12 18:55:33 +00:00
Davide Italiano
929e2c167e [lib/LTO] Add support for hotness optremarks in the new API.
llvm-svn: 294885
2017-02-12 05:05:35 +00:00
Davide Italiano
4e84a97600 [llvm-lto2] Fix typo in error message.
llvm-svn: 294883
2017-02-12 03:42:09 +00:00
Davide Italiano
9f5a87c088 [lib/LTO] Initial support for optimization remarks in the new API.
llvm-svn: 294882
2017-02-12 03:31:30 +00:00
Peter Collingbourne
33fe886dfb IR: Function summary extensions for whole-program devirtualization pass.
The summary information includes all uses of llvm.type.test and
llvm.type.checked.load intrinsics that can be used to devirtualize calls,
including any constant arguments for virtual constant propagation.

Differential Revision: https://reviews.llvm.org/D29734

llvm-svn: 294795
2017-02-10 22:29:38 +00:00
Dean Michael Berris
cc37553db4 [XRay] A graph Class for the llvm-xray graph
Summary:
In preparation for graph comparison and filtering, this is a library for
representing graphs in LLVM. This will enable easier encapsulation and reuse
of graphs in llvm-xray.

Depends on D28999, D28225

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29005

llvm-svn: 294717
2017-02-10 06:36:08 +00:00
Dean Michael Berris
dd1f0a3f3a Revert "[XRay] A graph Class for the llvm-xray graph"
Broke tests, reverting.

llvm-svn: 294714
2017-02-10 06:05:46 +00:00
Dean Michael Berris
cadcaaab9b [XRay] A graph Class for the llvm-xray graph
Summary:
In preparation for graph comparison and filtering, this is a library for
representing graphs in LLVM. This will enable easier encapsulation and reuse
of graphs in llvm-xray.

Depends on D28999, D28225

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29005

llvm-svn: 294713
2017-02-10 05:40:37 +00:00