Commit Graph

6456 Commits

Author SHA1 Message Date
Andrew Wilkins
a04a818402 Revert r257003
This revision breaks llvm-config if you set
BUILD_SHARED_LIBS=on in a CMake build. Backing
out until the fix is ready to land.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 07:23:58 +00:00
NAKAMURA Takumi
4ca55c12e7 lli: Fix warnings. [-Wsign-compare]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 01:23:30 +00:00
NAKAMURA Takumi
bf913ed665 lli-child-target: Introduce a new dependency on RuntimeDyld.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 23:12:30 +00:00
Rafael Espindola
102130d17c Add a missing error handling to llvm-lto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257395 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 22:08:22 +00:00
Lang Hames
7ab54fc926 XFAIL the LLI remote JIT tests on Win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 21:41:34 +00:00
Lang Hames
373208cd3f lli/ChildTarget now depends on OrcJIT. Add that component to the Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 17:44:07 +00:00
Lang Hames
d9ff2aaafd [LLI] Remove dependence on RemoteTarget.cpp from ChildTarget's Makefile.
RemoteTarget.cpp was removed in r257343.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 17:00:31 +00:00
Lang Hames
b20e09ca99 [LLI] Replace the LLI remote-JIT support with the new ORC remote-JIT components.
The new ORC remote-JITing support provides a superset of the old code's
functionality, so we can replace the old stuff. As a bonus, a couple of
previously XFAILed tests have started passing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257343 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 16:35:55 +00:00
Lang Hames
bba386e4fe [Orc] Rename OrcTargetSupport to OrcArchitectureSupport to avoid confusion with
the upcoming remote-target support classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257302 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 00:56:15 +00:00
Lang Hames
d8eb9f704c [Orc] Enable user-supplied memory managers in the CompileOnDemand layer.
Previously the CompileOnDemand layer was hard-coded to use a new
SectionMemoryManager for each function when it was called.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-09 20:55:18 +00:00
Mike Aizatsky
d9750d38e1 [llvm-symbolizer] -print-source-context-lines option to print source code around the line.
Differential Revision: http://reviews.llvm.org/D15909

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-09 00:14:35 +00:00
Mike Aizatsky
ba07fc7f19 [llvm-symbolizer] Print out non-address lines verbatim.
Differential Revision: http://reviews.llvm.org/D15876

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-07 23:57:41 +00:00
Andrew Wilkins
ecd5a90fab tools/llvm-config: improve shared library support
Summary:
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/D15033

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-07 00:18:56 +00:00
Davide Italiano
ec0fb28be3 [llvm-objdump] Mark noreturn function as such.
Match attribute in the header to make MSVC happy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256560 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 13:41:02 +00:00
Davide Italiano
8e798f8001 [llvm-objdump] Use stderr and not stdout for fatal errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256423 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-25 18:16:45 +00:00
Adrian Prantl
8eb4aa5936 llvm-dwarfdump: Add support for dumping .dSYM bundles.
This replicates the logic of Darwin dwarfdump for manually opening up
.dSYM bundles without introducing any new dependencies.
<rdar://problem/20491670>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-23 21:51:13 +00:00
Davide Italiano
b98f7adcfd [llvm-readobj] Use stderr and not stdout for error messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256347 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-23 19:29:34 +00:00
Rafael Espindola
80506186e9 Disable use list order on the gold plugin.
It turns out that his is *really* slow. With this change the link of
clang with plugin-opt=emit-llvm goes from 41 to 26 seconds.

We can add an option to enable it again if needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22 23:45:49 +00:00
David Majnemer
56afa6e660 [MC, COFF] Support link /incremental conditionally
Today, we always take into account the possibility that object files
produced by MC may be consumed by an incremental linker.  This results
in us initialing fields which vary with time (TimeDateStamp) which harms
hermetic builds (e.g. verifying a self-host went well) and produces
sub-optimal code because we cannot assume anything about the relative
position of functions within a section (call sites can get redirected
through incremental linker thunks).

Let's provide an MCTargetOption which controls this behavior so that we
can disable this functionality if we know a-priori that the build will
not rely on /incremental.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-21 22:09:27 +00:00
Davide Italiano
005b231d45 [llvm-objdump] Use appropriate helper. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256156 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-21 14:10:54 +00:00
Davide Italiano
abe8418ff7 [llvm-objdump] Move COFF function to where it belongs.
Ideally much more stuff should be moved out of llvm-objdump.cpp, but that
will happen later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256118 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-20 09:54:34 +00:00
Xinliang David Li
cfbaf11a0d [PGO] Improve Indexed Profile Reader efficiency
With the support of value profiling added, the Indexed prof
reader gets less efficient. The prof reader initialization
used to be just reading the file header, but with VP support
added, initialization needs to walk through all profile keys
of ondisk hash table resulting in very poor locality and large
memory increase (keys are stored together with the profile data
in the mapped profile buffer). Even worse, when the reader is 
used by the compiler (not llvm-profdata too), the penalty becomes
very high as compilation of each single module requires touching
profile data buffer for the whole program. 

In this patch, the icall target values (MD5hash) are no longer eargerly 
converted back to name strings when the data is read into memory. New
interface is added to to profile reader so that InstrProfSymtab can be
lazily created for Indexed profile reader on-demand. Creating of the 
symtab is intended to be used by llvm-profdata tool for symbolic dumping
of  VP data. It can be used with compiler (for legacy out of tree uses)
too but not recommended due to compile time and memory reasons 
mentioned above.

Some other cleanups are also included: Function Addr to md5 map is now
consolated into InstrProfSymtab. InstrProfStringtab is no longer used and
eliminated.







git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256114 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-20 06:22:13 +00:00
Davide Italiano
f2adc7995e [llvm-objdump] Fail early if we can't parse the object header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256108 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-19 22:09:40 +00:00
Rafael Espindola
fdb838f3f8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256105 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-19 20:03:23 +00:00
Rafael Espindola
8d184ad258 Deprecate a few C APIs.
This deprecates:
* LLVMParseBitcode
* LLVMParseBitcodeInContext
* LLVMGetBitcodeModuleInContext
* LLVMGetBitcodeModule

They are replaced with the functions with a 2 suffix which do not record
a diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256065 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 23:46:42 +00:00
Rafael Espindola
ecd3b686c1 Delete dead code: only functions are materializable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256052 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 22:44:07 +00:00
Rafael Espindola
3bca2f2bf5 Use a lambda to reduce code duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256050 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 22:40:27 +00:00
Alexey Samsonov
a2d9f5fdfe [sancov] IWYU fix: add proper header inclusion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256040 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 22:02:08 +00:00
Rafael Espindola
838f8a4b1d Drop materializeAllPermanently.
This inlines materializeAll into the only caller
(materializeAllPermanently) and renames materializeAllPermanently to
just materializeAll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256024 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 20:13:39 +00:00
Pete Cooper
11fd7a2269 Revert "Improve DWARFDebugFrame::parse to also handle __eh_frame."
This reverts commit r256008.

Its breaking multiple buildbots, although works for me locally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256013 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 19:45:38 +00:00
Pete Cooper
3c9c3bf291 Improve DWARFDebugFrame::parse to also handle __eh_frame.
LLVM MC has single methods which can handle the output of EH frame and DWARF CIE's and FDE's.

This code improves DWARFDebugFrame::parse to do the same for parsing.

This also allows llvm-objdump to support the --dwarf=frames option which objdump supports.  This
option dumps the .eh_frame section using the new code in DWARFDebugFrame::parse.

http://reviews.llvm.org/D15535

Reviewed by Rafael Espindola.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256008 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 18:51:08 +00:00
Rafael Espindola
0b270d1d74 Add a test for LLVMGetBitcodeModule.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255985 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 03:57:26 +00:00
Eric Christopher
cca8dbee4e Reorganize the C API headers to improve build times.
Type specific declarations have been moved to Type.h and error handling
routines have been moved to ErrorHandling.h. Both are included in Core.h
so nothing should change for projects directly including the headers,
but transitive dependencies may be affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255965 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 01:46:52 +00:00
Teresa Johnson
d0f8afa9b6 [ThinLTO] Metadata linking for imported functions
Summary:
Second patch split out from http://reviews.llvm.org/D14752.

Maps metadata as a post-pass from each module when importing complete,
suturing up final metadata to the temporary metadata left on the
imported instructions.

This entails saving the mapping from bitcode value id to temporary
metadata in the importing pass, and from bitcode value id to final
metadata during the metadata linking postpass.

Depends on D14825.

Reviewers: dexonsmith, joker.eph

Subscribers: davidxl, llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-17 17:14:09 +00:00
Davide Italiano
4151f0d8f9 [llvm-objdump] Use report_fatal_error() for a more uniform error handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255871 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-17 01:59:50 +00:00
Rafael Espindola
d912be98f8 Change linkInModule to take a std::unique_ptr.
Passing in a std::unique_ptr should help find errors when the module
is used after being linked into another module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255842 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 23:16:33 +00:00
Nathan Slingerland
fd56824d39 [PGO] Handle and report overflow during profile merge for all types of data
Summary: Surface counter overflow when merging profile data. Merging still occurs on overflow but counts saturate to the maximum representable value. Overflow is reported to the user.

Reviewers: davidxl, dnovillo, silvas

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255825 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 21:45:43 +00:00
Teresa Johnson
5af13d7042 Use LLVM style variable name (NFC)
Fixes variable name from r255779.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 21:37:48 +00:00
Chris Bieneman
536f97b8b4 [CMake] Adding llvm-profdata to the list of tools clang needs.
Bootstrapping clang to generate PGO data (patches coming soon), requires llvm-profdata targets to be generated before clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255794 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 18:30:36 +00:00
Reid Kleckner
c81f0007ce Reland "[llvm-readobj] Simplify usage of -codeview flag"
Relands r255790 with fixed tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255793 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 18:28:12 +00:00
Reid Kleckner
3a06c2dfa3 Revert "[llvm-readobj] Simplify usage of -codeview flag"
This reverts commit r255790.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255791 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 18:19:34 +00:00
Reid Kleckner
377b54ca02 [llvm-readobj] Simplify usage of -codeview flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255790 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 18:18:39 +00:00
Teresa Johnson
2c50df6608 Add RAII wrapper for gold plugin file management
Suggested in review of r255256.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255779 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 16:34:06 +00:00
Mike Aizatsky
bca907f5fb [sancov] blacklist support.
Summary:
Using the blacklist the user can filter own unwanted functions
from all outputs. By default blacklist contains "fun:__sancov*" line.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255732 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 00:31:48 +00:00
Davide Italiano
b1f9389d5b [llvm-objdump/MachODump] Shrink code a little bit. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255701 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 23:14:21 +00:00
Nathan Slingerland
824c3eccff [llvm-profdata] Add support for weighted merge of profile data (2nd try)
Summary:
This change adds support for specifying a weight when merging profile data with the llvm-profdata tool.
Weights are specified by using the --weighted-input=<weight>,<filename> option. Input files not specified
with this option (normal positional list after options) are given a default weight of 1.

Adding support for arbitrary weighting of input profile data allows for relative importance to be placed on the
input data from multiple training runs.

Both sampled and instrumented profiles are supported.

Reviewers: davidxl, dnovillo, bogner, silvas

Subscribers: silvas, davidxl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255659 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 17:37:09 +00:00
Craig Topper
240b0e16f6 Use CmpInst::Predicate instead of 'unsigned short' in some places. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255623 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 06:11:33 +00:00
Reid Kleckner
f2829c933c [llvm-readobj] s/FunctionName/LinkageName/ for codeview dumping
The symbol being printed in this field comes from the main symbol table,
not 0xF1 subsection. Use LinkageName to make that a lot clearer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255596 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 01:23:55 +00:00
Mike Aizatsky
efbe9367db sancov: coverage can be reported by multiple functions.
Differential Revision: http://reviews.llvm.org/D15430

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255582 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 23:55:04 +00:00
Rafael Espindola
7a1fc2d33e Use diagnostic handler in the LLVMContext
This patch converts code that has access to a LLVMContext to not take a
diagnostic handler.

This has a few advantages

* It is easier to use a consistent diagnostic handler in a single program.
* Less clutter since we are not passing a handler around.

It does make it a bit awkward to implement some C APIs that return a
diagnostic string. I will propose new versions of these APIs and
deprecate the current ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 23:17:03 +00:00