8408 Commits

Author SHA1 Message Date
Vivek Pandya
4abccff981 This reverts r313381
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313387 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 19:53:54 +00:00
Vivek Pandya
bb8204f26f This patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352
It enables OptimizationRemarkEmitter::allowExtraAnalysis and MachineOptimizationRemarkEmitter::allowExtraAnalysis to return true not only for -fsave-optimization-record but when specific remarks are requested with
command line options.
The diagnostic handler used to be callback now this patch adds a class
DiagnosticHandler. It has virtual method to provide custom diagnostic handler
and methods to control which particular remarks are enabled. 
However LLVM-C API users can still provide callback function for diagnostic handler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313382 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 19:30:59 +00:00
Adrian Prantl
7c649ac2c9 llvm-dwarfdump: support dumping static archives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313272 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14 17:01:53 +00:00
George Rimar
eca1741cf5 Recommit r313234 "[llvm-readobj] - Refactor printGroupSections methods."
With fix in formatting for GNU style output.

Original commit message:
This refactors GNUStyle<ELFT>::printGroupSections and
LLVMStyle<ELFT>::printGroupSections to split out all
duplicated code.

After the change these methods just prints the data provided
by introduced getGroups in a corresponding LLVM/GNU format.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14 07:32:52 +00:00
George Rimar
505ab7db23 Revert r313234 "[llvm-readobj] - Refactor printGroupSections methods."
It broke BB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313235 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14 07:26:14 +00:00
George Rimar
1360bdf08f [llvm-readobj] - Refactor printGroupSections methods.
This refactors GNUStyle<ELFT>::printGroupSections and
LLVMStyle<ELFT>::printGroupSections to split out all
duplicated code.

After the change these methods just prints the data provided
by introduced getGroups in a corresponding LLVM/GNU format.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14 07:17:04 +00:00
Adrian Prantl
1c29e7f5eb Use MemoryBufferRef. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313212 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 23:16:13 +00:00
Adrian Prantl
d368c61fa5 Factor out duplicate code from llvm-dwarfdump (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313211 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 23:07:24 +00:00
Adrian Prantl
494372f27e llvm-dwarfdump: automatically dump both regular and .dwo variant of sections
Since users typically don't really care about the .dwo / non.dwo
distinction, this patch makes it so dwarfdump --debug-<info,...> dumps
.debug_info and (if available) also .debug_info.dwo. This simplifies
the command line interface (I've removed all dwo-specific dump
options) and makes the tool friendlier to use.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313207 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 22:09:01 +00:00
Kevin Enderby
0833191bf8 Fix a crash in llvm-nm for a bad Mach-O file that has an N_SECT type symbol and a zero n_sect value.
The code in llvm-nm for Mach-O files to determine the section type for an
N_SECT type symbol it will call getSymbolSection() and check for the error,
but in the case the n_sect value is zero it will return section_end() (aka nullptr).
And the code was using that and crashing instead of just returning a ’s’ for a
section or printing (?,?) as it would if getSymbolSection() returned an error.

rdar://33136604


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313193 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 21:01:49 +00:00
Adrian Prantl
7ff141c202 llvm-dwarfdump: support dumping UUIDs of Mach-O binaries.
This is a feature supported by Darwin dwarfdump. UUIDs are used to
associate executables with their .dSYM bundles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 18:22:59 +00:00
Alexander Kornienko
87e117df59 Convenience/safety fix for llvm::sys::Execute(And|No)Wait
Summary:
Change the type of the Redirects parameter of llvm::sys::ExecuteAndWait,
ExecuteNoWait and other APIs that wrap them from `const StringRef **` to
`ArrayRef<Optional<StringRef>>`, which is safer and simplifies the use of these
APIs (no more local StringRef variables just to get a pointer to).

Corresponding clang changes will be posted as a separate patch.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: vsk, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313155 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 17:03:37 +00:00
Francis Ricci
552028fee2 [llvm-objdump] Fix memory leaks in macho dump
Summary: Detected by LeakSanitizer for Darwin

Reviewers: enderby, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313146 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 13:57:45 +00:00
Jonas Devlieghere
d26630705d [dwarfdump] Rename Brief to Verbose in DIDumpOptions
This patches renames "brief" to "verbose" in de DIDumpOptions and
inverts the logic to match the new behavior where brief is the default.
Changing the default value uncovered some bugs related to the
DIDumpOptions not being propagated and have been fixed as well.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313139 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 09:43:05 +00:00
Petr Hosek
16aceb828a [llvm-objcopy] Add e_machine validity check for reserved section indexes
As discussed on llvm-commits it was decided it would be best to check
e_machine before declaring that a reserved section index is valid. The
only special e_machine value that matters here is EM_HEXAGON. This
change adds a special check for EM_HEXAGON.

Patch by Jake Ehrlich

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313114 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 03:04:50 +00:00
Adrian Prantl
623927eb7f Clean up the --help output of llvm-dwarfdump by hiding irrelevant options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313085 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 22:32:53 +00:00
Roman Lebedev
32e786ad2a [sancov] coverage-report-server.py: ServerHandler(): open file as UTF8
Summary:
This is nessesary in Python3. Everywhere else we assume that
encoding is UTF8. If we don't specify it here, the defaults
from the environment will be used, which may result in ASCII
decoder being used. And if the file is non-ASCII, then it
will crash:
```
  File "/usr/local/bin/coverage-report-server.py", line 168, in do_GET
    for line_no, line in enumerate(f, start=1)])
  File "/usr/local/bin/coverage-report-server.py", line 165, in <listcomp>
    ["<span class='{cls}'>{line}&nbsp;</span>".format(
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 106: ordinal not in range(128)
```

Fixes https://bugs.llvm.org/show_bug.cgi?id=33548

Now, how would i add a testcase here?

Reviewers: m.ostapenko, kcc

Reviewed By: kcc

Subscribers: kcc, llvm-commits

Tags: #sanitizers

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313063 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 18:59:21 +00:00
Vlad Tsyrklevich
9022eeaa24 Remove unneccessary string copies from method invocations.
Summary:
Change string parameter 'File' to be passed by const-reference to
reduce copies.

Patch by Mitch Phillips

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: Eugene.Zelenko, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312994 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 02:27:39 +00:00
Vlad Tsyrklevich
30b473826c Fix broken links to the Itanium CXX ABI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312985 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-12 00:19:11 +00:00
Adrian Prantl
3776c52b4d llvm-dwarfdump: Make -brief the default and add a -verbose option instead.
Differential Revision: https://reviews.llvm.org/D37717

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312972 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11 23:05:20 +00:00
Adrian Prantl
8e66c2eabb llvm-dwarfdump: Replace -debug-dump=sect option with individual options.
As discussed on llvm-dev in
http://lists.llvm.org/pipermail/llvm-dev/2017-September/117301.html
this changes the command line interface of llvm-dwarfdump to match the
one used by the dwarfdump utility shipping on macOS. In addition to
being shorter to type this format also has the advantage of allowing
more than one section to be specified at the same time.

In a nutshell, with this change

  $ llvm-dwarfdump --debug-dump=info
  $ llvm-dwarfdump --debug-dump=apple-objc

becomes

  $ dwarfdump --debug-info --apple-objc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312970 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11 22:59:45 +00:00
Eli Friedman
d3822e422b [llvm-cov] Allow hiding instantiation/region coverage from summary tables
Region coverage is difficult to explain without going deep into how
coverage is implemented. Instantiation coverage is easier to explain,
but probably not useful in most cases (templates don't exist in C, and
most C++ code contains relatively few templates).

This patch adds the options "-show-region-summary" and
"-show-instantiation-summary" to allow hiding those columns.
"-show-instantiation-summary" is turned off by default.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312969 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11 22:56:20 +00:00
Vedant Kumar
d03e3c146e [llvm-cov] Don't attach exec counts to lines which start a skipped region
These lines by definition don't have an execution count.

This is the final part of the fix for:
https://bugs.llvm.org/show_bug.cgi?id=34166

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312955 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11 21:31:32 +00:00
Vedant Kumar
31b24fc041 [llvm-cov] Fix a lifetime issue
This fixes an issue where a std::string was moved to a constructor
which accepted a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:44:49 +00:00
Vedant Kumar
2cefdfaa16 [llvm-cov] Unify region marker placement between text/html modes
Make sure that the text and html emitters always emit the same set of
region markers, and avoid emitting redundant markers for line segments
which don't end on the line they start on.

This is related to D35925, and depends on D36014

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:44:46 +00:00
Rafael Espindola
14fde14ca1 Don't call exit from cl::PrintHelpMessage.
Most callers were not expecting the exit(0) and trying to exit with a
different value.

This also adds back the call to cl::PrintHelpMessage in llvm-ar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312761 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 23:30:48 +00:00
Eugene Zelenko
f95cab8de6 [Bitcode] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312760 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 23:28:24 +00:00
Petr Hosek
a878acdb05 [llvm-objcopy] Add support for special section indexes in symbol table greater than SHN_LORESERVE
As is indexes above SHN_LORESERVE will not be handled correctly because
they'll be treated as indexes of sections rather than special values
that should just be copied. This change adds support to copy them
though.

Patch by Jake Ehrlich

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312756 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 23:02:50 +00:00
Rafael Espindola
ec364d727b llvm-ar: exit with 1 if there is an error.
This is pr34396.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312752 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 22:20:38 +00:00
Petr Hosek
746c778562 [yaml2obj][ELF] Add support for symbol indexes greater than SHN_LORESERVE
Right now Symbols must be either undefined or defined in a specific
section. Some symbols have section indexes like SHN_ABS however. This
change adds support for outputting symbols that have such section
indexes.

Patch by Jake Ehrlich

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312745 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 20:44:16 +00:00
Peter Collingbourne
95137e4939 COFF: PDB: Allow multiple modules with the same name.
It is possible for two modules to have the same name if they are
archive members with the same name, or if we are doing LTO (in which
case all modules will have the name "lto.tmp").

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312744 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 20:39:46 +00:00
Keith Wyss
013a4d7319 [XRay][tools] Function call stack based analysis tooling for XRay traces
Second try after fixing a code san problem with iterator reference types.

This change introduces a subcommand to the llvm-xray tool called
"stacks" which allows for analysing XRay traces provided as inputs and
accounting time to stacks instead of just individual functions. This
gives us a more precise view of where in a program the latency is
actually attributed.

The tool uses a trie data structure to keep track of the caller-callee
relationships as we process the XRay traces. In particular, we keep
track of the function call stack as we enter functions. While we're
doing this we're adding nodes in a trie and indicating a "calls"
relatinship between the caller (current top of the stack) and the callee
(the new top of the stack). When we push function ids onto the stack, we
keep track of the timestamp (TSC) for the enter event.

When exiting functions, we are able to account the duration by getting
the difference between the timestamp of the exit event and the
corresponding entry event in the stack. This works even if we somehow
miss the exit events for intermediary functions (i.e. if the exit event
is not cleanly associated with the enter event at the top of the stack).

The output of the tool currently provides just the top N leaf functions
that contribute the most latency, and the top N stacks that have the
most frequency. In the future we can provide more sophisticated query
mechanisms and potentially an export to database feature to make offline
analysis of the stack traces possible with existing tools.

Differential revision: D34863

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312733 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 18:07:48 +00:00
Benjamin Kramer
be4da532a6 Fixing incorrectly capitalised regexps.
Patch by Sam Allen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312709 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-07 09:54:03 +00:00
Petr Hosek
c97f51f04b Reland "[llvm-objcopy] Add support for relocations"
This change adds support for SHT_REL and SHT_RELA sections in
llvm-objcopy.

Patch by Jake Ehrlich

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312680 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06 23:41:02 +00:00
Petr Hosek
891fa9ed20 Revert "[llvm-objcopy] Add support for relocations"
This reverts r312643 because it's failing on llvm-i686-linux-RA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312645 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06 16:23:15 +00:00
Petr Hosek
5ab1ebb761 [llvm-objcopy] Add support for relocations
This change adds support for SHT_REL and SHT_RELA sections in
llvm-objcopy.

Patch by Jake Ehrlich

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312643 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06 16:19:48 +00:00
Rafael Espindola
aee6db7db7 Use the section name if a STT_SECTION symbol has empty name.
Without this we would have multiple relocations pointing to symbols
with the same name: the empty string. There was no way for yaml2obj to
be able to handle that.

A more general solution would be to unique symbol names in a similar
way to how we unique section names.  In practice I think this covers
all common cases and is a bit more user friendly than using names like
sym1, sym2, sym3, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312603 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06 00:57:53 +00:00
Rafael Espindola
3656c75e61 Fix a use after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312590 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05 23:00:51 +00:00
Rafael Espindola
ef318e5ebe obj2yaml: Print unique section names.
Without this patch passing a .o file with multiple sections with the
same name to obj2yaml produces a yaml file that yaml2obj cannot
handle. This is pr34162.

The problem is that when specifying, for example, the section of a
symbol, we get only

Section: foo

and don't know which of the sections whose name is foo we have to use.

One alternative would be to use section numbers. This would work, but
the output from obj2yaml would be very inconvenient to edit as
deleting a section would invalidate all indexes.

Another alternative would be to invent a unique section id that would
exist only on yaml. This would work, but seems a bit heavy handed. We
could make the id optional and default it to the section name.

Since in the last alternative the id is basically what this patch uses
as a name, it can be implemented as a followup patch if needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312585 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05 22:30:00 +00:00
Peter Collingbourne
a3886c11ee LTO: Try to open cache files before renaming them.
It appears that a potential race between the cache client and the cache
pruner that I thought was unlikely actually happened in practice [1].
Try to avoid the race condition by opening the temporary file before
renaming it. Do this only on non-Windows platforms because we cannot
rename open files on Windows using the sys::fs::rename function.

[1] https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.memory%2FLinux_CFI%2F1610%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312567 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05 19:51:38 +00:00
Lang Hames
30e9aa60fe [ORC] Refactor OrcRemoteTarget code to expose its RPC API, reduce
code duplication in the client, and improve error propagation.

This patch moves the OrcRemoteTarget rpc::Function declarations from
OrcRemoteTargetRPCAPI into their own namespaces under llvm::orc::remote so that
they can be used in new contexts (in particular, a remote-object-file adapter
layer that I will commit shortly).

Code duplication in OrcRemoteTargetClient (especially in loops processing the
code, rw-data and ro-data allocations) is removed by moving the loop bodies
into their own functions.

Error propagation is (slightly) improved by adding an ErrorReporter functor to
the OrcRemoteTargetClient -- Errors that can't be returned (because they occur
in destructors, or behind stable APIs that don't provide error returns) can be
sent to the ErrorReporter instead. Some methods in the Client API are also
changed to make better use of the Expected class: returning Expected<T>s rather
than returning Errors and taking T&s to store the results.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312500 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-04 20:54:46 +00:00
Keith Wyss
0ef1731fbc Revert "[XRay][tools] Function call stack based analysis tooling for XRay traces"
This reverts commit 204a65e0702847a1880336372ad7abd1df414b44.

Double ref qualifier failed bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312428 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-03 00:40:13 +00:00
Keith Wyss
b01acdaefa [XRay][tools] Function call stack based analysis tooling for XRay traces
This change introduces a subcommand to the llvm-xray tool called
"stacks" which allows for analysing XRay traces provided as inputs and
accounting time to stacks instead of just individual functions. This
gives us a more precise view of where in a program the latency is
actually attributed.

The tool uses a trie data structure to keep track of the caller-callee
relationships as we process the XRay traces. In particular, we keep
track of the function call stack as we enter functions. While we're
doing this we're adding nodes in a trie and indicating a "calls"
relatinship between the caller (current top of the stack) and the callee
(the new top of the stack). When we push function ids onto the stack, we
keep track of the timestamp (TSC) for the enter event.

When exiting functions, we are able to account the duration by getting
the difference between the timestamp of the exit event and the
corresponding entry event in the stack. This works even if we somehow
miss the exit events for intermediary functions (i.e. if the exit event
is not cleanly associated with the enter event at the top of the stack).

The output of the tool currently provides just the top N leaf functions
that contribute the most latency, and the top N stacks that have the
most frequency. In the future we can provide more sophisticated query
mechanisms and potentially an export to database feature to make offline
analysis of the stack traces possible with existing tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-03 00:03:47 +00:00
Justin Bogner
16edf9bff8 Move some CLI utils out of llvm-isel-fuzzer and into the library
FuzzMutate might not be the best place for these, but it makes more
sense than an entirely new library for now. This will make setting up
fuzz targets with consistent CLI handling easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-02 23:43:04 +00:00
Alexander Shaposhnikov
dce71c7425 [llvm-dwp] Implement -e option
The binutils utility dwp has an option "-e" 
https://gcc.gnu.org/wiki/DebugFissionDWP
to specify an executable/library to get the list 
of *.dwo files from it. This option is particularly useful when 
someone runs the tool manually outside of a build system.
This diff adds an implementation of "-e" to llvm-dwp.

Test plan: make check-all

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-02 08:19:01 +00:00
Zachary Turner
5263738d53 [llvm-pdbutil] Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312395 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-02 00:09:43 +00:00
Zachary Turner
8fcc9de47e Fix broken test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312359 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-01 20:17:20 +00:00
Zachary Turner
6ef51e8f14 [llvm-pdbutil] Support dumping CodeView from object files.
We have llvm-readobj for dumping CodeView from object files, and
llvm-pdbutil has always been more focused on PDB.  However,
llvm-pdbutil has a lot of useful options for summarizing debug
information in aggregate and presenting high level statistical
views.  Furthermore, it's arguably better as a testing tool since
we don't have to write tests to conform to a state-machine like
structure where you match multiple lines in succession, each
depending on a previous match.  llvm-pdbutil dumps much more
concisely, so it's possible to use single-line matches in many
cases where as with readobj tests you have to use multi-line
matches with an implicit state machine.

Because of this, I'm adding object file support to llvm-pdbutil.
In fact, this mirrors the cvdump tool from Microsoft, which also
supports both object files and pdb files.  In the future we could
perhaps rename this tool llvm-cvutil.

In the meantime, this allows us to deep dive into object files
the same way we already can with PDB files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312358 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-01 20:06:56 +00:00
Justin Bogner
f2de8c1c55 llvm-isel-fuzzer: Weak function invoke the ire of PE/COFF
It's non-trivial to use weak symbols in a cross platform way (See
sanitizer_win_defs.h in compiler-rt), and doing it naively like we
have here causes some build failures:

  http://lab.llvm.org:8011/builders/clang-with-thin-lto-windows/builds/1260

Instead of going down the rabbit hole of emulating weak symbols for
this very trivial dummy fuzzer driver, we can just rely on the fact
that we know which hooks any given fuzz target implements and forward
declare a normal symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312354 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-01 19:37:49 +00:00
Justin Bogner
c58d273d61 llvm-isel-fuzzer: Add link-time dependency on BitWriter
This should fix the undefined reference to WriteBitcodeToFile here:
http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/31682

(Why does every different bot seem to have a different level of
finickiness about LLVM_LINK_COMPONENTS?)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312345 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-01 17:49:54 +00:00