Commit Graph

1238 Commits

Author SHA1 Message Date
Saleem Abdulrasool
763a1ecc7a test: explicitly use gnu format
This should fix the Darwin buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12 19:03:08 +00:00
Saleem Abdulrasool
98825db755 llvm-strings: trivialise logic until we support more options
Until we have handling for ignoring unloaded sections, simplify the logic to
the point of triviality.  This fixes the scanning of archives, particularly when
embedded in archives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12 18:37:04 +00:00
Saleem Abdulrasool
421c744b29 llvm-strings: ensure that the last string is correctly printed
We would ignore the last string that appeared if the file ended with a printable
character.  Ensure that we get the last string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12 03:39:21 +00:00
John Brawn
00180413cf Fix test/tools/gold/X86/thinlto_funcimport.ll on non-X86 hosts
Pass -m elf_x86_64 to gold, as is done in other tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286593 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 14:12:15 +00:00
Kevin Enderby
00b62fb861 Add support for the ARM_THREAD_STATE64 and
in llvm-objdump for Mach-O files add the printing of the
ARM_THREAD_STATE64 in the same format as
otool-classic(1) on darwin.

To do this the 64-bit ARM general tread state
needed to be defined in include/llvm/Support/MachO.h .

rdar://28985800


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 20:51:28 +00:00
Kevin Enderby
4b3270e0a7 Add the rest of the additional error checks for invalid Mach-O files when
the offsets and sizes of an element of the Mach-O file overlaps with
another element in the Mach-O file.

Some other tests for malformed Mach-O files now run into these
checks so their tests were also adjusted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 21:08:39 +00:00
Vedant Kumar
f13ebed41c [llvm-cov] Turn line numbers in html reports into clickable links
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 19:44:13 +00:00
Teresa Johnson
485ef16bd4 [ThinLTO] Disable importing and other cross-module optis at -O0
Summary:
There is no point to importing at -O0, since we won't inline. We should
also disable other cross-module optimizations.

(Plan to backport this fix to the 3.9 branch to fix PR30774)

Reviewers: pcc

Subscribers: johanengelen, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285648 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-31 22:12:21 +00:00
Teresa Johnson
39970a7476 [ThinLTO] Correctly resolve linkonce when importing aliasee
Summary:
When we have an aliasee that is linkonce, while we can't convert
the non-prevailing copies to available_externally, we still need to
convert the prevailing copy to weak. If a reference to the aliasee
is exported, not converting a copy to weak will result in undefined
references when the linkonce is removed in its original module.

Add a new test and update existing tests.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-30 05:15:23 +00:00
Justin Bogner
403d906e8b llvm-objdump: Make some error messages more consistent
Most of the version of report_error were quoting the filename and
printing a colon between the file name and the error message, but this
one wasn't doing either of those. Fix the output to be more
consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 22:37:52 +00:00
Dean Michael Berris
2a38659521 [XRay] Be case-insensitive for error strings
On Windows, "no such file or directory" is the default error translation
as opposed to the capitalized form on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 05:10:39 +00:00
Dean Michael Berris
5a35548822 [XRay] Implement llvm-xray extract, start of the llvm-xray tool
Usage:

  llvm-xray extract <object file> [-o <filename or '-'>]

The tool gets the XRay instrumentation map from an object file and turns
it into YAML.  We first support ELF64 sleds on x86_64 binaries, with
provision for supporting other supported platforms and formats later.

This is the first of a many-part change to fully implement the
`llvm-xray` tool.

We also define a subcommand registration and dispatch mechanism to be
used by other further subcommand implementations for llvm-xray.

Diffusion Revision: https://reviews.llvm.org/D21987

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 04:14:34 +00:00
Dean Michael Berris
e9512859ea Revert "[XRay] Implement llvm-xray extract, start of the llvm-xray tool"
Reverts r285155 -- misconfigured tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 01:50:59 +00:00
Dean Michael Berris
433938ad4c [XRay] Implement llvm-xray extract, start of the llvm-xray tool
Usage:

  llvm-xray extract <object file> [-o <filename or '-'>]

The tool gets the XRay instrumentation map from an object file and turns
it into YAML.  We first support ELF64 sleds on x86_64 binaries, with
provision for supporting other supported platforms and formats later.

This is the first of a many-part change to fully implement the
`llvm-xray` tool.

We also define a subcommand registration and dispatch mechanism to be
used by other further subcommand implementations for llvm-xray.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 01:42:59 +00:00
Rui Ueyama
7d084db836 Use printf instead of "echo -e" or "echo -n".
Not all echo commands support "-e". On the other hand, printf
command is in POSIX, so it's more portable than "echo -e".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 01:07:26 +00:00
Vedant Kumar
d4998ec16b [llvm-cov] Add support for loading coverage from multiple objects
Differential Revision: https://reviews.llvm.org/D25086

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 17:40:55 +00:00
Vedant Kumar
5b5c5e7555 [llvm-cov] Do not print out the filename of the object file
When we load coverage data from multiple objects, we don't have a way to
attribute a source object to a function record. Printing out the object
filename next to the source filename is already not very useful: soon,
it'll actually become misleading. Stop printing out the filename now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 00:08:33 +00:00
Joel Jones
f2152944cb AArch64 ILP32 relocations for assembly and ELF
Summary:
Add relocations for AArch64 ILP32. Includes:
  - Addition of definitions for R_AARCH32_*
  - Definition of new -target-abi: ilp32
  - Definition of data layout string
  - Tests for added relocations. Not comprehensive, but matches
    existing tests for 64-bit. Renames "CHECK-OBJ" to "CHECK-OBJ-LP64".
  - Tests for llvm-readobj

Reviewers: zatrazz, peter.smith, echristo, t.p.northover

Subscribers: aemerson, rengolin, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 13:37:13 +00:00
Hal Finkel
df936e34c0 [llvm-opt-report] Fix unroll-count reporting
Fix the implementation of OptReportLocationInfo's operator < so that contexts
with different unroll counts are reported separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 05:07:18 +00:00
Kevin Enderby
a9abde40d7 Fix a bug in the code of llvm-cxxdump in dumpArchive() when
iterating over an archive with object and non-object members that
would cause an Abort because to was not calling consumeError()
when the code was wanting to ignore a non-object file.

Found by Justin Bogner!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21 20:03:14 +00:00
Kevin Enderby
bbe3a735a8 For llvm-objdump for Mach-O files add printing of
the ARM_THREAD_STATE in the same format as
otool-classic(1) on darwin.

Also remove an extra space in printing the initprot to make
the output match otool-classic(1) on darwin.

rdar://28851457


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21 18:22:35 +00:00
Rong Xu
c8872308b4 [PGO] Fix bogus warning for merging empty llvm profile file
Profile runtime can generate an empty raw profile (when there is no function in
the shared library). This empty profile is treated as a text format profile.  A
test format profile without the flag of "#IR" is thought to be a clang
generated profile.  So in llvm profile merging, we will get a bogus warning of
"Merge IR generated profile with Clang generated profile."

The fix here is to skip the empty profile (when the buffer size is 0) for
profile merge.

Reviewers: vsk, davidxl

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 22:51:17 +00:00
David Blaikie
69a9e66dcc dwarfdump: -summarize-types: print a short summary (unqualified type name, hash, length) of type units rather than dumping contents
This is just a quick utility handy for getting rough summaries of types
in a given object or dwo file. I've been using it to investigate the
amount of type info redundancy across a project build, for example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284537 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-18 21:09:48 +00:00
George Rimar
f1fdd33269 [llvm-readobj] - Teach readobj to print PT_OPENBSD_RANDOMIZE/PT_OPENBSD_WXNEEDED headers.
These are OpenBSD specific program headers and 
currently we support them in LLD.

Description of headers (just in case) available here:
http://man.openbsd.org/OpenBSD-current/man5/elf.5

OpenBSD commits were:
For PT_OPENBSD_RANDOMIZE:
c494713c45
For PT_OPENBSD_WXNEEDED:
2a5a8fc7e3

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284471 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-18 10:54:56 +00:00
Bernard Ogden
87a2222018 Fix test on non-x86 hosts
Summary:
This test is allowed to run on non-x86 hosts and thus must use
llvm-nm rather than nm.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 16:32:37 +00:00
Mehdi Amini
e3e8677385 ThinLTO: Fix Gold test after caching fix in r283655
(I don't have Gold available, so this is speculative)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 22:49:28 +00:00
Hal Finkel
7b70b8ae64 [llvm-opt-report] Don't leave space for opts that never happen
Because screen space is precious, if an optimization (vectorization, for
example) never happens, don't leave empty space for the associated markers on
every line of the output. This makes the output much more compact, and allows
for the later inclusion of markers for more (although perhaps rare)
optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283626 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-08 00:26:54 +00:00
Hal Finkel
68dd546484 [llvm-opt-report] Left justify unrolling counts, etc.
In the left part of the reports, we have things like U<number>; if some of
these numbers use more digits than others, we don't want a space in between the
U and the start of the number. Instead, the space should come afterward. This
way it is clear that the number goes with the U and not any other optimization
indicator that might come later on the line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283518 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 01:57:06 +00:00
Hal Finkel
28b12d7747 [llvm-opt-report] Use -no-demangle to disable demangling
As this is intended to be a user-facing option, -no-demangle seems much better
than -demangle=0. Add testing for the option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283516 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 01:30:59 +00:00
Hal Finkel
7b08fb4456 [llvm-opt-report] Record VF, etc. correctly for multiple opts on one line
When there are multiple optimizations on one line, record the vectorization
factors, etc. correctly (instead of incorrectly substituting default values).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 11:58:52 +00:00
Hal Finkel
a172b8d4e9 [llvm-opt-report] Print line numbers starting from 1
Line numbers should start from 1, not 2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 11:11:11 +00:00
Hal Finkel
51ab65f27e Fix tests for Windows
We need to match file names with both forward and backward slashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:48:13 +00:00
Hal Finkel
0837bf4c51 [llvm-opt-report] Distinguish inlined contexts when optimizations differ
How code is optimized sometimes, perhaps often, depends on the context into
which it was inlined. This change allows llvm-opt-report to track the
differences between the optimizations performed, or not, in different contexts,
and when these differ, display those differences.

For example, this code:

  $ cat /tmp/q.cpp
  void bar();
  void foo(int n) {
    for (int i = 0; i < n; ++i)
      bar();
  }

  void quack() {
    foo(4);
  }

  void quack2() {
    foo(4);
  }

will now produce this report:

  < /home/hfinkel/src/llvm/test/tools/llvm-opt-report/Inputs/q.cpp
   2         | void bar();
   3         | void foo(int n) {
   [[
    > foo(int):
   4         |   for (int i = 0; i < n; ++i)
    > quack(), quack2():
   4  U4     |   for (int i = 0; i < n; ++i)
   ]]
   5         |     bar();
   6         | }
   7         |
   8         | void quack() {
   9 I       |   foo(4);
  10         | }
  11         |
  12         | void quack2() {
  13 I       |   foo(4);
  14         | }
  15         |

Note that the tool has demangled the function names, and grouped the reports
associated with line 4. This shows that the loop on line 4 was unrolled by a
factor of 4 when inlined into the functions quack() and quack2(), but not in
the function foo(int) itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:25:33 +00:00
Hal Finkel
6af7eec625 Add an llvm-opt-report tool to generate basic source-annotated optimization summaries
LLVM now has the ability to record information from optimization remarks in a
machine-consumable YAML file for later analysis. This can be enabled in opt
(see r282539), and D25225 adds a Clang flag to do the same. This patch adds
llvm-opt-report, a tool to generate basic optimization "listing" files
(annotated sources with information about what optimizations were performed)
from one of these YAML inputs.

D19678 proposed to add this capability directly to Clang, but this more-general
YAML-based infrastructure was the direction we decided upon in that review
thread.

For this optimization report, I focused on making the output as succinct as
possible while providing information on inlining and loop transformations. The
goal here is that the source code should still be easily readable in the
report. My primary inspiration here is the reports generated by Cray's tools
(http://docs.cray.com/books/S-2496-4101/html-S-2496-4101/z1112823641oswald.html).
These reports are highly regarded within the HPC community. Intel's compiler,
for example, also has an optimization-report capability
(https://software.intel.com/sites/default/files/managed/55/b1/new-compiler-optimization-reports.pdf).

  $ cat /tmp/v.c
  void bar();
  void foo() { bar(); }

  void Test(int *res, int *c, int *d, int *p, int n) {
    int i;

  #pragma clang loop vectorize(assume_safety)
    for (i = 0; i < 1600; i++) {
      res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
    }

    for (i = 0; i < 16; i++) {
      res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
    }

    foo();

    foo(); bar(); foo();
  }

D25225 adds -fsave-optimization-record (and
-fsave-optimization-record=filename), and this would be used as follows:

  $ clang -O3 -o /tmp/v.o -c /tmp/v.c -fsave-optimization-record
  $ llvm-opt-report /tmp/v.yaml > /tmp/v.lst
  $ cat /tmp/v.lst

  < /tmp/v.c
   2          | void bar();
   3          | void foo() { bar(); }
   4          |
   5          | void Test(int *res, int *c, int *d, int *p, int n) {
   6          |   int i;
   7          |
   8          | #pragma clang loop vectorize(assume_safety)
   9     V4,2 |   for (i = 0; i < 1600; i++) {
  10          |     res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
  11          |   }
  12          |
  13  U16     |   for (i = 0; i < 16; i++) {
  14          |     res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
  15          |   }
  16          |
  17 I        |   foo();
  18          |
  19          |   foo(); bar(); foo();
     I        |   ^
     I        |                 ^
  20          | }

Each source line gets a prefix giving the line number, and a few columns for
important optimizations: inlining, loop unrolling and loop vectorization. An
'I' is printed next to a line where a function was inlined, a 'U' next to an
unrolled loop, and 'V' next to a vectorized loop. These are printed on the
relevant code line when that seems unambiguous, or on subsequent lines when
multiple potential options exist (messages, both positive and negative, from
the same optimization with different column numbers are taken to indicate
potential ambiguity). When on subsequent lines, a '^' is output in the relevant
column.

Annotated source for all relevant input files are put into the listing file
(each starting with '<' and then the file name).

You can disable having the unrolling/vectorization factors appear by using the
-s flag.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283398 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:10:35 +00:00
Mehdi Amini
5c1bdf9245 [LTO] Fix test to not depend on the exact address of symbols, just their linkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 21:40:50 +00:00
Martell Malone
d17dee59d1 COFF: Fix short import lib import name type bitshift
As per the PE COFF spec (section 8.3, Import Name Type)
Offset: 18 Size 2 bits Name: Type
Offset: 20 Size 3 bits Name: Name Type

Offset: 20 added based on 18+2

Partially commited as rL279069

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283055 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 23:10:20 +00:00
Mike Aizatsky
dc72d130bb [sancov] introducing symbolized coverage files (.symcov)
Summary:
Answering any meaningful questions about .sancov files requires
accessing symbol information from the corresponding binary.

This change introduces a separate intermediate data structure and
format: symbolized coverage. It contains all symbol information that
is required to answer common queries:
- merging
- coverd/uncovered files and functions
- line status.

Also removing the html report functionality from sancov: generated
HTML files are too huge, and a different approach is required.
Maintaining this half-working approach in the C++ is painful.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-28 21:39:28 +00:00
Teresa Johnson
468ae9f703 [gold] Split plugin options controlling ThinLTO and codegen parallelism.
Summary:
As suggested in D24826, use different options for ThinLTO backend
parallelism from the option controlling regular LTO code gen
parallelism. They are already split in the LTO API, and this enables
controlling them with different clang options.

Reviewers: pcc, mehdi_amini

Subscribers: dexonsmith, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 20:35:19 +00:00
Vedant Kumar
daacf3c8ba [llvm-cov] Filter away source files that aren't in the coverage mapping
... so that they don't show up in the index. This came up because polly
contains a .git directory and some other unmapped input in its source
dir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:57:35 +00:00
Vedant Kumar
fd066351a5 [llvm-cov] Get rid of all invalid filename references
We used to append filenames into a vector of std::string, and then
append a reference to each string into a separate vector. This made it
easier to work with the getUniqueSourceFiles API. But it's buggy.

std::string has a small-string optimization, so you can't expect to
capture a reference to one if you're copying it into a growing vector.
Add a test that triggers this invalid reference to std::string scenario,
and kill the issue with fire by just using ArrayRef<std::string>
everywhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:57:32 +00:00
Vedant Kumar
ef76be0d1e [llvm-cov] Add the ability to specify directories of input source files
We've supported restricting coverage reports to a set of files for a
long time. Add support for being able to restrict by entire directories.

I suppose this supersedes D20803.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:49:43 +00:00
Teresa Johnson
b81a1e9028 [ThinLTO] Emit files for distributed builds for all modules
With the new LTO API in r278338, we stopped emitting the individual
index files and imports files for some modules in the distributed backend
case (thinlto-index-only plugin option).

Specifically, this is when the linker decides not to include a module in the
link, because it was in an archive library and did not have a strong
reference to it. Not creating the expected output files makes the
distributed build system implementation more difficult, in terms of
checking for the expected outputs of the thin link, and scheduling the
backend jobs. To address this, the gold-plugin will write dummy empty
.thinlto.bc and .imports files for modules not included in the link
(which LTO never sees).

Augmented a gold v1.12+ test, since that version of gold has the handling
for notifying on modules not being included in the link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282100 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 19:12:05 +00:00
Teresa Johnson
7e15c9e40f [ThinLTO] Always emit a summary when compiling in ThinLTO mode
Summary:
Emit an empty summary section, instead of no summary section, when
there are no global variables in the index. This ensures that LTO
will treat these files as ThinLTO inputs, instead of as regular
LTO inputs.

In addition to not being what the user likely intended when
compiling with -flto=thin, the current behavior is problematic for
distributed build systems that expect to get ThinLTO index and imports
files back for each input compiled with -flto=thin. Combining into
a single regular LTO module also reduces the backend parallelism.
And in the case where the index was suppressed due to uses in
inline assembly, combining into a single LTO module could provoke
renaming of duplicates that we were trying to prevent by suppressing
the index.

This change required a couple of fixes to handle the empty summary
section.

Reviewers: mehdi_amini

Subscribers: mehdi_amini, llvm-commits, pcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 23:07:17 +00:00
Vedant Kumar
139080743f [llvm-cov] Demangle names for hidden instantiation views
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 21:27:48 +00:00
Xinliang David Li
163ac62cd3 [Profile] dump ic value profile value/site-count histogram
Differential Revision: http://reviews.google.com/D24783




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 21:04:22 +00:00
Vedant Kumar
1b70b5dcc9 [llvm-cov] Delete the NonCodeLines field, it was always dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 01:46:01 +00:00
Vedant Kumar
70b43c34b6 [llvm-cov] Teach the coverage exporter about instantiation coverage
While we're at it, re-use the logic from CoverageReport to compute
summaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:29 +00:00
Vedant Kumar
e17f26f066 [llvm-cov] Track function and instantiation coverage separately
These are distinct statistics which are useful to look at separately.

Example: say you have a template function "foo" with 5 instantiations
and only 3 of them are covered. Then this contributes (1/1) to the total
function coverage and (3/5) to the total instantiation coverage. I.e,
the old "Function Coverage" column has been renamed to "Instantiation
Coverage", and the new "Function Coverage" aggregates information from
the various instantiations of a function.

One benefit of making this switch is that the Line and Region coverage
columns will start making sense. Let's continue the example and assume
that the 5 instantiations of "foo" cover {2, 4, 6, 8, 10} out of 10
lines respectively. The new line coverage for "foo" is (10/10), not
(30/50).  The old scenario got confusing because we'd report that there
were more lines in a file than what was actually possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:23 +00:00
Vedant Kumar
c063c43a4e [llvm-cov] Drop another redundant 'No.' suffix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:14 +00:00
Davide Italiano
463cfe4e60 [LTO] Add ability to parse AA pipelines.
This is supposed to be a drop in replacement for what lld
provides via --lto-newpm-aa-pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 21:03:21 +00:00
Teresa Johnson
1832d7b823 [LTO] Use llvm-nm instead of nm in new tests
The use of nm in the new tests added with r281725 caused a couple
of bot failures:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15701
http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/6939

Use llvm-nm instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 17:12:48 +00:00
Davide Italiano
3284f278cd [LTO] Prevent asm references to be dropped from the output.
Differential Revision:  https://reviews.llvm.org/D24617

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 16:05:25 +00:00
Teresa Johnson
8ab74babf7 [LTO] Fix handling of mixed (regular and thin) mode LTO
Summary:
In runThinLTO we start the task numbering for ThinLTO backend
tasks depending on whether there was also a regular LTO object
(CombinedModule). However, the CombinedModule is moved at
the end of runRegularLTO, so we need to save this information and
pass it into runThinLTO. Otherwise the AddOutput callback to the client
will use the same task number for both the regular LTO object
and the first ThinLTO object, which in gold-plugin caused only
one to be end up in the output filename array and therefore passed
back to gold for the final native link.

Reviewers: pcc, mehdi_amini

Subscribers: mehdi_amini, kromanova

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 13:54:19 +00:00
Vedant Kumar
61f5694c30 [llvm-cov] Hide instantiation views for unexecuted functions
Copying in the full text of the function doesn't help at all when we
already know that it's never executed. Just say that it's unexecuted --
the relevant source text has already been printed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:44:51 +00:00
Vedant Kumar
2fcbfcf470 [llvm-cov] Don't create 'jump to ...' links in nested views
Doing so is pointless, since the whole view is usually visible in a
small amount of space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:44:48 +00:00
Vedant Kumar
90562cd08a [llvm-cov] Don't print a verbose title when looking at one file
Having the same title, timestamp, etc. occur repeatedly creates an
unnecessary distraction when paging through a report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:41:39 +00:00
Vedant Kumar
5d97808700 [llvm-cov] Fix tests that aren't checking anything (NFC)
E.g the 'showProjectSummary' test contains some checks which can't fail
because they match themselves...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281578 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:41:37 +00:00
Mehdi Amini
fd7afc4d38 [LTO] Move tests from test/tools to test/LTO, as they're testing the API functionalities (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 21:07:32 +00:00
Mehdi Amini
bdf517a05c [LTO] Fix commons handling
Previously the prevailing information was not honored, and commons
symbols could override a strong definition. This patch fixes it and
propose the following semantic for commons: the client should mark
as prevailing the commons that it expects the LTO implementation to
merge (i.e. take the maximum size and alignment).
It implies that commons are allowed to have multiple prevailing
definitions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281538 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 21:05:04 +00:00
Vedant Kumar
e7f7e18127 [llvm-cov] Just emit the version number in the index file
Having the version information in every view is distracting, especially
if there are several sub-views.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 23:00:13 +00:00
Davide Italiano
9330005ad6 [LTO] Don't pass SF_Undefined symbols to the IRmover.
This should fix PR 30363.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281366 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 18:45:13 +00:00
Ying Yi
503f4620ba [llvm-cov] - Included footer "Generated by llvm-cov -- llvm version <version number>" in the coverage report.
The llvm-cov version information will be useful to the user when comparing the code coverage across different versions of llvm-cov. This patch provides the llvm-cov version information in the generated coverage report.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 11:28:31 +00:00
Peter Collingbourne
5420de3f15 DebugInfo: New metadata representation for global variables.
This patch reverses the edge from DIGlobalVariable to GlobalVariable.
This will allow us to more easily preserve debug info metadata when
manipulating global variables.

Fixes PR30362. A program for upgrading test cases is attached to that
bug.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 01:12:59 +00:00
Hemant Kulkarni
f4ef2f71ee Fix test failure in r281232
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 17:40:10 +00:00
Hemant Kulkarni
7ee831747c llvm-size: Add --totals option
Differential Revision: https://reviews.llvm.org/D24308

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 17:08:28 +00:00
Hemant Kulkarni
11981cd22e llvm-objdump: Add --start-address and --stop-address options
Differential Revision: https://reviews.llvm.org/D24160

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 17:08:22 +00:00
Vedant Kumar
a8edd76b0e [llvm-cov] Move the 'jump to first unexecuted line' link
Having it in the same row as the source name is jarring. Move it next to
the "Source" column label.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 19:37:26 +00:00
Vedant Kumar
ce19c1cc95 [llvm-cov] Minor visual tweaks for html reports
- Change the location of the 'Region Coverage' column.
  - Use less css and text for some labels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 19:37:20 +00:00
Teresa Johnson
68d7a57aba [gold/LTO] Add test case for r281134
Add test case that was supposed to go in with r281134.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 06:18:17 +00:00
Davide Italiano
586b77778c [gold] Test that we handle invalid directory correctly.
I had this test sitting around for a while but always forgot to
commit. Rafael reviewed it a while ago.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 22:14:57 +00:00
Vedant Kumar
5e2e757913 [llvm-cov] Try to fix the native_separators.c test some more
It's still breaking this bot (though, it looks like it always had been):

  http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015

This time, add quotes around llvm-{cov,config} so that lit won't expand
them.

Thanks to Reid for suggesting the patch!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 18:34:43 +00:00
Vedant Kumar
84dc7510c9 [llvm-cov] Emit a summary in the report directory's index
llvm-cov writes out an index file in '-output-dir' mode, albeit not a
very informative one. Try to fix that by using the CoverageReport API to
include some basic summary information in the index file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:32:55 +00:00
Vedant Kumar
f539109ae3 [llvm-cov] Speculate fix for a Windows-only test (NFC)
This test should have broken after r280896. Fix up the test case
speculatively, since I don't have a way to test it.

I wonder why I didn't get any angry bot emails about this. Maybe none of
the win32 bots test llvm-cov? That could explain it, since the test says
it 'REQUIRES: system-windows', which is restricted to win32 hosts.

Also: why is 'system-windows' not defined for non-win32 Windows bots?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:32:47 +00:00
Vedant Kumar
111f4fbf9a [llvm-cov] Fix issues with segment highlighting in the html view
The text and html coverage views take different approaches to emitting
highlighted regions. That's because this problem is easier in the text
view: there's no need to worry about escaping text or adding tooltip
content to a highlighted snippet.

Unfortunately, the html view didn't get region highlighting quite right.

This patch fixes the situation, bringing parity between the two views.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 19:18:23 +00:00
Vedant Kumar
837c30fb33 [llvm-cov] Disable zlib compression in a test input, unbreaks bots
Disable name compression in the inputs used to produce
multiple-files.covmapping. Should fix bots which don't compile with
zlib:

  http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/19610/steps/test/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 01:19:29 +00:00
Vedant Kumar
d2e36ca513 [llvm-cov] Use less space to describe source names
In r279628, we made SourceCoverageView list the binary associated with a
view and started adding labels (e.g "Source: foo" or "Function: bar") to
everything. Condense this information a bit to unclutter reports.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 00:56:48 +00:00
Vedant Kumar
a57be10507 [llvm-cov] Drop the longest common filename prefix from summaries
Remove the longest common prefix from filenames when printing coverage
summaries. This makes them easier to compare.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 00:56:43 +00:00
Davide Italiano
fab897dd11 [lib/LTO] Add a way to run a custom pipeline
Differential Revision:  https://reviews.llvm.org/D24095

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 17:46:16 +00:00
Ying Yi
84f34c0155 [llvm-cov] Add the project summary to the text coverage report for each source file.
This patch is a spin-off from https://reviews.llvm.org/D23922. It extends the text view to preserve the same feature as the html view.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-06 21:41:38 +00:00
Ying Yi
f73cd14f4a [llvm-cov] Add the "Go to first unexecuted line" feature.
This patch provides easy navigation to find the zero count lines, especially useful when the source file is very large.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-06 19:31:18 +00:00
Rafael Espindola
ec44cfdaf0 Add an c++ itanium demangler to llvm.
This adds a copy of the demangler in libcxxabi.

The code also has no dependencies on anything else in LLVM. To enforce
that I added it as another library. That way a BUILD_SHARED_LIBS will
fail if anyone adds an use of StringRef for example.

The no llvm dependency combined with the fact that this has to build
on linux, OS X and Windows required a few changes to the code. In
particular:

    No constexpr.
    No alignas

On OS X at least this library has only one global symbol:
__ZN4llvm16itanium_demangleEPKcPcPmPi

My current plan is:

    Commit something like this
    Change lld to use it
    Change lldb to use it as the fallback

    Add a few #ifdefs so that exactly the same file can be used in
    libcxxabi to export abi::__cxa_demangle.

Once the fast demangler in lldb can handle any names this
implementation can be replaced with it and we will have the one true
demangler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-06 19:16:48 +00:00
George Rimar
677dd5b404 [llvm-readobj] - Teach readobj to print DT_AUXILIARY dynamic tag in human readable form.
Previously DT_AUXILIARY was unknown, patch fixes that.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280471 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 07:35:19 +00:00
Teresa Johnson
33f98b3b90 [LTO] Fix common test to reflect r279911 and move to X86 subdirectory
Adjust the test to reflect the changes to common handling in r279911.
This test wasn't running due to an incorrect REQUIRES and thus missed
being modified for r279911 before. It was changed to XFAIL when the
bad REQUIRES was discovered.

Remove the XFAIL and move to a new X86 subdirectory that will properly
disable on non-X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 16:15:39 +00:00
Vedant Kumar
751f50e8f5 [llvm-cov] Drop redundant "No." suffix in a column title
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280181 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 00:09:44 +00:00
Hemant Kulkarni
911b0b869e Revert "ELFDumper: Unversioned symbols must not have trailing @"
This reverts commit 8df7a877949e8782a3a28e3ecdb0770c1e444056.

Fixing other repositories and adding changes together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30 20:42:46 +00:00
Hemant Kulkarni
b16d4d3441 ELFDumper: Unversioned symbols must not have trailing @
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30 19:50:02 +00:00
Saleem Abdulrasool
b899d1987d llvm-readobj: add support for printing GNU Notes
Add support for printing the GNU Notes.  This allows an easy way to view the
build id for a binary built with the build id.  Currently, this only handles the
GNU notes, though it would be easy to extend for other note types (default,
FreeBSD, NetBSD, etc).  Only the GNU style is supported currently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30 18:52:02 +00:00
Ying Yi
696fea911d [llvm-cov] Use the native path in the coverage report.
The coverage reports contain the source or binary file paths. On Windows, 
the file path might contain the seperators of both '/' and '\'. This patch 
uses the native path in the coverage reports. For example, on Windows, 
all '/' are converted to '\'.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280061 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30 07:01:37 +00:00
Teresa Johnson
bf8ab3e6da [gold] Fix test accidentally regressed for newer gold
With r279911 I accidentally regressed the gold/X86/start-lib-common.ll
test for newer golds (v1.12+) that honor the --start-lib/--end-lib.
Remove the alignment which should not be there to make this work with
both old and new gold linkers.

Additionally, now that we have a subdirectory for v1.12+ gold tests,
copy this test there and check specifically for the v1.12+ behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 16:22:23 +00:00
Benjamin Kramer
5f65d099eb Mark test as XFAIL instead of disabling it everywhere.
There is no lit feature 'X86' so this test is just disabled completely.
Make it XFAIL until a solution is found.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 12:41:32 +00:00
Teresa Johnson
2b799fdb18 [LTO] Don't create a new common unless merged has different size
Summary:
This addresses a regression in common handling from the new LTO
API in r278338. Only create a new common if the size is different.
The type comparison against an array type fails when the size is
different but not an array. GlobalMerge does not handle the
array types as well and we lose some global merging opportunities.

Reviewers: mehdi_amini

Subscribers: junbuml, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-27 04:41:22 +00:00
Hemant Kulkarni
c76060f385 llvm-objdump: ELF: Handle code and data mix in all scenarios
Differential Revision: https://reviews.llvm.org/D23621

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 19:41:08 +00:00
Teresa Johnson
57b248aeba [ThinLTO/gold] Add caching support to gold-plugin
Summary:
With support now in the new LTO API for caching (r279576), add
optional ThinLTO caching in the gold-plugin.

Reviewers: mehdi_amini

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 15:11:47 +00:00
Ying Yi
1461e992f9 [llvm-cov] Add the project summary to each source file coverage report.
This patch includes the following changes:
- Included header "Code coverage report" and include the date that the report was created.
- Included title (as specified in a command line option, (i.e llvm-cov  -project-title="Simple Test")
- In the summary, list the elf files that the source code file has contributed to.
- Used column heading for "Line No.", "Count No.", Source".

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279628 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 14:27:23 +00:00
Mehdi Amini
f151c23e96 Tentatively fix gold-plugin test: ThinLTO objects start at offset 0 now.
Annoyingly, incremental builds don't detect these kind of issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 05:50:07 +00:00
Mehdi Amini
f631b7acf6 Add REQUIRES:X86 to test/tools/llvm-lto2/common.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 06:37:41 +00:00
Mehdi Amini
156e0dace9 [LTO] Handles commons in monolithic LTO
The gold-plugin was doing this internally, now the API is handling
commons correctly based on the given resolution.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22 06:25:46 +00:00
Teresa Johnson
f4b6540880 [gold/ThinLTO] Restore ThinLTO file management in gold plugin
Summary:
The gold-plugin changes added along with the new LTO API in r278338 had
the effect of removing the management of the PluginInputFile that
ensured the files weren't released back to gold until the backend
threads were complete. Add back the old file handling.

Fixes PR29020.

Reviewers: mehdi_amini

Subscribers: mehdi_amini, llvm-commits, hjl.tools

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279356 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-20 01:24:07 +00:00
Teresa Johnson
746d3be625 [gold] Fix new gold test to specify emulation mode
Add emulation mode option for new test added in r279023.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279355 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-20 01:22:10 +00:00
NAKAMURA Takumi
edd69949b5 Fix tests in llvm/test/tools/gold/X86 to satisfy r279014.
They would unexpectedly pass if test/tools/gold/X86/Output had outputs of previous tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 06:44:44 +00:00
Hemant Kulkarni
f20ce37e8e llvm-objdump: Add Hexagon printer changes for -S/-l options
Differential Revision: https://reviews.llvm.org/D23521

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 21:50:13 +00:00
Saleem Abdulrasool
8a8360251d llvm-objdump: add coff import library symbol listing support
This adds behaviour similar to binutils' objdump which can show symbols in an
import library.  Differences from that stem around the fact that we do not
create section symbols nor the all import import descriptor symbol reference.
However, this does mean that the tool can serve as a possible replacement for
the existing tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 16:39:19 +00:00
Saleem Abdulrasool
cec5045f78 llvm-readobj: handle import libraries with -coff-exports
`link -dump -exports` lists exported symbols from import libraries as well as
normal dlls.  Ensure that we can handle import libraries as well in
llvm-readobj.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 14:32:11 +00:00
Teresa Johnson
b5871f9fcb Fix bot failure due to new test
I had updated the output file name but not the corresponding nm based check
before submitting as r279023. This should fix the bot failures

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279025 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 01:18:15 +00:00
Teresa Johnson
b798b8ca89 [ThinLTO] Keep common symbols in ThinLTO modules
Summary:
Skip the merging of common symbols for ThinLTO modules, they will be
merged by the final native object link. Trying to merge the symbols and
add to a combined module will incorrectly enable the common symbol to be
internalized in the ThinLTO module. Additionally, we will not want to
create a combined module for ThinLTO distributed builds.

This fixes failures in 7 cpu2006 benchmarks from the new LTO API in
ThinLTO mode.

Reviewers: mehdi_amini

Subscribers: pcc, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 01:08:50 +00:00
Mehdi Amini
a53e50c418 [LTO] Change addSaveTemps API: do not add dot to the supplied prefix path
Summary:
It does not play well with directories (end up with a bunch of hidden
files).
Also, do not strip the 0 suffix for the first task, especially since
0 can be used by ThinLTO as well now.

Reviewers: tejohnson

Subscribers: mehdi_amini, pcc, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279014 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 00:12:33 +00:00
Mike Aizatsky
f514d2f83e [sancov] extracting AArch64 test to a separate file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 22:30:37 +00:00
Hemant Kulkarni
072a33f253 Really fix the issue with 502957cc9c. Windows %p and FileCheck limitations makes the test linux only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278748 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 21:38:23 +00:00
Hemant Kulkarni
3928f27c2d Fix a test that failed due to:
https://llvm.org/svn/llvm-project/llvm/trunk@278725 91177308-0d34-0410-b5e6-96231b3b80d8

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 20:36:16 +00:00
Hemant Kulkarni
502957cc9c llvm-objdump: Implement source[line numbers] interleaving
Differential Revsion: https://reviews.llvm.org/D22932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 19:49:24 +00:00
Mehdi Amini
5ac928f38c Add missing REQUIRES in sancov/print_coverage_pcs.test: it requires aarch64 as well now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278601 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 19:44:02 +00:00
Mike Aizatsky
a7eb97f818 [AArch64] Registering default MCInstrAnalysis
Even in this form it is useful: it can detect branch instructions.

https://github.com/google/sanitizers/issues/706

Subscribers: aemerson, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278560 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 20:28:05 +00:00
Kevin Enderby
296471b040 Next set of additional error checks for invalid Mach-O files.
This contains the two missing checks for LC_SEGMENT load command fields.
And checks for the Mach-O sections fields that would make them invalid.

With the new checks, some of the existing malformed file checks now trips one
of these instead of the issue it was having before so those tests were adjusted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278557 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 20:10:25 +00:00
Mike Aizatsky
f5a4670068 [sancov] test file cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278556 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 20:06:32 +00:00
Mike Aizatsky
fd3780bb83 [sancov] MachO indirect symbols support.
Differential Revision: https://reviews.llvm.org/D23338

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 19:25:59 +00:00
Teresa Johnson
2d320e58a9 Restore "Resolution-based LTO API."
This restores commit r278330, with fixes for a few bot failures:
- Fix a late change I had made to the save temps output file that I
  missed due to existing files sitting on my disk
- Fix a bunch of Windows bot failures with "ambiguous call to overloaded
  function" due to confusion between llvm::make_unique vs
  std::make_unique (preface the new make_unique calls with "llvm::")
- Attempt to fix a modules bot failure by adding a missing include
  to LTO/Config.h.

Original change:

Resolution-based LTO API.

Summary:
This introduces a resolution-based LTO API. The main advantage of this API over
existing APIs is that it allows the linker to supply a resolution for each
symbol in each object, rather than the combined object as a whole. This will
become increasingly important for use cases such as ThinLTO which require us
to process symbol resolutions in a more complicated way than just adjusting
linkage.

Patch by Peter Collingbourne.

Reviewers: rafael, tejohnson, mehdi_amini

Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 14:58:12 +00:00
Teresa Johnson
6f0ab85031 Revert "Resolution-based LTO API."
This reverts commit r278330.

I made a change to the save temps output that is causing issues with the
bots. Didn't realize this because I had older output files sitting on
disk in my test output directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 13:03:56 +00:00
Teresa Johnson
9fd977036c Resolution-based LTO API.
Summary:
This introduces a resolution-based LTO API. The main advantage of this API over
existing APIs is that it allows the linker to supply a resolution for each
symbol in each object, rather than the combined object as a whole. This will
become increasingly important for use cases such as ThinLTO which require us
to process symbol resolutions in a more complicated way than just adjusting
linkage.

Patch by Peter Collingbourne.

Reviewers: rafael, tejohnson, mehdi_amini

Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits

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

Address review comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 12:56:40 +00:00
Reid Kleckner
de2cc1c7a0 Disable sancov tests failing due to apparent endianness issues
Undoes some of the effect of r278271

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 20:11:35 +00:00
Reid Kleckner
455668a91c [sancov] Port sancov -print-coverage-pcs to COFF
The export table is not considered part of the object file symbol table,
so we have to look through it separately.

Reviewers: kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 20:08:19 +00:00
Reid Kleckner
d3396f4e90 [sancov] Run more sancov tests on non-x86-Linux machines
Add the $arch-registered-target features that clang uses to disable
tests that require a registered backend, so that we can run the sancov
tests on Windows. LLVM's lit suite did not appear to have a per-test way
to do this, and I would rather not split up the sancov tests into
architecture directories.

Split out of https://reviews.llvm.org/D23321

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278271 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 19:03:18 +00:00
Ying Yi
17a2f3f28e [llvm-cov] Swapped the line and count columns.
In the coverage report, the line and count columns have been swapped to make it more readable.
A follow-up commit in compiler-rt is needed

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 19:53:35 +00:00
Kevin Enderby
cedb0b6b7e Add the first of what will be a long line of additional error checks for invalid Mach-O files.
This is where an LC_SEGMENT load command has a fileoff field that
extends past the end of the file.

Also fix llvm-nm and llvm-size to remove the errorToErrorCode() call so error messages are printed.
And needed to update a few test cases now that they do print the error messages just a
bit differently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 18:19:40 +00:00
Bruno Cardoso Lopes
4544896cb9 [LIT][Darwin] Change %ld64 to be prefixed with DYLD_INSERT_LIBRARIES
Followup from r277778, after Mehdi's comments.

Expand %ld64 to perform the necessary preload instead, that way new
tests do not need to worry about setting up DYLD_INSERT_LIBRARIES
themselves.

rdar://problem/24300926

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 23:58:30 +00:00
Bruno Cardoso Lopes
749f338d26 [LIT][Darwin] Preload libclang_rt.asan_osx_dynamic.dylib when necessary
Green Dragon's darwin stage2 asan bot fails on some checks:
http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check

  test/tools/lto/hide-linkonce-odr.ll
  test/tools/lto/opt-level.ll

ERROR: Interceptors are not working. This may be because
AddressSanitizer is loaded too late (e.g. via dlopen)

To fix this, %ld64 needs to load 'libclang_rt.asan_osx_dynamic.dylib'
before libLTO.dylib, via DYLD_INSERT_LIBRARIES. This won't work by
updating config.environment, since some shim binary in the way scrubs
the env vars. Instead, provide the path to this lib through %asanrtlib,
which can then be used by tests directly with DYLD_INSERT_LIBRARIES.

rdar://problem/24300926

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 22:01:38 +00:00
Ying Yi
65787e2459 [LLVM-COV]Replace tabs to the space indentations in the HTML coverage report.
When using orbis-llvm-cov.exe to generate the HTML report, the HTML report 
can look quite different to the source file if it includes tabs.The default
tab size is 2 spaces instead of 8 spaces. A command line switch is
be added to set the tab size.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04 10:39:43 +00:00
Vedant Kumar
e5d157859c Reapply "More fixes to get good error messages for bad archives."
This reverts commit the revert commit r277627. The build errors
mentioned in r277627 were likely caused by an unclean build directory.
Sorry for the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 19:02:50 +00:00
Vedant Kumar
a0149b5f2f Revert "More fixes to get good error messages for bad archives."
This reverts commit r277540. It breaks the build with:

../lib/Object/Archive.cpp:264:41: error: return type of out-of-line definition of 'llvm::object::ArchiveMemberHeader::getUID' differs from that in the declaration
Expected<unsigned> ArchiveMemberHeader::getUID() const {
~~~~~~~~~~~~~~~~~~                      ^
include/llvm/Object/Archive.h:53:12: note: previous declaration is here
  unsigned getUID() const;
  ~~~~~~~~ ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 18:44:32 +00:00
Kevin Enderby
d5adfbcabc More fixes to get good error messages for bad archives.
Fixed the last incorrect uses of llvm_unreachable() in the code
which were actually just cases of errors in the input Archives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277540 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 22:58:55 +00:00
Kevin Enderby
ebd83360ff Think this will fix issues with the error messages generated for malformed-archives.test
in r277177 and added back this test which was deleted in r277196 while
I tracked down these problems.

Changed from constructing Twine's to std::string's as Twine's don't work
across statements.  Also removed a few unneeded Twine() constructions.

Fix the write_escaped() calls to not pass the unintended second argument
fixing the warning on the ld-x86_64-win7 bot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 22:32:02 +00:00
Kevin Enderby
b2cc749171 Remove the test/tools/llvm-objdump/malformed-archives.test for
now while I investagate the bot failures with this test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:46:24 +00:00
Kevin Enderby
2a7151766d The next step along the way to getting good error messages for bad archives.
As mentioned in commit log for r276686 this next step is adding a new
method in the ArchiveMemberHeader class to get the full name that
does proper error checking, and can be use for error messages.

To do this the name of ArchiveMemberHeader::getName() is changed to
ArchiveMemberHeader::getRawName() to be consistent with
Archive::Child::getRawName().  Then the “new” method is the addition
of a new implementation of ArchiveMemberHeader::getName() which gets
the full name and provides proper error checking.  Which is mostly a rewrite
of what was Archive::Child::getName() and cleaning up incorrect uses of
llvm_unreachable() in the code which were actually just cases of errors
in the input Archives.

Then Archive::Child::getName() is changed to return Expected<> and use
the new implementation of ArchiveMemberHeader::getName() .

Also needed to change Archive::getMemoryBufferRef() with these
changes to return Expected<> as well to propagate Errors up.
As well as changing Archive::isThinMember() to return Expected<> .


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:44:13 +00:00
Teresa Johnson
88a5c80f55 Capture stderr when checking for gold version
On MacOS the ld version is emitted to stderr, resulting in lots of
messages in the ninja check output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277092 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 00:39:56 +00:00
Vedant Kumar
e201775db6 [llvm-cov] Add a debug mode for source range highlighting (in html)
llvm-cov's `-dump' option now emits information which helps debug source
range highlighting in html mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 21:57:15 +00:00
Teresa Johnson
8b87628b0f [test/gold] Add gold test subdirectory tests needing v1.12 (or higher)
Summary:
As discussed in the review for D22677, added a subdirectory to
enable tests that require at least version 1.12 of gold.

Add an initial test requiring this version.

Reviewers: davidxl, mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 12:59:51 +00:00
Vedant Kumar
c380ddf1dc [llvm-cov] Escape '\' in strings when emitting JSON
Test that Windows path separators are escaped properly. Add a round-trip
test to verify the JSON produced by the exporter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 04:08:32 +00:00
Vedant Kumar
53397d1544 Retry: [llvm-cov] Add support for exporting coverage data to JSON
This enables users to export coverage information as portable JSON for use by
analysis tools and storage in document based databases.

The export sub-command is invoked just like the others:

  llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary

The resulting JSON contains a list of files and functions. Every file object
contains a list of segments, expansions, and a summary of the file's region,
function, and line coverage. Every function object contains the function's name
and regions. There is also a total summary for the entire object file.

Changes since the initial commit (r276813):

  - Fixed the regexes in the tests to handle Windows filepaths.

Patch by Eddie Hurtig!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 22:50:58 +00:00
Vedant Kumar
63d80be936 Revert "[llvm-cov] Add support for exporting coverage data to JSON"
This reverts commit r276813. The Windows bots are complaining about some
of the filename regexes in the tests:

  http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/5299

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:55:39 +00:00
Vedant Kumar
f57cf2f2c7 [llvm-cov] Add support for exporting coverage data to JSON
This enables users to export coverage information as portable JSON for use by
analysis tools and storage in document based databases.

The export sub-command is invoked just like the others:

  llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary

The resulting JSON contains a list of files and functions. Every file object
contains a list of segments, expansions, and a summary of the file's region,
function, and line coverage. Every function object contains the function's name
and regions. There is also a total summary for the entire object file.

Patch by Eddie Hurtig!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 21:35:43 +00:00
Kevin Enderby
dc02554240 Next step along the way to getting good error messages for bad archives.
I consulted with Lang Hames on this work, and the goal was to add a bit
of "where" in the archive the error occurred along with what the error was.

So this step changes ArchiveMemberHeader into a class with a pointer
to the archive header and the parent archive.  Which allows the methods
in the ArchiveMemberHeader to determine which member the header is
for to include that information in the error message.

For this first step the "where" is just the offset to the member in the
archive.  The next step will be a new method on ArchiveMemberHeader
to get the full name, if possible, to be use in the error message.  Which
will now be possible as ArchiveMemberHeader contains a pointer to
the Archive with its string table and its size, etc. so the full name can
be determined from the header if it is valid.

Also this change adds the missing checks the archive header is actually
contained in the buffer and is not truncated, as well as if the terminating
characters are correct in the header.

And changes one error message in Archive::Child::getNext() where the
name or offset to member is now added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 20:36:36 +00:00
Vedant Kumar
d12f3729fd [llvm-cov] Don't copy stylesheets into index files
Just link in the stylesheet from the toplevel dir of the report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 20:49:23 +00:00
Teresa Johnson
13bed9484c [ThinLTO/gold] Remove thin archive part of new test due to bot failures
I am getting a bot failure from the thin archive part of this test:

From
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/40468/steps/test_llvm/logs/LLVM%20%3A%3A%20tools__gold__X86__thinlto_emit_linked_objects.ll:

Command Output (stderr):
--
/home/bb/cmake-llvm-x86_64-linux/build/./bin/llvm-ar: creating
/home/bb/cmake-llvm-x86_64-linux/build/test/tools/gold/X86/Output/thinlto_emit_linked_objects.ll.tmp2.a
/usr/bin/ld.gold: internal error in add_writer, at
../../gold/token.h:124

--

This appears to be an issue with an older version of gold. The test case
passes for me locally when I use the gold v1.12 I was testing with, but
when I tried the gold installed on my system which is v1.11 I get the
same error.

Remove the thin archive version of the test, since there isn't a way to
predicate it on gold version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 18:32:30 +00:00
Teresa Johnson
9493a84086 [ThinLTO/gold] Support for getting list of included objects from gold
Summary:
In the distributed backend case, the ThinLink step and the final native
object link are separate processes. This can be problematic when archive
libraries are involved in the link (e.g. via --start-lib/--end-lib
pairs). The linker only includes objects from libraries when
there is a strong reference to them, and depending on the intervening
ThinLTO backend processes' importing/inlining, the strong references
may appear different in the two link steps. See D22356 and D22467
for two scenarios where this causes issues.

To ensure that the final link includes the same objects, this patch
adds support for an "=filename" form of the thinlto-index-only plugin
option, in which case objects gold included in the link are emitted to
the given filename. This should be used as input to the final link (e.g.
via the @filename option to gold), instead of listing all the objects
within --start-lib/--end-lib pairs again.

Note that the support for the gold callback that identifies included
objects was added in gold version 1.12.

Reviewers: davidxl, mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 18:20:22 +00:00
Ying Yi
d6931b112a [llvm-cov] - Add the coverage of lines in the summary report.
The llvm-cov ‘report' command displays a summary of the coverage of a binary file.
The summary report currently only includes covered regions and covered functions.
This patch adds the coverage of lines in the summary report.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 12:46:13 +00:00
Benjamin Kramer
3d6f5139ec [llvm-profdata] Bring back reading profile data from STDIN.
This feature was lost in r276197.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 12:39:55 +00:00
Ying Yi
9b5c51d077 [llvm-cov] - Improve llvm-cov error message
Summary:

When giving the following command:
% llvm-cov report -instr-profile=default.profraw

llvm-cov will give the following error message:

>llvm-cov report: Not enough positional command line arguments specified!
>Must specify at least 1 positional arguments: See: orbis-llvm-cov report -help

This patch changes the error message from  '1 positional arguments'
to '1 positional argument'.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276404 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22 10:52:21 +00:00
Vedant Kumar
23553e9b24 [llvm-cov] Strengthen a test case
Check that stylesheets work when we're not using -output-dir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 23:31:26 +00:00
Vedant Kumar
6aa68be50e [llvm-cov] Use relative paths to the stylesheet (for html reports)
This makes it easy to swap out the default stylesheet for a custom one.
It also shaves ~6.62 MB out of the report directory for a full coverage
build of llvm+clang.

While we're at it, prune the CSS and add tests for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276359 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 23:26:15 +00:00
Xinliang David Li
a0113c20a0 Fix test failure on Win
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 22:53:39 +00:00
Xinliang David Li
30a3883a4d Reapply r276185
Fix the test case that should not depend on dir iteration order.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276197 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 22:24:52 +00:00
Xinliang David Li
64865dfb7e Revert r276185 -- build bot failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:50:38 +00:00
Xinliang David Li
d05d2538c7 [Profile] support directory reading in profile merging
Differential Revision:  http://reviews.llvm.org/D22560




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:31:29 +00:00
Kevin Enderby
fa9076153b Next step along the way to getting good error messages for bad archives.
This step builds on Lang Hames work to change Archive::child_iterator
for better interoperation with Error/Expected.  Building on that it is now
possible to return an error message when the size field of an archive
contains non-decimal characters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276025 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 20:47:07 +00:00
Vedant Kumar
d91d378e3a Retry: [llvm-profdata] Speed up merging by using a thread pool
Add a "-j" option to llvm-profdata to control the number of threads used.
Auto-detect NumThreads when it isn't specified, and avoid spawning threads when
they wouldn't be beneficial.

I tested this patch using a raw profile produced by clang (147MB). Here is the
time taken to merge 4 copies together on my laptop:

  No thread pool: 112.87s user 5.92s system 97% cpu 2:01.08 total
  With 2 threads: 134.99s user 26.54s system 164% cpu 1:33.31 total

Changes since the initial commit:

  - When handling odd-length inputs, call ThreadPool::wait() before merging the
    last profile. Should fix a race/off-by-one (see r275937).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 01:17:20 +00:00
Vedant Kumar
40a2c5247c Revert "[llvm-profdata] Speed up merging by using a thread pool"
This reverts commit r275921. It broke the ppc64be bot:

  http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/3537

I'm not sure why it broke, but based on the output, it looks like an
off-by-one (one profile left un-merged).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 00:57:09 +00:00
Vedant Kumar
94471e314e [llvm-profdata] Speed up merging by using a thread pool
Add a "-j" option to llvm-profdata to control the number of threads
used. Auto-detect NumThreads when it isn't specified, and avoid spawning
threads when they wouldn't be beneficial.

I tested this patch using a raw profile produced by clang (147MB). Here is the
time taken to merge 4 copies together on my laptop:

  No thread pool: 112.87s user 5.92s system 97% cpu 2:01.08 total
  With 2 threads: 134.99s user 26.54s system 164% cpu 1:33.31 total

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 22:02:39 +00:00
Vedant Kumar
98c7b9a114 [llvm-cov] Place anchors around line numbers in html reports
Based on a suggestion by Harlan Haskins!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 17:53:16 +00:00
Vedant Kumar
4893e1f8d4 [llvm-cov] Attempt to fix a test failure on Windows
Don't make the test/tools/llvm-cov/demangle.test depend on the order in
which symbols are seen, or on the exact formatting llvm-cov emits after
a symbol is printed. This is an attempt to fix a Windows bot failure:

  http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/9141

I don't know what the root cause of the failure is, or why the
showTemplateInstantiations test doesn't fail in the same way on the
Windows bots. However, this measure can't hurt, and it'll at least get
me on the blamelists again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 04:49:42 +00:00
Vedant Kumar
13ca1ccb76 [llvm-cov] Optionally use a symbol demangler when preparing reports
Add an option to specify a symbol demangler (as well as options to the
demangler). This can be used to make reports more human-readable.

This option is especially useful in -output-dir mode, since it isn't as
easy to manually pipe reports into a demangler in this mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275640 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:44:57 +00:00
Vedant Kumar
58d6ea41de [llvm-cov] Relax a test for Windows
Attempt to address this bot failure:

  http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/4967

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275522 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 02:11:37 +00:00
Vedant Kumar
b972a0f1a0 [llvm-cov] Improve error messages
While we're at it, extend an existing test to make sure that error
messages look reasonable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 01:53:39 +00:00
Tim Northover
520a6ed0f1 llvm-objdump: extend __mh_execute_header handling to other special syms
We don't need to print any of the special __mh_*_header symbols when
disassembling. Since they point at the beginning of the segment (not where the
actual code is) they're pretty misleading.

Should also fix lld bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 23:13:03 +00:00
Tim Northover
323f7893f4 llvm-objdump: handle stubbed and malformed dylibs better
We were quite happy to read past the end of the valid section data when
disassembling. Instead we entirely skip stub dylibs, and tell the user what's
happened if their section only has partial data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275487 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 22:13:32 +00:00
Teresa Johnson
b0786ec025 [ThinLTO/gold] Perform index-based weak/linkonce resolution
Summary:
Invoke the weak/linkonce symbol resolution support (already used by
libLTO) that operates via the summary index.

This ensures prevailing linkonce are kept, by making them weak, and
marks preempted copies as available_externally when possible.

With this change, the older support for keeping the prevailing linkonce
(by changing their symbol resolution) is removed.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 21:13:24 +00:00
Teresa Johnson
929c941856 [ThinLTO/gold] Enable symbol resolution in distributed backend case
While testing a follow-on change to enable index-based symbol resolution
and internalization in the distributed backends, I realized that a test
case change I made in r275247 was only required because we were not
analyzing symbols in the claimed files in thinlto-index-only mode.

In the fixed test case there should be no internalization because we are
linking in -shared mode, so f() is in fact exported, which is detected
properly when we analyze symbols in thinlto-index-only mode. Note that
this is not (yet) a correctness issue (because we are not yet performing
the index-based linkage optimizations in the distributed backends -
that's coming in a follow-on patch).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-13 16:35:56 +00:00
Teresa Johnson
90c5cb8752 [ThinLTO/gold] ThinLTO internalization fixes
Internalization was missing cases where we originally had a local symbol
that was promoted eagerly but not actually exported. This is because we
were only internalizing the set of global (non-local) symbols that were
PREVAILAING_DEF_IRONLY. Instead, collect the set of global symbols that
are referenced outside of a single IR file, and skip internalization for
those.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-13 03:42:41 +00:00
Vedant Kumar
55c8c00ac7 [llvm-cov] Add support for creating html reports
Based on a patch by Harlan Haskins!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-06 21:44:05 +00:00
Saleem Abdulrasool
ae50a144ac test: relax the match on the timestamp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-05 01:14:53 +00:00
Saleem Abdulrasool
e88f1b3430 Object: support empty UID/GID fields
Normal archives do not have empty UID/GID fields.  However, the Microsoft
Import library format is a customized archive (it just uses an alternate symbol
index format).  When the import library is constructed by lib.exe, the UID and
GID fields are left empty.  Do not abort on such an input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274528 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-05 00:23:05 +00:00
Zachary Turner
3a4681d580 Update llvm-pdbdump to use subcommands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 17:42:48 +00:00
Vedant Kumar
d378d9725e [llvm-cov] Use relative paths to file reports in -output-dir mode
This makes it possible to e.g copy a report to another filesystem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 21:55:46 +00:00
Vedant Kumar
bdd649ed06 [llvm-cov] Change some FileCheck prefixes to make tests reusable (NFC)
I'm planning on extending these two tests with checks that validate
html coverage reports. Make it easier to extend them by not using a
prefix called "CHECK".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 17:47:08 +00:00
Vedant Kumar
f98b39d12d [llvm-cov] Disable PGO name compression in a test file
Some bots do not configure llvm with zlib enabled. Should fix:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/15571

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 16:34:57 +00:00
Vedant Kumar
80221c64fc Fix a typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 16:23:34 +00:00
Vedant Kumar
651e3ffa96 [llvm-cov] Do not allow ".." to escape the coverage sub-directory
In -output-dir mode, file reports are placed into a "coverage"
directory. If filenames in the coverage mapping contain "..", they might
escape out of this directory.

Fix the problem by removing ".." from source filenames (expand the path
component).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 16:22:12 +00:00
Vedant Kumar
cd29c6b37b [llvm-cov] Minor cleanups to prepare for the html format patch
- Add renderView{Header,Footer}, renderLineSuffix, and hasSubViews to
  support creating tables with nested views.

- Move the 'Format' cl::opt to make it easier to extend.

- Just create one function view file, instead of overwriting the same
  file for every new function. Add a regression test for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 00:38:21 +00:00
Jacques Pienaar
041fc266ab [lanai] Update ELF number to correspond to the assigned number.
Change EM_LANAI to correspond to machine number assigned by Xinuos.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 18:22:22 +00:00
Vedant Kumar
028d73c4cd [llvm-cov] Create an index of reports in -output-dir mode
This index lists the reports available in the 'coverage' sub-directory.
This will help navigate coverage output from large projects.

This commit factors the file creation code out of SourceCoverageView and
into CoveragePrinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 16:12:24 +00:00
Vedant Kumar
184c22415b [llvm-cov] Minor cleanups (NFC)
- Test the '-o' alias for -output-dir.
- Use a helper method in a conditional.
- Add a period.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 16:12:20 +00:00
Arnaud A. de Grandmaison
6a84436d51 [gold] Really fix test to run on non x86 platforms.
Address post-commit comment from H.J. Lu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 08:12:09 +00:00
Vedant Kumar
40a78f87a4 Reapply "[llvm-cov] Add an -output-dir option for the show sub-command""
Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if
it doesn't already exist, and prints reports into that directory.

In function view mode, all views are written into
path/to/dir/functions.$EXTENSION. In file view mode, all views are
written into path/to/dir/coverage/$PATH.$EXTENSION.

Changes since the initial commit:

- Avoid accidentally closing stdout twice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 02:09:39 +00:00
Vedant Kumar
69821cb9ef Revert "[llvm-cov] Add an -output-dir option for the show sub-command"
This reverts commit r273971. test/profile/instrprof-visibility.cpp is
failing because of an uncaught error in SafelyCloseFileDescriptor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 01:14:04 +00:00
Vedant Kumar
b979c03ac6 [llvm-cov] Add an -output-dir option for the show sub-command
Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if
it doesn't already exist, and prints reports into that directory.

In function view mode, all views are written into
path/to/dir/functions.$EXTENSION. In file view mode, all views are
written into path/to/dir/coverage/$PATH.$EXTENSION.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273971 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 00:18:57 +00:00
Vedant Kumar
ba1a097676 [llvm-cov] Use -check-prefixes in a test (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 00:18:53 +00:00
Vedant Kumar
0347ce77ea [llvm-cov] Add a format option for the 'show' sub-command (mostly NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 00:15:54 +00:00
Chris Bieneman
9cf90e65d1 [yaml2obj] Remove --format option in favor of YAML tags
Summary:
Our YAML library's handling of tags isn't perfect, but it is good enough to get rid of the need for the --format argument to yaml2obj. This patch does exactly that.

Instead of requiring --format, it infers the format based on the tags found in the object file. The supported tags are:

!ELF
!COFF
!mach-o
!fat-mach-o

I have a corresponding patch that is quite large that fixes up all the in-tree test cases.

Reviewers: rafael, Bigcheese, compnerd, silvas

Subscribers: compnerd, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 19:53:53 +00:00
Arnaud A. de Grandmaison
7ca89ec4a8 [gold] Fix test to not assume it runs on x86 hardware.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 09:13:03 +00:00
Saleem Abdulrasool
005f32a475 llvm-ar: add some tests for llvm-ar default selection
This adds some tests for the smarter llvm-ar selection mode as well as some
additional tests as per Rafael's post commit review comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25 03:05:56 +00:00
Peter Collingbourne
dba9146333 IR: New representation for CFI and virtual call optimization pass metadata.
The bitset metadata currently used in LLVM has a few problems:

1. It has the wrong name. The name "bitset" refers to an implementation
   detail of one use of the metadata (i.e. its original use case, CFI).
   This makes it harder to understand, as the name makes no sense in the
   context of virtual call optimization.

2. It is represented using a global named metadata node, rather than
   being directly associated with a global. This makes it harder to
   manipulate the metadata when rebuilding global variables, summarise it
   as part of ThinLTO and drop unused metadata when associated globals are
   dropped. For this reason, CFI does not currently work correctly when
   both CFI and vcall opt are enabled, as vcall opt needs to rebuild vtable
   globals, and fails to associate metadata with the rebuilt globals. As I
   understand it, the same problem could also affect ASan, which rebuilds
   globals with a red zone.

This patch solves both of those problems in the following way:

1. Rename the metadata to "type metadata". This new name reflects how
   the metadata is currently being used (i.e. to represent type information
   for CFI and vtable opt). The new name is reflected in the name for the
   associated intrinsic (llvm.type.test) and pass (LowerTypeTests).

2. Attach metadata directly to the globals that it pertains to, rather
   than using the "llvm.bitsets" global metadata node as we are doing now.
   This is done using the newly introduced capability to attach
   metadata to global variables (r271348 and r271358).

See also: http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:21:32 +00:00
Vedant Kumar
5187623c72 [llvm-cov] Fix two warnings
They were using output streams inconsistently. One also had a grammar
bug.

I noticed these while trying to pare down D18278.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273642 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 02:33:01 +00:00
Vedant Kumar
d73d2ca45e [llvm-cov] Fix a buggy lit test
There is no check prefix for "WHOLE-FILE": this particular line was
supposed to use the "ALL" prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 23:58:03 +00:00
George Rimar
a4c44066ce [llvm-readobj] - Teach llvm-readobj to print dependencies of SHT_GNU_verdef and refactor dumping method.
This patch changes single method of llvm-readobj.
It teaches SHT_GNU_verdef dumper to print version dependencies,
also it removes few fields from output that can be dumped with other keys
and slightly refactors code.
Testcase was also modified to match the changes.
Change is required for testcases of upcoming lld patches.

Differential revision: http://reviews.llvm.org/D21552

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 13:43:38 +00:00
Kevin Enderby
6a96160eba Update llvm-obdump(1) to print FAT_MAGIC_64 for Darwin’s 64-bit universal files
with the -macho and -universal-headers flags.

Just a follow on to r273207, I missed updating the printing of the fat magic
number when the universal file is a 64-bit universal file.

rdar://26899493


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273324 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 21:55:01 +00:00
Rafael Espindola
e56626f946 Add a test for r273022.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-18 00:24:49 +00:00
Kevin Enderby
04195353af Fix llvm-objdump when disassembling a stripped Mach-O binary with the -macho option.
It was printing out nothing in this case.

llvm-objdump tries to disassemble sections a symbol at a time.  In the case of a
fully stripped Mach-O executable the only symbol remaining in the (__TEXT,__text)
section is the special linker defined symbol __mh_execute_header . This
symbol is special in that while it is N_SECT symbol in the (__TEXT,__text)
its address is before the start of the (__TEXT,__text).  It’s address is the
start of the __TEXT segment which is where the mach header is statically
linked. So the code in DisassembleMachO() needs to deal with this case specially.

rdar://26778273


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 21:14:01 +00:00
Peter Collingbourne
63b34cdf34 IR: Introduce local_unnamed_addr attribute.
If a local_unnamed_addr attribute is attached to a global, the address
is known to be insignificant within the module. It is distinct from the
existing unnamed_addr attribute in that it only describes a local property
of the module rather than a global property of the symbol.

This attribute is intended to be used by the code generator and LTO to allow
the linker to decide whether the global needs to be in the symbol table. It is
possible to exclude a global from the symbol table if three things are true:
- This attribute is present on every instance of the global (which means that
  the normal rule that the global must have a unique address can be broken without
  being observable by the program by performing comparisons against the global's
  address)
- The global has linkonce_odr linkage (which means that each linkage unit must have
  its own copy of the global if it requires one, and the copy in each linkage unit
  must be the same)
- It is a constant or a function (which means that the program cannot observe that
  the unique-address rule has been broken by writing to the global)

Although this attribute could in principle be computed from the module
contents, LTO clients (i.e. linkers) will normally need to be able to compute
this property as part of symbol resolution, and it would be inefficient to
materialize every module just to compute it.

See:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160509/356401.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160516/356738.html
for earlier discussion.

Part of the fix for PR27553.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272709 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 21:01:22 +00:00
Kevin Enderby
f50be3faf2 Update the AArch64ExternalSymbolizer to print literal strings as escaped strings
so it is the same as the MCExternalSymbolizer.

rdar://17349181


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 21:08:57 +00:00
Rafael Espindola
0baaa63266 Add triple to input file.
Patch by H.J. Lu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272563 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 17:08:15 +00:00
Teresa Johnson
875352d9b1 [ThinLTO/gold] Enable summary-based internalization
Summary: Enable existing summary-based importing support in the gold-plugin.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 01:14:13 +00:00
Vedant Kumar
192404027d Retry^4 "[llvm-profdata] Add option to ingest filepaths from a file"
Changes since the initial commit:
- Use echo instead of printf. This should side-step the character
  escaping issues on Windows.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 22:47:31 +00:00