Commit Graph

245471 Commits

Author SHA1 Message Date
Kostya Serebryany 3364f90783 [libFuzzer] simplify the code for use_cmp, also use the position hint when available, add a test
llvm-svn: 285049
2016-10-25 02:04:43 +00:00
Peter Collingbourne 7695cb6da8 GlobalDCE: Deduplicate code. NFCI.
llvm-svn: 285048
2016-10-25 01:58:26 +00:00
Mehdi Amini 9825ab0433 Fix handling of %% format specifier in os_log builtins.
Returning `false` was stopping the parsing of further arguments,
which wasn't intended.

llvm-svn: 285047
2016-10-25 00:48:48 +00:00
Sanjay Patel 02be063351 [InstCombine] auto-generate checks
llvm-svn: 285046
2016-10-25 00:44:02 +00:00
Sanjay Patel 5cff621dce [InstCombine] auto-generate checks
llvm-svn: 285045
2016-10-25 00:41:00 +00:00
Dan Gohman 48abaa9c74 [WebAssembly] Reorder load/store operands to match binary encoding.
The p2align operand of a load/store is encoded before the offset
operand; reorder the MachineInstr operands accordingly.

llvm-svn: 285044
2016-10-25 00:17:11 +00:00
Vedant Kumar 5c61c70387 [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.

llvm-svn: 285043
2016-10-25 00:08:33 +00:00
Mehdi Amini 566a51d193 Add dependency from clangCodeGen to clangAnalysis
This is unbreaking the build with shared library after r285019.

llvm-svn: 285042
2016-10-24 23:38:32 +00:00
Mehdi Amini ebff247d41 test/CodeGen/builtins.c: reinstate #ifdef __x86_64__ around __builtin_longjmp
Unadvertently removed in r285019

llvm-svn: 285041
2016-10-24 23:38:24 +00:00
Dan Gohman 3acb187d95 [WebAssembly] Implement more WebAssembly binary encoding.
This changes locals from being declared by the emitLocal hook in
WebAssemblyTargetStreamer, rather than with an instruction. After exploring
the infastructure in LLVM more, this seems to make more sense since
declaring locals doesn't use an encoded opcode.

This also adds more 0xd opcodes, type encodings, and miscellaneous
binary encoding bits.

llvm-svn: 285040
2016-10-24 23:27:49 +00:00
Matthias Braun 8b38ffaa98 CodeGen/Passes: Pass MachineFunction as functor arg; NFC
Passing a MachineFunction as argument is more natural and avoids an
unnecessary round-trip through the logic determining the correct
Subtarget because MachineFunction already has a reference anyway.

llvm-svn: 285039
2016-10-24 23:23:02 +00:00
Petr Hosek 9834fcd7ce [Basic] Support 32-bit x86 and ARM targets for Fuchsia
Fuchsia has experimental support for 32-bit x86 and ARM targets, add
them to the list of supported targets.

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

llvm-svn: 285038
2016-10-24 22:55:57 +00:00
Artem Belevich 3d0b39a3dd Link clangCodeGen with clangAnalysis required after r284990.
Fixes build break for configurations that use shared libraries.

llvm-svn: 285037
2016-10-24 22:52:39 +00:00
Sanjay Patel 60f80d7a8b [InstCombine] regenerate some checks
llvm-svn: 285036
2016-10-24 22:50:26 +00:00
Justin Bogner b63109944d cmake: Rename installhdrs to install-llvm-headers and fix the dependencies
The installhdrs target was inconsistently named and would behave
differently depending on whether or not you ran a build first. This
renames it to install-llvm-headers to match other target names and
adds a dependency on intrinsics_gen so that it will always install the
same set of things.

llvm-svn: 285035
2016-10-24 21:58:58 +00:00
Eli Friedman c5b7262073 Fix regression from my recent GlobalsAA fix.
There are two fixes here: one, AnalyzeUsesOfPointer can't return
false until it has checked all the uses of the pointer. Two, if a
global uses another global, we have to assume the address of the
first global escapes.

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

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

llvm-svn: 285034
2016-10-24 21:47:44 +00:00
Simon Pilgrim e3e6585c2d [SelectionDAG] Update ComputeNumSignBits SRA/SHL handlers to accept scalar or vector splats
Use isConstOrConstSplat helper.

Also use APInt instead of getZExtValue directly to avoid out of range issues.

llvm-svn: 285033
2016-10-24 21:47:19 +00:00
Todd Fiala 409252fcef remove xfail from TestObjCNewSyntax.py test_expr_gmodules()
Fixes:
rdar://27792848

llvm-svn: 285032
2016-10-24 21:46:46 +00:00
Akira Hatanaka c81708e6ec [Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
by blocks.

Add a new warning "-Wblock-capture-autoreleasing". The warning warns
about implicitly autoreleasing out-parameters captured by blocks which
can introduce use-after-free bugs that are hard to debug.

rdar://problem/15377548

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

llvm-svn: 285031
2016-10-24 21:45:54 +00:00
Justin Bogner 51c6d93fed cmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTS
Add a cmake-exports install component and appropriate targets for
LLVM_DISTRIBUTION_COMPONENTS to work with.

llvm-svn: 285030
2016-10-24 21:40:15 +00:00
Matthias Braun fc371558a0 Use MachineInstr::mop_iterator instead of MIOperands; NFC
(Const)?MIOperands is equivalent to the C++ style
MachineInstr::mop_iterator. Use the latter for consistency except for a
few callers of MIOperands::analyzePhysReg().

llvm-svn: 285029
2016-10-24 21:36:43 +00:00
Saleem Abdulrasool 209150a334 CodeGen: remove incorrect temporary Twine
Twines should not be stack allocated.  This somehow managed to get past me.

llvm-svn: 285028
2016-10-24 21:25:57 +00:00
Mehdi Amini 58567d71d0 Fix test on non-X86 platforms
This is a fixup for r285019, adding an `#ifdef __x86_64__` since
the os_log builtin is platform specific.

llvm-svn: 285027
2016-10-24 21:22:01 +00:00
Kevin Enderby 79d6c63f61 nother additional error check for an invalid Mach-O file
when contained in a Mach-O universal file and the
cputypes in both headers don’t match.

llvm-svn: 285026
2016-10-24 21:15:11 +00:00
Simon Pilgrim d8ec09c74f Use SDValue::getConstantOperandVal() helper. NFCI.
llvm-svn: 285025
2016-10-24 20:56:52 +00:00
Vedant Kumar 26f89df41f [pbqp] unique_ptr-ify (Vector|Matrix)::Data, NFC.
Suggested by David Blaikie.

llvm-svn: 285024
2016-10-24 20:51:46 +00:00
Saleem Abdulrasool d48b0a3346 CodeGen: centralise label construction for method lists
Move all the label construction for the various method list emission into
EmitMethodList.  Rather than have all the names be constructed in pieces in all
of the callers of EmitMethodList, have this occur in one site.  This also makes
the calls much easier to understand as we simplify identify the type of the
method list being emitted and the interface name for which it is being emitted.
NFC.

llvm-svn: 285023
2016-10-24 20:47:58 +00:00
Richard Smith afecd83746 Fix bug where one of the cases where we mangle a <bare-unresolved-name> failed
to emit the <template-args> portion. Refactor so that mangleUnresolvedName
actually emits the entire <unresolved-name>, so this mistake is harder to make
again.

llvm-svn: 285022
2016-10-24 20:47:04 +00:00
Peter Collingbourne 0fab40b915 ELF: Simplify handling of *_start/*_end symbols.
We were previously using the (static) addSynthetic function to create
*_start/*_end symbols. This function was doing almost the same thing as
addOptionalSynthetic, except that it would also create the symbol in the
case where it is unreferenced. Because the symbol has hidden visibility,
creating it in that case would have no effect other than adding another
entry to the static symbol table. Remove addSynthetic and change callers to
use addOptionalSynthetic instead.

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

llvm-svn: 285021
2016-10-24 20:46:21 +00:00
Eric Fiselier a905007f12 Fix non-portable tests for temp_directory_path(...)
llvm-svn: 285020
2016-10-24 20:40:35 +00:00
Mehdi Amini 06d367c6c6 Add support for __builtin_os_log_format[_buffer_size]
This reverts commit r285007 and reapply r284990, with a fix for the
opencl test that I broke. Original commit message follows:

These new builtins support a mechanism for logging OS events, using a
printf-like format string to specify the layout of data in a buffer.
The _buffer_size version of the builtin can be used to determine the size
of the buffer to allocate to hold the data, and then __builtin_os_log_format
can write data into that buffer. This implements format checking to report
mismatches between the format string and the data arguments. Most of this
code was written by Chris Willmore.

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

llvm-svn: 285019
2016-10-24 20:39:34 +00:00
Vedant Kumar 06ca6ea6c3 [pbqp] Delete some dead code, NFC.
I took the opportunity to replace some copy|move constructors|assignment
operators with default implementations.

As a follow-up, I plan on threading unique_ptr<T []> through a few areas
per David Blaikie's advice.

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

llvm-svn: 285018
2016-10-24 20:35:35 +00:00
Dan Gohman 5d3391f859 [WebAssembly] Fix a broken URL.
llvm-svn: 285017
2016-10-24 20:35:17 +00:00
Dan Gohman 4becc58587 [WebAssembly] Define the `end` opcode value.
CFGStackify differentiates between END_LOOP and END_BLOCK, but wasm
itself doesn't. For now, just use the same opcode for both.

llvm-svn: 285016
2016-10-24 20:32:04 +00:00
Richard Smith 4631be7402 Fix mangling of implicit calls to operator-> to only include a single "pt",
rather than including an extra one for each level of 'operator->()' invoked.

llvm-svn: 285015
2016-10-24 20:29:40 +00:00
Dan Gohman c968297b95 [WebAssembly] Update opcode values according to recent spec changes.
This corresponds to the "0xd" opcode renumbering.

llvm-svn: 285014
2016-10-24 20:21:49 +00:00
Peter Collingbourne 4e271c947c scripts: Document existing problems with the symbolizer build script.
Reviewers: eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 285013
2016-10-24 20:15:39 +00:00
Eric Fiselier 4d4c79d8f5 Add missing include in string_view tests. Patch from Billy ONeil @ microsoft
llvm-svn: 285012
2016-10-24 20:11:17 +00:00
Eric Fiselier 009fb08d14 Fix shadow warnings in string_view tests. Patch from STL@microsoft.com
llvm-svn: 285011
2016-10-24 20:10:00 +00:00
Bob Haarman 2bf4a14b3e [compiler-rt] moved __asan_schedule_unregister_globals out of anonymous namespace
Summary: Newer versions of clang complain that __asan_schedule_unregister_globals is unused. Moving it outside the anonymous namespace gets rid of that warning.

Reviewers: rnk, timurrrr

Subscribers: kubabrecka, dberris

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

llvm-svn: 285010
2016-10-24 19:56:18 +00:00
Dan Gohman 4fc4e42dea [WebAssembly] Add an option to make get_local/set_local explicit.
This patch adds a pass, controlled by an option and off by default for
now, for making implicit get_local/set_local explicit. This simplifies
emitting wasm with MC.

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

llvm-svn: 285009
2016-10-24 19:49:43 +00:00
Davide Italiano c3e0ce8f85 Merge two if conditions into one. NFCI.
llvm-svn: 285008
2016-10-24 19:41:47 +00:00
Mehdi Amini 9c39fdceda Revert "Add support for __builtin_os_log_format[_buffer_size]"
This reverts commit r284990, two opencl test are broken

llvm-svn: 285007
2016-10-24 19:41:36 +00:00
Peter Collingbourne 6733564e5a Target: Change various section classifiers in TargetLoweringObjectFile to take a GlobalObject.
These functions are about classifying a global which will actually be
emitted, so it does not make sense for them to take a GlobalValue which may
for example be an alias.

Change the Mach-O object writer and the Hexagon, Lanai and MIPS backends to
look through aliases before using TargetLoweringObjectFile interfaces. These
are functional changes but all appear to be bug fixes.

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

llvm-svn: 285006
2016-10-24 19:23:39 +00:00
Sanjay Patel 87eea10711 [x86] add tests for {-1,0,1} select of constants
llvm-svn: 285005
2016-10-24 19:13:29 +00:00
Tim Northover 5adb224bc2 [asan] relax strstr tests.
Darwin's implementation of strstr seems to trigger slightly different failure
modes from Linux since it calls strncmp. All messages seem about equally useful
and correct, so I relaxed the tests so Darwin can pass.

llvm-svn: 285004
2016-10-24 19:07:27 +00:00
Mandeep Singh Grang da99e33ae3 [llvm] Remove redundant --check-prefix=CHECK from tests
Reviewers: MatzeB, mcrosier, rengolin

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

llvm-svn: 285003
2016-10-24 18:57:55 +00:00
Peter Collingbourne 16e9b944e9 CodeGen: Do not add a global's address space to the folding set profile.
It is already part of the type (which is part of the global, which is already
being added), so there's no need to do it.

llvm-svn: 285002
2016-10-24 18:56:09 +00:00
Mandeep Singh Grang be2ad8f36b [clang] Remove redundant --check-prefix=CHECK from tests
Reviewers: mkuper, rengolin, hans

Subscribers: cfe-commits

Tags: #clang-c

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

llvm-svn: 285001
2016-10-24 18:53:43 +00:00
Artem Dergachev 26b0a9d8ac [analyzer] Use unsigned integers to rely on well-defined overflow semantics.
Found by the UBSan buildbot.

llvm-svn: 285000
2016-10-24 18:49:04 +00:00