Commit Graph

7822 Commits

Author SHA1 Message Date
NAKAMURA Takumi
96678fa6d8 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?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 17:04:23 +00:00
Zachary Turner
5433d115a4 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296215 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 00:44:30 +00:00
Zachary Turner
40ea28492e [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296211 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 00:33:34 +00:00
Dean Michael Berris
de5a65f30a [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296210 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 00:26:42 +00:00
Mike Aizatsky
16f0a90663 [sancov] extending sancov --help documentation
Differential Revision: https://reviews.llvm.org/D30361

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 23:55:18 +00:00
Vedant Kumar
10ad4e00d9 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 22:20:32 +00:00
Rafael Espindola
13f0c80b28 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295765 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 20:40:54 +00:00
Lang Hames
67191c1ced [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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295636 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-20 05:45:14 +00:00
Igor Kudrin
e3a9558370 [llvm-cov] Respect Windows line endings when parsing demangled symbols.
Differential Revision: https://reviews.llvm.org/D30096

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295605 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-19 14:26:52 +00:00
Zachary Turner
980cadce13 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295525 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-18 01:35:33 +00:00
Peter Collingbourne
4f50278f40 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295468 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 17:36:52 +00:00
Dean Michael Berris
73d4ebd620 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295397 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 01:47:16 +00:00
Zachary Turner
3e9ce61e33 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295382 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 23:35:45 +00:00
Marshall Clow
bdbb2951ee Remove uses of deprecated std::random_shuffle in the LLVM code base. Reviewed as https://reviews.llvm.org/D29780.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 14:37:03 +00:00
Tobias Edler von Koch
01c2fdec03 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-15 20:36:36 +00:00
Dimitry Andric
193dc0bf84 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295116 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-14 22:49:49 +00:00
Davide Italiano
3a0219a677 [llvm-lto2] Fix typo spotted by Teresa (r294885 post-commit review).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294962 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 16:08:36 +00:00
Saleem Abdulrasool
99725470ee llvm-readobj: process FreeBSD core notes
core files on FreeBSD have additional notes to capture state.  Process
those notes when dumping the notes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 18:55:33 +00:00
Davide Italiano
820dc664db [lib/LTO] Add support for hotness optremarks in the new API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 05:05:35 +00:00
Davide Italiano
9234696c2f [llvm-lto2] Fix typo in error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 03:42:09 +00:00
Davide Italiano
9c7400c731 [lib/LTO] Initial support for optimization remarks in the new API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 03:31:30 +00:00
Peter Collingbourne
446f8d76cd 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:29:38 +00:00
Dean Michael Berris
4dc48bfbbe [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294717 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:36:08 +00:00
Dean Michael Berris
a8b5e78a13 Revert "[XRay] A graph Class for the llvm-xray graph"
Broke tests, reverting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294714 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:05:46 +00:00
Dean Michael Berris
f3a1b3c336 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294713 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 05:40:37 +00:00
Frederic Riss
909a321521 [dsymutil] Fix handling of empty CUs in LTO links.
r288399 introduced the DIEUnit class, and in the process broke
the corner case where dsymutil generates an empty CU during an
LTO link. This restores the logic and adds a test for the corner
case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294618 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 19:41:55 +00:00
Kevin Enderby
d6747d6ba9 Tweak the implementation of llvm-objdump’s -objc-meta-data option so
that it works when the ObjC metadata sections end up in the
__DATA_CONST or __DATA_DIRTY segments.

rdar://26315238


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294599 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 17:56:26 +00:00
Saleem Abdulrasool
5bbd189206 llvm-objdump: make NoLeadingAddr work on more than just MachO
Support printing the disassembly without the address on all formats
rather than making it MachO specific.

Patch by Jeff Muizelaar!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294495 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 18:11:31 +00:00
Sam Parker
3bfb1e88e6 Use dynamic symbols for ELF disassembly
Disassembly currently begins from addresses obtained from the objects
symbol table. For ELF, add the dynamic symbols to the list if no
static symbols are available so that we can more successfully
disassemble stripped binaries.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294430 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 09:44:18 +00:00
Kevin Enderby
94dcd1b639 Fix a bug in llvm-obdump(1) with the -macho and -info-plist options
which caused it to print more than the (__TEXT,__info_plist) if that
section did not end with a null.

rdar://27378808


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 21:01:08 +00:00
Kevin Enderby
91a32fe4a4 Fix a bug in llvm-obdump(1) with the -macho and -disassemble options
which caused it to not disassemble the bytes a the start of the section if
the section had symbols and the first symbol was not at the start of the
section.

rdar://30143243


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294212 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 18:43:18 +00:00
Vedant Kumar
2006b414f1 [llvm-cov] Don't show function summaries when filtering by filename (fixes PR31395)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294137 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:11:08 +00:00
Vedant Kumar
b766e93f51 [llvm-cov] Demangle symbols in function summaries (fixes PR31394)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:11:03 +00:00
Vedant Kumar
4858447bc5 [llvm-cov] Refactor logic for storing demangled symbols, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294135 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:10:58 +00:00
Vedant Kumar
95f974241b [llvm-cov] Fix a comment, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294134 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:10:55 +00:00
Kevin Enderby
b6a21d0438 Fix a bug in llvm-obdump(1) with the -objc-meta-data flag with -macho
which caused a hang on a malformed binary with bad bind info.

rdar://29672108


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294021 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-03 18:22:04 +00:00
Sanne Wouda
5f9d8e2229 [LLC] Add an inline assembly diagnostics handler.
Summary:
llc would hit a fatal error for errors in inline assembly. The
diagnostics message is now printed.

Reviewers: rengolin, MatzeB, javed.absar, anemet

Reviewed By: anemet

Subscribers: jyknight, nemanjai, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-03 11:14:39 +00:00
Konstantin Zhuravlyov
ce0fa7d2ba llvm-readobj: fix next note entry calculation and print unknown note types
Differential Revision: https://reviews.llvm.org/D29131


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293964 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02 23:44:49 +00:00
Teresa Johnson
8ffb6b14bb [ThinLTO] PrintStatistics when we exit early for thinlto-index-only
Summary:
This is necessary to get stats from the ThinLink printed before the
early exit when compiling in a distributed build.

Reviewers: mehdi_amini

Subscribers: Prazek, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293908 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02 17:33:53 +00:00
Rui Ueyama
57b15082cd Re-submit r293820: Return Error instead of bool from mergeTypeStreams().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02 00:47:10 +00:00
Steven Wu
9a41e59c1f [dsymutil] Fix __LINKEDIT vmsize in dsymutil upgrade path
Summary:
dsymutil upgrade path can change the size of segment and it needs to update
the vmsize of the segment to reflect the size change.

rdar://problem/30290714

Reviewers: friss

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02 00:00:13 +00:00
Zachary Turner
8d4b01ecc0 [pdb] Add a new command for analyzing hash collisions.
This introduces the `analyze` subcommand.  For now there is only
one option, to analyze hash collisions in the type streams.  In
the future, however, we could add many more things here, such
as performing size analyses, compacting, and statistics about
the type of records etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-01 18:30:22 +00:00
Dean Michael Berris
dd336006bd [XRay] Use std::errc::invalid_argument instead of std::errc::bad_message
This change should appease the mingw32 builds.

Follow-up to D29319.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-01 00:22:20 +00:00
Dean Michael Berris
93789c8851 [XRay] Define the InstrumentationMap type
Summary:
This change implements the instrumentation map loading library which can
understand both YAML-defined instrumentation maps, and ELF 64-bit object
files that have the XRay instrumentation map section. We break it out
into a library on its own to allow for other applications to deal with
the XRay instrumentation map defined in XRay-instrumented binaries.

This type provides both raw access to the logical representation of the
instrumentation map entries as well as higher level functions for
converting a function ID into a function address.

At this point we only support ELF64 binaries and YAML-defined XRay
instrumentation maps. Future changes should extend this to support
32-bit ELF binaries, as well as other binary formats (like MachO).

As part of this change we also migrate all uses of the extraction logic
that used to be defined in tools/llvm-xray/ to use this new type and
interface for loading from files. We also remove the flag from the
`llvm-xray` tool that required users to specify the type of the
instrumentation map file being provided to instead make the library
auto-detect the file type.

Reviewers: dblaikie

Subscribers: mgorny, varno, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293721 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-01 00:05:29 +00:00
David Blaikie
fbad5bd691 Add a verbose/human readable mode to llvm-symbolizer to investigate discriminators and other line table/backtrace features
Patch by Simon Que!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293697 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31 22:19:38 +00:00
Kevin Enderby
536a298311 Fix a bug in llvm-obdump(1) with the -macho flag disassembling an object
without symbols that makes calls through a symbol stub which were not
correctly being annotated with “## symbol stub for: _foo”.

Just adds the same parameters for getting the annotations from
DisAsm->getInstruction() and passing them to IP->printInst() from the
code above when boolean variable symbolTableWorked was true.

rdar://29791952


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31 18:09:10 +00:00
Vedant Kumar
af0fd6790d Fix llvm-readobj build error after r293569
Clang complains about an ambiguous call to printNumber() because it
can't work out what size_t should convert to. I picked uint64_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293573 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 23:58:51 +00:00
Derek Schuff
c20099fa53 [WebAssembly] Add wasm support for llvm-readobj
Create a WasmDumper subclass of ObjDumper to support Webassembly binary
files.

Patch by Sam Clegg

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293569 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 23:30:52 +00:00
Kevin Enderby
f20c973bf8 Change the llvm-obdump(1) behavior with the -macho flag and inappropriate file types.
To better match the old darwin otool(1) behavior, when llvm-obdump(1) is used
with the -macho option and the input file is not an object file simply print
the file name and this message:

foo: is not an object file

and continue on to process other input files.  Also in this case don’t exit
non-zero.  This should help in some OSS projects' with autoconf scripts
that are expecting the old darwin otool(1) behavior.

rdar://26828015


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293547 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 20:53:17 +00:00
Sylvestre Ledru
bd96ea7b6a Remove unused 'using' declaration. Found by clang-tidy: misc-unused-using-decls NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293382 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-28 13:42:54 +00:00