Commit Graph

6439 Commits

Author SHA1 Message Date
Kevin Enderby f681ec5db1 Fix MachOObjectFile::getSymbolName() to not call report_fatal_error()
but to return object_error::parse_failed.  Then made the code in llvm-nm
do for Mach-O files what is done in the darwin native tools which is to
print "bad string index" for bad string indexes.  Updated the error message
in the llvm-objdump test, and added tests to show llvm-nm prints
"bad string index" and a test to print the actual bad string index value
which in this case is 0xfe000002 when printing the fields as raw hex.

llvm-svn: 258520
2016-01-22 18:47:14 +00:00
Kevin Enderby 1f472eace5 Fix MachOObjectFile::getSymbolSection() to not call report_fatal_error()
but to return object_error::parse_failed.  Then made the code in llvm-nm
do for Mach-O files what is done in the darwin native tools which is to
print "(?,?)" or just "s" for bad section indexes.  Also added a test to show
it prints the bad section index of "42" when printing the fields as raw hex.

llvm-svn: 258434
2016-01-21 21:13:27 +00:00
Teresa Johnson e0373a6796 Revert obsolete llvm-link -preserve-modules option/test
This testing mode is now obsolete with the change to linkInModule
to take a std::unique_ptr to Module.

llvm-svn: 258399
2016-01-21 14:28:52 +00:00
Andrew Wilkins 7ab4dc76c4 llvm-go: call llvm-config with components
Summary:
Add components back into calls to llvm-config,
which was accidentally removed in r258283.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 258383
2016-01-21 02:33:39 +00:00
Reid Kleckner 400f39308c [readobj] Print CodeOffset first, it's easier to read
llvm-svn: 258368
2016-01-20 23:21:14 +00:00
Quentin Colombet 105cf2b179 [GlobalISel] Add the proper cmake plumbing.
This patch adds the necessary plumbing to cmake to build the sources related to
GlobalISel.

To build the sources related to GlobalISel, we need to add -DBUILD_GLOBAL_ISEL=ON.
By default, this is OFF, thus GlobalISel sources will not impact people that do
not explicitly opt-in.

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

llvm-svn: 258344
2016-01-20 20:58:56 +00:00
Simon Atanasyan 2d0d8530e3 [llvm-readobj][ELF] Teach llvm-readobj to show arch specific ELF section's flags
Some architecture specific ELF section flags might have the same value
(for example SHF_X86_64_LARGE and SHF_HEX_GPREL) and we have to check
machine architectures to select an appropriate set of possible flags.

The patch selects architecture specific flags into separate arrays
`ElfxxxSectionFlags` and combines `ElfSectionFlags` and `ElfxxxSectionFlags`
before pass to the `StreamWriter::printFlags()` method.

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

llvm-svn: 258334
2016-01-20 19:15:18 +00:00
Petr Pavlu eba3039238 [LTO] Fix error reporting when a file passed to libLTO is invalid or non-existent
This addresses PR26060 where function lto_module_create() could return nullptr
but lto_get_error_message() returned an empty string.

The error() call after LTOModule::createFromFile() in llvm-lto is then removed
because any error from this function should go through the diagnostic handler in
llvm-lto which will exit the program. The error() call was added because this
previously did not happen when the file was non-existent. This is fixed by the
patch. (The situation that llvm-lto reports an error when the input file does
not exist is tested by llvm/tools/llvm-lto/error.ll).

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

llvm-svn: 258298
2016-01-20 09:03:42 +00:00
Andrew Wilkins dfd6088c3f tools/llvm-config: improve shared library support
Summary:

This is a re-commit of r257003, which was reverted,
along with the fixes from http://reviews.llvm.org/D15986.

r252532 added support for reporting the monolithic library
when LLVM_BUILD_LLVM_DYLIB is used. This would only be done
if the individual components were not found, and the dynamic
library is found.

This diff extends this as follows:
 - If LLVM_LINK_LLVM_DYLIB is set, then prefer the shared
   library, even if all component libraries exist.
 - Two flags, --link-shared and --link-static are introduced
   to provide explicit guidance. If --link-shared is passed
   and the shared library does not exist, an error results.

Additionally, changed the expected shared library names from
(e.g.) LLVM-3.8.0 to LLVM-3.8. The former exists only in an
installation (and then only in CMake builds I think?), and not
in the build tree; this breaks usage of llvm-config during
builds, e.g. by llvm-go.

Reviewers: DiamondLovesYou, beanz

Subscribers: llvm-commits

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

llvm-svn: 258283
2016-01-20 04:03:09 +00:00
Tobias Edler von Koch 3f4f6f3ed6 Add a change accidentally left out from r258100
Also remove an executable bit introduced by r258083.

llvm-svn: 258101
2016-01-18 23:35:24 +00:00
Sergei Larin d19d4d30d8 Add to the split module utility an SCC based method which allows not to globalize any local variables.
Summary:
    Currently llvm::SplitModule as the first step globalizes all local objects, which might not be desirable in some scenarios.
    This change adds a new flag to llvm::SplitModule that uses SCC approach to search for a balanced partition without the need to externalize symbols.
    Such partition might not be possible or fully balanced for a given number of partitions, and is a function of the module properties (global/local dependencies within the module).
    
    Joint development Tobias Edler von Koch (tobias@codeaurora.org) and Sergei Larin (slarin@codeaurora.org)
    
    Subscribers: llvm-commits, joker.eph
    
    Differential Revision: http://reviews.llvm.org/D16124

llvm-svn: 258083
2016-01-18 21:07:13 +00:00
Rafael Espindola a79078c3ce Use new function name. NFC.
llvm-svn: 258079
2016-01-18 20:55:24 +00:00
Simon Atanasyan e03126aea4 [llvm-readobj][ELF] s/dyn_rela_/dyn_rel_/ No functional changes.
Follow up to r258001. These template functions might return both REL and RELA
relocations. The 'rel' noun looks less ambiguous.

llvm-svn: 258060
2016-01-18 18:52:04 +00:00
Lang Hames 4ce7cc0f4c Remove some stale comments and fix a typo as suggested by David Blaikie in his
review of r257343.

Thanks Dave!

llvm-svn: 258002
2016-01-17 01:49:46 +00:00
Simon Atanasyan 72155c33b1 [llvm-readobj][ELF] Teach llvm-readobj to show dynamic relocation in REL format
MIPS 32-bit ABI uses REL relocation record format to save dynamic
relocations. The patch teaches llvm-readobj to show dynamic relocations
in this format.

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

llvm-svn: 258001
2016-01-16 22:40:09 +00:00
Manuel Jacob 5f6eaac611 GlobalValue: use getValueType() instead of getType()->getPointerElementType().
Reviewers: mjacob

Subscribers: jholewinski, arsenm, dsanders, dblaikie

Patch by Eduard Burtescu.

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

llvm-svn: 257999
2016-01-16 20:30:46 +00:00
George Rimar e05fcecd36 Fixed CRLF->LF line endings from r257914. NFC.
llvm-svn: 257990
2016-01-16 10:38:32 +00:00
Davide Italiano 8c50367276 [llvm-readobj] Dump DT_RELACOUNT correctly.
llvm-svn: 257988
2016-01-16 06:06:36 +00:00
Xinliang David Li 6ed987dffe [PGO] fix a bug in profile summary computation
Entry block count was not counted and is corrected. Also
introduce a new metric that is MaxInternalBlockCount which
show command shows (as before).

llvm-svn: 257987
2016-01-16 05:29:49 +00:00
George Rimar 47936761b8 Revert of 57967
Initial commit message:
CRLF -> LF. NFC

llvm-svn: 257973
2016-01-16 00:49:19 +00:00
Peter Collingbourne f0f5e87083 Introduce sanstats tool and llvm::CreateSanitizerStatReport function.
This is part of a new statistics gathering feature for the sanitizers.
See clang/docs/SanitizerStats.rst for further info and docs.

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

llvm-svn: 257970
2016-01-16 00:31:11 +00:00
George Rimar e055ea67a4 CRLF -> LF. NFC
llvm-svn: 257967
2016-01-16 00:14:21 +00:00
Reid Kleckner af49ecb286 [codeview] Handle multiple frame descriptions in readobj
llvm-svn: 257943
2016-01-15 22:09:13 +00:00
Lang Hames 22c5af782a [Orc] Make FDRPCChannel final.
This class is in the LLI tool, and isn't subclassed.

llvm-svn: 257937
2016-01-15 21:35:24 +00:00
Rafael Espindola 257a35368f Bring back "Assert that we have all use/users in the getters."
This reverts commit r257751, bringing back r256105.

The problem the assert found was fixed in r257915.

Original commit message:

Assert that we have all use/users in the getters.

An error that is pretty easy to make is to use the lazy bitcode reader
and then do something like

if (V.use_empty())

The problem is that uses in unmaterialized functions are not accounted
for.

This patch adds asserts that all uses are known.

llvm-svn: 257920
2016-01-15 19:00:20 +00:00
Reid Kleckner 47f2452da8 # This is a combination of 2 commits.
# The first commit's message is:

Revert "[ARM] Add DSP build attribute and extension targeting"

This reverts commit b11cc50c0b4a7c8cdb628abc50b7dc226ff583dc.

# This is the 2nd commit message:

Revert "[ARM] Add new system registers to ARMv8-M Baseline/Mainline"

This reverts commit 837d08454e3e5beb8581951ac26b22fa07df3cd5.

llvm-svn: 257916
2016-01-15 18:31:29 +00:00
George Rimar 06a9b6f5d1 Recommit r257912
Added forgotten ELFDumper.cpp to commit.

Initial commit message:
[llvm-readobj] Add support for TLSDESC_PLT and TLSDESC_GOT dynamic section tags to the llvm-readobj.

If module uses uses lazy TLSDESC relocations it should define DT_TLSDESC_PLT and DT_TLSDESC_GOT entries.
They were unknown for llvm-readobj before this patch.

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

llvm-svn: 257914
2016-01-15 18:21:34 +00:00
Reid Kleckner c31f530cb7 [codeview] Dump the file checksum substream
llvm-svn: 257910
2016-01-15 18:06:25 +00:00
Bradley Smith 48b93e1f21 [ARM] Add DSP build attribute and extension targeting
llvm-svn: 257885
2016-01-15 10:28:25 +00:00
NAKAMURA Takumi cef0a821fa lli: use llvm::utostr() instead of std::to_string().
llvm-svn: 257857
2016-01-15 02:14:46 +00:00
Reid Kleckner 8e7275cc73 [codeview] Translate file table offsets to filenames and print them
llvm-svn: 257846
2016-01-15 00:11:21 +00:00
Mike Aizatsky d0281d875c [sancov] html report
Differential Revision: http://reviews.llvm.org/D16161

llvm-svn: 257824
2016-01-14 22:34:11 +00:00
Xinliang David Li 565b301380 [PGO] Move profile summary interface/impl into InstrProf.[*] /NFC
llvm-svn: 257819
2016-01-14 22:10:49 +00:00
Lang Hames 52c4724165 [Orc] Add support for EH-frame registration to the Orc Remote Target utility
classes.

OrcRemoteTargetClient::RCMemoryManager will now register EH frames with the
server automatically. This allows remote-execution of code that uses exceptions.

llvm-svn: 257816
2016-01-14 22:02:03 +00:00
Reid Kleckner 43842b554c [codeview] Dump function callees and add more labels to inlinee info
I kept forgetting which number is the line delta and which is the code
delta.

llvm-svn: 257813
2016-01-14 21:50:05 +00:00
Rui Ueyama da00f2fdf4 Update to use new name alignTo().
llvm-svn: 257804
2016-01-14 21:06:47 +00:00
Reid Kleckner e9ab3498f3 [codeview] Dump CodeView inlinee lines subsection
llvm-svn: 257790
2016-01-14 19:20:17 +00:00
Adrian Prantl a9e2383528 dsymutil: Provide better warnings when clang modules cannot be found.
rdar://problem/22823264

llvm-svn: 257784
2016-01-14 18:31:07 +00:00
Reid Kleckner 1d9970a5a9 Use std::map::insert instead of emplace for libstdc++ 4.7
llvm-svn: 257780
2016-01-14 18:03:29 +00:00
Reid Kleckner 089db21f58 Print function names when they are referenced via TypeIndex
llvm-svn: 257778
2016-01-14 17:52:01 +00:00
Reid Kleckner 1c7a9cdc69 [readobj] Add functionality to dump relocations inside of binary blobs
llvm-svn: 257777
2016-01-14 17:51:57 +00:00
Reid Kleckner 2893fd18af [codeview] Print relocations against code and data offset fields
These fields are almost always zero. However, there are relocations
against them, and we should print the relocation symbol with it as
SYM+0xNN.

llvm-svn: 257776
2016-01-14 17:51:54 +00:00
Michael Zolotukhin 65c0120193 Revert "Assert that we have all use/users in the getters."
This reverts commit fdb838f3f8a8b6896bbbd5285555874eb3b748eb.

llvm-svn: 257751
2016-01-14 09:02:45 +00:00
David Majnemer e21e90933c [CodeView] Add support for dumping binary annotations
Binary annotations are encoded along the lines of UTF-8 and ECI but with
a few minor differences.

The algorithm specified in "ECMA-335 CLI Section II.3.2 - Blobs and
Signatures" is used to compress binary annotations.  Signed binary
annotations are encoded like unsigned annotations except the sign bit is
rotated left to reduce the number of bits needed to be encoded.

llvm-svn: 257742
2016-01-14 06:12:30 +00:00
NAKAMURA Takumi 1985875d61 llvm-profdata.cpp: Fix comment lines. [-Wdocumentation]
llvm-svn: 257726
2016-01-14 00:36:59 +00:00
Reid Kleckner 6b3faefff9 [codeview] Share more enums across the writer and the dumper
Moves some .def files into include/DebugInfo/CodeView.

Aslo remove a 'using namespace' directive from a header in readobj and
update the uses of the endian helper types to compensate.

llvm-svn: 257712
2016-01-13 23:44:57 +00:00
Easwaran Raman 183ebbe0ee Display detailed profile summary in llvm-profdata tool.
This adds a detailed profile summary in llvm-profdata. The summary is in the
form of one or more triples of the form (P, N, M) which is interpreted as if
we look at the Top-N counts in the profile, their sum accounts for P percentage
of the sum of all counts in the program and the minimum count in the Top-N is M.

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

llvm-svn: 257680
2016-01-13 21:44:36 +00:00
Adrian Prantl 307bd21f49 dsymutil: Only warn about missing clang modules once.
rdar://problem/22269336

llvm-svn: 257664
2016-01-13 20:26:00 +00:00
Reid Kleckner 72e2ba7abb [readobj] Expand CodeView dumping functionality
This rewrites and expands the existing codeview dumping functionality in
llvm-readobj using techniques similar to those in lib/Object. This defines a
number of new records and enums useful for reading memory mapped codeview
sections in COFF objects.

The dumper is intended as a testing tool for LLVM as it grows more codeview
output capabilities.

Reviewers: majnemer

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

llvm-svn: 257658
2016-01-13 19:32:35 +00:00
Davide Italiano 25d84580f4 [llvm-readobj] Remove dead code. Add an assertion instead.
When we arrive at the end of the function, the validation of
the object has been done already. In theory, so, we should never
arrive here with something broken as the object isn't mutated.
Practice sometimes proves theory to be wrong, so leave an assertion
instead, as suggested by David Blaikie, to catch bugs.

llvm-svn: 257570
2016-01-13 04:11:36 +00:00