Peter Collingbourne [Thu, 22 Sep 2016 20:51:48 +0000 (20:51 +0000)]
cfi: Fixes for check-cfi when configured as an external project.
Differential Revision: https://reviews.llvm.org/D24817
llvm-svn: 282189
Zachary Turner [Thu, 22 Sep 2016 20:22:55 +0000 (20:22 +0000)]
Convert option tables to ArrayRefs.
This change is very mechanical. All it does is change the
signature of `Options::GetDefinitions()` and `OptionGroup::
GetDefinitions()` to return an `ArrayRef<OptionDefinition>`
instead of a `const OptionDefinition *`. In the case of the
former, it deletes the sentinel entry from every table, and
in the case of the latter, it removes the `GetNumDefinitions()`
method from the interface. These are no longer necessary as
`ArrayRef` carries its own length.
In the former case, iteration was done by using a sentinel
entry, so there was no knowledge of length. Because of this
the individual option tables were allowed to be defined below
the corresponding class (after all, only a pointer was needed).
Now, however, the length must be known at compile time to
construct the `ArrayRef`, and as a result it is necessary to
move every option table before its corresponding class. This
results in this CL looking very big, but in terms of substance
there is not much here.
Differential revision: https://reviews.llvm.org/D24834
llvm-svn: 282188
Vedant Kumar [Thu, 22 Sep 2016 20:12:23 +0000 (20:12 +0000)]
[lld] Add llvm-pdbdump as a test dependency
Reviewed-by: rafael
llvm-svn: 282187
Arnold Schwaighofer [Thu, 22 Sep 2016 20:06:25 +0000 (20:06 +0000)]
i386 does not support optimized swifterror handling
rdar://
28432565
llvm-svn: 282186
Hans Wennborg [Thu, 22 Sep 2016 19:50:05 +0000 (19:50 +0000)]
Win64: Don't emit unwind info for "leaf" functions (PR30337)
According to MSDN (see the PR), functions which don't touch any callee-saved
registers (including %rsp) don't need any unwind info.
This patch makes LLVM not emit unwind info for such functions, to save
binary size.
Differential Revision: https://reviews.llvm.org/D24748
llvm-svn: 282185
Renato Golin [Thu, 22 Sep 2016 19:28:20 +0000 (19:28 +0000)]
[OpenBSD] Add type sign information for OpenBSD
Like NetBSD, OpenBSD prefers having a consistent set of typedefs
across the architectures it supports over strictly following the ARM
ABIs. The diff below makes sure that clang's view of those types
matches OpenBSD's system header files. It also adds a test that
checks the relevant types on all OpenBSD platforms that clang works
on. Hopefully we can add mips64 and powerpc to that list in the
future.
Patch by Mark Kettenis <mark.kettenis@xs4all.nl>
llvm-svn: 282184
Zachary Turner [Thu, 22 Sep 2016 19:21:32 +0000 (19:21 +0000)]
Fix build breakage due to typo in cast.
llvm-svn: 282183
Nemanja Ivanovic [Thu, 22 Sep 2016 19:06:38 +0000 (19:06 +0000)]
[PowerPC] Sign extend sub-word values for atomic comparisons
Atomic comparison instructions use the sub-word load instruction on
Power8 and up but the value is not sign extended prior to the signed word
compare instruction. This patch adds that sign extension.
llvm-svn: 282182
Rafael Espindola [Thu, 22 Sep 2016 18:36:46 +0000 (18:36 +0000)]
Remove extra \
Should fix the windows bots.
llvm-svn: 282181
Rafael Espindola [Thu, 22 Sep 2016 18:05:49 +0000 (18:05 +0000)]
Don't move orphan sections past assignments.
This fixes a case where we would produce an unaligned PT_LOAD.
llvm-svn: 282180
Enrico Granata [Thu, 22 Sep 2016 17:59:58 +0000 (17:59 +0000)]
Actually, do it this way because I will want to know if I am in a host build elsewhere too
llvm-svn: 282179
Enrico Granata [Thu, 22 Sep 2016 17:47:33 +0000 (17:47 +0000)]
The host version of lldb always builds for macosx
llvm-svn: 282178
Nirav Dave [Thu, 22 Sep 2016 17:28:43 +0000 (17:28 +0000)]
[DAG] Fix incorrect alignment of ext load.
Correctly use alignment size from loaded size not output value size.
Reviewers: jyknight, tstellarAMD, arsenm
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23356
llvm-svn: 282177
Rafael Espindola [Thu, 22 Sep 2016 17:23:53 +0000 (17:23 +0000)]
Simplify. NFC.
With the recent changes there should always be a 1:1 correspondence in
the correct order between OutputSections and OutputSectionCommands.
llvm-svn: 282176
Sebastian Pop [Thu, 22 Sep 2016 17:22:58 +0000 (17:22 +0000)]
GVN-hoist: do not dereference null pointers
there may be basic blocks without memory accesses, in which case the
list of accesses is a null pointer.
llvm-svn: 282175
Krzysztof Parzyszek [Thu, 22 Sep 2016 17:22:43 +0000 (17:22 +0000)]
[PPC] Set SP after loading data from stack frame, if no red zone is present
Follow-up to r280705: Make sure that the SP is only restored after all data
is loaded from the stack frame, if there is no red zone.
This completes the fix for https://llvm.org/bugs/show_bug.cgi?id=26519.
Differential Revision: https://reviews.llvm.org/D24466
llvm-svn: 282174
Rafael Espindola [Thu, 22 Sep 2016 16:47:21 +0000 (16:47 +0000)]
Avoid duplicated code.
This also fixes the linker script accounting for the ELF header in
some places but not in others.
llvm-svn: 282173
Todd Fiala [Thu, 22 Sep 2016 16:29:48 +0000 (16:29 +0000)]
fix DarwinLog no-info/no-debug case
This started failing recently:
TestDarwinLogSourceDebug.py
It looks like the behavior of specifying the OS_ACTIVITY_MODE
env var with no value used to work for no-info/no-debug content.
That doesn't appear to be the case now. Switch to specifying
the proper value ('default') when no info-level and no debug-level
content is expected.
llvm-svn: 282172
Todd Fiala [Thu, 22 Sep 2016 16:00:01 +0000 (16:00 +0000)]
added environment variable-related Args gtests
Also fixed up a couple misbehaving functions. It is perfectly
legal to have env vars with no values (i.e. the '=' and following
need not be present).
llvm-svn: 282171
Zachary Turner [Thu, 22 Sep 2016 15:55:05 +0000 (15:55 +0000)]
Speculative fix for build failures due to consumeInteger.
A recent patch added support for consumeInteger() and made
getAsInteger delegate to this function. A few buildbots are
failing as a result with an assertion failure. On a hunch,
I tested what happens if I call getAsInteger() on an empty
string, and sure enough it crashes the same way that the
buildbots are crashing.
I confirmed that getAsInteger() on an empty string did not
crash before my patch, so I suspect this to be the cause.
I also added a unit test for the empty string.
llvm-svn: 282170
Vedant Kumar [Thu, 22 Sep 2016 15:34:33 +0000 (15:34 +0000)]
[docs] Touch up the coverage docs some more
llvm-svn: 282169
Sebastian Pop [Thu, 22 Sep 2016 15:33:51 +0000 (15:33 +0000)]
GVN-hoist: fix store past load dependence analysis (PR30216)
To hoist stores past loads, we used to search for potential
conflicting loads on the hoisting path by following a MemorySSA
def-def link from the store to be hoisted to the previous
defining memory access, and from there we followed the def-use
chains to all the uses that occur on the hoisting path. The
problem is that the def-def link may point to a store that does
not alias with the store to be hoisted, and so the loads that are
walked may not alias with the store to be hoisted, and even as in
the testcase of PR30216, the loads that may alias with the store
to be hoisted are not visited.
The current patch visits all loads on the path from the store to
be hoisted to the hoisting position and uses the alias analysis
to ask whether the store may alias the load. I was not able to
use the MemorySSA functionality to ask for whether load and
store are clobbered: I'm not sure which function to call, so I
used a call to AA->isNoAlias().
Store past store is still working as before using a MemorySSA
query: I added an extra test to pr30216.ll to make sure store
past store does not regress.
Differential Revision: https://reviews.llvm.org/D24517
llvm-svn: 282168
Pavel Labath [Thu, 22 Sep 2016 15:26:43 +0000 (15:26 +0000)]
Fix TestBreakpointSerialization on windows
The test exposed a bug in the StructuredData Serialization code, which did not
escape the backslash properly. This manifested itself as windows breakpoint
serialization roundtrip test not succeeding (as windows paths included
backslashes).
llvm-svn: 282167
Rafael Espindola [Thu, 22 Sep 2016 15:25:21 +0000 (15:25 +0000)]
Simplify. NFC.
It doesn't matter which direction we rotate and we haven't really
started optimizing the linker script code, so keep this simple.
llvm-svn: 282166
Sebastian Pop [Thu, 22 Sep 2016 15:08:09 +0000 (15:08 +0000)]
GVN-hoist: fix typo
llvm-svn: 282165
Zachary Turner [Thu, 22 Sep 2016 15:05:19 +0000 (15:05 +0000)]
[Support] Add StringRef::consumeInteger.
StringRef::getInteger() exists and treats the entire string as
an integer of the specified radix, failing if any invalid characters
are encountered or the number overflows.
Sometimes you might have something like "123456foo" and you want
to get the number 123456 and leave the string "foo" remaining.
This is similar to what would be possible by using the standard
runtime library functions strtoul et al and specifying an end
pointer.
This patch adds consumeInteger(), which does exactly that. It
consumes as much as possible until an invalid character is found,
and modifies the StringRef in place so that upon return only
the portion of the StringRef after the number remains.
Differential Revision: https://reviews.llvm.org/D24778
llvm-svn: 282164
Etienne Bergeron [Thu, 22 Sep 2016 14:57:24 +0000 (14:57 +0000)]
[compiler-rt] fix typo in option description [NFC]
llvm-svn: 282163
Sebastian Pop [Thu, 22 Sep 2016 14:45:46 +0000 (14:45 +0000)]
GVN-hoist: move hoist testcase to GVNHoist dir
llvm-svn: 282161
Sebastian Pop [Thu, 22 Sep 2016 14:45:40 +0000 (14:45 +0000)]
GVN-hoist: only hoist relevant scalar instructions
Without this patch, GVN-hoist would think that a branch instruction is a scalar instruction
and would try to value number it. The patch filters out all such kind of irrelevant instructions.
A bit frustrating is that there is no easy way to discard all those very infrequent instructions,
a bit like isa<TerminatorInst> that stands for a large family of instructions. I'm thinking that
checking for those very infrequent other instructions would cost us more in compilation time
than just letting those instructions getting numbered, so I'm still thinking that a simpler check:
if (isa<TerminatorInst>(I))
return false;
is better than listing all the other less frequent instructions.
Differential Revision: https://reviews.llvm.org/D23929
llvm-svn: 282160
Rafael Espindola [Thu, 22 Sep 2016 14:40:50 +0000 (14:40 +0000)]
Handle empty sections with symbol assignments.
Before the symbols were becoming undefined.
llvm-svn: 282159
Haojian Wu [Thu, 22 Sep 2016 14:36:43 +0000 (14:36 +0000)]
[clang-tidy] Add doc for `explain-config` option.
llvm-svn: 282158
Dmitry Vyukov [Thu, 22 Sep 2016 14:33:43 +0000 (14:33 +0000)]
tsan: fix bug introduced in 282152
In ShadowToMem we call MemToShadow potentially for incorrect addresses.
So DCHECK(IsAppMem(p)) can fire in debug mode.
Fix this by swapping range and MemToShadow checks.
llvm-svn: 282157
Daniel Marjamaki [Thu, 22 Sep 2016 14:13:46 +0000 (14:13 +0000)]
Fix Wbitfield-constant-conversion false positives
Summary:
The diagnostic did not handle ~ well. An expression such as ~0 is often used when 'all ones' is needed.
Differential Revision: https://reviews.llvm.org/D24232
llvm-svn: 282156
Keith Walker [Thu, 22 Sep 2016 14:13:25 +0000 (14:13 +0000)]
Reapplying r281895 (and follow-up r281964) after fixing pr30468.
The additional fix is:
When adding debug information to a lowered phi node in mem2reg
check that we have a valid insertion point after the phi for adding
the debug information.
This change addresses the issue in pr30468 where a lowered phi was
added before a catchswitch and no debug information should be added
after the phi in this case.
Differential Revision: https://reviews.llvm.org/D24797
llvm-svn: 282155
Teresa Johnson [Thu, 22 Sep 2016 13:58:33 +0000 (13:58 +0000)]
Third attempt to fix Sphinx bot
Bot now complaining about -flto=thin reference, used similar workaround
for that failure.
llvm-svn: 282154
Tim Northover [Thu, 22 Sep 2016 13:49:25 +0000 (13:49 +0000)]
GlobalISel: handle stack-based parameters on AArch64.
llvm-svn: 282153
Dmitry Vyukov [Thu, 22 Sep 2016 13:42:02 +0000 (13:42 +0000)]
tsan: support pie binaries on newer kernels
4.1+ Linux kernels map pie binaries at 0x55:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=
d1fd836dcf00d2028c700c7e44d2c23404062c90
Currently tsan does not support app memory at 0x55 (https://github.com/google/sanitizers/issues/503).
Older kernels also map pie binaries at 0x55 when ASLR is disables (most notably under gdb).
This change extends tsan mapping for linux/x86_64 to cover 0x554-0x568 app range and fixes both 4.1+ kernels and gdb.
This required to slightly shrink low and high app ranges and move heap. The mapping become even more non-linear, since now we xor lower bits. Now even a continuous app range maps to split, intermixed shadow ranges. This breaks ShadowToMemImpl as it assumes linear mapping at least within a continuous app range (however it turned out to be already broken at least on arm64/42-bit vma as uncovered by r281970). So also change ShadowToMemImpl to hopefully a more robust implementation that does not assume a linear mapping.
llvm-svn: 282152
Teresa Johnson [Thu, 22 Sep 2016 13:41:10 +0000 (13:41 +0000)]
Second attempt to fix Sphinx bot
The fix in r282148 was not enough to fix the following error:
/home/llvmbb/llvm-build-dir/clang-sphinx-docs/llvm/src/tools/clang/docs/CommandGuide/clang.rst:338:
WARNING: unknown option: -flto=full
on the sphinx bot:
http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/16313
(not reproducible locally).
This time, simply remove the option reference.
llvm-svn: 282151
Anna Thomas [Thu, 22 Sep 2016 13:13:06 +0000 (13:13 +0000)]
[RS4GC] Remat in presence of phi and use live value
Summary:
Reviewers:
Subscribers:
llvm-svn: 282150
Rafael Espindola [Thu, 22 Sep 2016 12:35:44 +0000 (12:35 +0000)]
Fix VA computation for tbss.
llvm-svn: 282149
Aaron Ballman [Thu, 22 Sep 2016 12:15:18 +0000 (12:15 +0000)]
Fixing sphinx build due to diagnostic:
/opt/llvm/build.attributes.src/tools/clang/docs/CommandGuide/clang.rst:338: WARNING: unknown option: -flto=full
llvm-svn: 282148
Rafael Espindola [Thu, 22 Sep 2016 12:00:08 +0000 (12:00 +0000)]
Handle multiple .tbss sections.
llvm-svn: 282147
Eric Liu [Thu, 22 Sep 2016 11:54:00 +0000 (11:54 +0000)]
[change-namespace] fix qualifier of function references.
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24803
llvm-svn: 282146
Artem Tamazov [Thu, 22 Sep 2016 11:47:21 +0000 (11:47 +0000)]
[AMDGPU][mc] Add support for absolute expressions in DPP modifiers.
Also added range checking for DPP attributes.
Assembler tests added as well.
Differential Revision: https://reviews.llvm.org/D24755
llvm-svn: 282145
Nemanja Ivanovic [Thu, 22 Sep 2016 10:32:03 +0000 (10:32 +0000)]
[PowerPC] Remove LE patterns matching generic stores/loads to VSX permuting ops
This patch corresponds to:
https://reviews.llvm.org/D21409
The LXVD2X, LXVW4X, STXVD2X and STXVW4X instructions permute the two doublewords
in the vector register when in little-endian mode. Custom code ensures that the
necessary swaps are inserted for these. This patch simply removes the possibilty
that a load/store node will match one of these instructions in the SDAG as that
would not insert the necessary swaps.
llvm-svn: 282144
Nemanja Ivanovic [Thu, 22 Sep 2016 09:52:19 +0000 (09:52 +0000)]
[Power9] Add exploitation of non-permuting memory ops
This patch corresponds to review:
https://reviews.llvm.org/D19825
The new lxvx/stxvx instructions do not require the swaps to line the elements
up correctly. In order to select them over the lxvd2x/lxvw4x instructions which
require swaps, the patterns for the old instruction have a predicate that
ensures they won't be selected on Power9 and newer CPUs.
llvm-svn: 282143
Sagar Thakur [Thu, 22 Sep 2016 08:36:54 +0000 (08:36 +0000)]
[ESan][MIPS] Fix tests struct-simple.cpp on MIPS
For mips assember '#' is the start of comment. We get assembler error messages if # is used in the struct names. Therefore using '$' which works for all architectures.
Differential: D24335
Reviewed by: zhaoqin
llvm-svn: 282142
Sagar Thakur [Thu, 22 Sep 2016 08:33:06 +0000 (08:33 +0000)]
[EfficiencySanitizer] Using '$' instead of '#' for struct counter name
For MIPS '#' is the start of comment line. Therefore we get assembler errors if # is used in the structure names.
Differential: D24334
Reviewed by: zhaoqin
llvm-svn: 282141
Dorit Nuzman [Thu, 22 Sep 2016 07:56:23 +0000 (07:56 +0000)]
Fix revision 281960
llvm-svn: 282139
Martin Probst [Thu, 22 Sep 2016 07:18:00 +0000 (07:18 +0000)]
clang-format: [JS] reserved words in method names.
Summary:
Before:
class X {
delete () {
...
}
}
After:
class X {
delete() {
...
}
}
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D24804
llvm-svn: 282138
Craig Topper [Thu, 22 Sep 2016 06:13:33 +0000 (06:13 +0000)]
[X86] Fix some illegal rounding modes in some builtin test cases to ones that would properly compile to valid assembly.
llvm-svn: 282137
Stephen Hines [Thu, 22 Sep 2016 05:52:55 +0000 (05:52 +0000)]
clang-format: Add an option to git-clang-format to diff between to commits
Summary:
When building pre-upload hooks using git-clang-format, it is useful to limit the scope to a diff of two commits (instead of from a commit against the working tree) to allow for less false positives in dependent commits.
This change adds the option of specifying two git commits to git-clang-format when using the `--diff` flag, which uses a different strategy to diff (using `git-diff-tree` instead of `git-diff-index`), and runs clang-format against the second commit instead of the working directory.
There is a slight backwards-incompatibility introduced with this change: if a filename matches a branch name or other commit-ish, then `git clang-format <commit> <file>` will no longer work as expected; use `git clang-format <commit> -- <file>` instead.
Patch by Luis Hector Chavez!
Reviewers: djasper, lodato
Subscribers: lodato, cfe-commits, srhines
Projects: #clang-c
Differential Revision: https://reviews.llvm.org/D24319
llvm-svn: 282136
Ilia K [Thu, 22 Sep 2016 05:08:41 +0000 (05:08 +0000)]
Fix parsing expressions to evaluate with spaces and optional args (MI)
Summary:
When extracting options for long options (starting with `--`), the use of
`MIUtilString::SplitConsiderQuotes` to split all the arguments was being
conditioned on the option type to be expected. This was wrong as this caused
other options to be parsed incorrectly since it was not taking into account the
presence of quotes.
Patch by Ed Munoz <edmunoz@microsoft.com>
Reviewers: edmunoz, ki.stfu
Subscribers: ki.stfu, lldb-commits
Projects: #lldb
Differential Revision: https://reviews.llvm.org/D24202
llvm-svn: 282135
Marshall Clow [Thu, 22 Sep 2016 03:25:22 +0000 (03:25 +0000)]
Fix failure on 03 bot
llvm-svn: 282134
Craig Topper [Thu, 22 Sep 2016 03:00:50 +0000 (03:00 +0000)]
[AVX-512] Add support for commuting VPTERNLOG instructions.
VPTERNLOG is a ternary instruction with an immediate specifying the logical operation to perform. For each bit position in the 3 source vectors the bit from each source is concatenated together and the resulting 3-bit value is used to select a bit in the immediate. This bit value is written to the result vector.
We can commute this by swapping operands and modifying the immediate. To modify the immediate we need to swap two pairs of bits. The pairs correspond to the locations in the immediate where the commuted operands bits have opposite values and the uncommuted operand has the same value. Bits 0 and 7 will never be swapped since the relevant bits from all sources are the same value.
This refactors and reuses parts of the FMA3 commuting code which is also a three operand instruction.
llvm-svn: 282132
Quentin Colombet [Thu, 22 Sep 2016 02:10:37 +0000 (02:10 +0000)]
[RegisterBankInfo] Move to statically allocated RegisterBank.
This commit is basically the first step toward what will
RegisterBankInfo look when it gets TableGen'ed.
It introduces a XXXGenRegisterBankInfo.def file that is what TableGen
will issue at some point. Moreover, the RegBanks field in
RegisterBankInfo changed to reflect the static (compile time) aspect of
the information.
llvm-svn: 282131
Quentin Colombet [Thu, 22 Sep 2016 02:10:32 +0000 (02:10 +0000)]
[RegisterBankInfo] Take advantage of the extra argument of SmallVector::resize.
When initializing an instance of OperandsMapper, instead of using
SmallVector::resize followed by std::fill, use the function that
directly does that in SmallVector.
llvm-svn: 282130
Kostya Serebryany [Thu, 22 Sep 2016 01:34:58 +0000 (01:34 +0000)]
[libFuzzer] add 'features' to the corpus elements, allow mutations with Size > MaxSize, fix sha1 in corpus stats; various refactorings
llvm-svn: 282129
Todd Fiala [Thu, 22 Sep 2016 00:59:23 +0000 (00:59 +0000)]
fix Args function broken in r281942
The method was hard-coded to check only the 0th element of the array.
This manifested as NSLog messages behaving incorrectly on macOS.
(This is independent of the broken DarwinLog feature).
llvm-svn: 282128
Kostya Serebryany [Thu, 22 Sep 2016 00:57:29 +0000 (00:57 +0000)]
[libFuzzer] one more test
llvm-svn: 282127
Marshall Clow [Thu, 22 Sep 2016 00:23:15 +0000 (00:23 +0000)]
Add missing _v traits. is_bind_expression_v, is_placeholder_v and uses_allocator_v
llvm-svn: 282126
Chris Bieneman [Thu, 22 Sep 2016 00:18:12 +0000 (00:18 +0000)]
[CMake] More robust handling for bootstrap variables
Checking defined isn't good enough we also need to handle defined to empty string.
llvm-svn: 282125
George Burgess IV [Thu, 22 Sep 2016 00:00:26 +0000 (00:00 +0000)]
[Sema] Fix PR30481: crash on checking printf args.
We were falling through from one case to another in a switch statement.
Oops.
llvm-svn: 282124
Ed Maste [Wed, 21 Sep 2016 23:30:36 +0000 (23:30 +0000)]
Fix typo in lldb --help
Patch by Yacine Belkadi
Differential Revision: https://reviews.llvm.org/D12158
llvm-svn: 282123
Chris Bieneman [Wed, 21 Sep 2016 23:24:15 +0000 (23:24 +0000)]
[CMake] Check if passthrough variables are defined
Checking if they evaluate to true cases prevents passing values that evaluate to false cases. Instead we should check if the variables are defined.
llvm-svn: 282122
Kostya Serebryany [Wed, 21 Sep 2016 22:42:17 +0000 (22:42 +0000)]
[libFuzzer] add stats to the corpus; more refactoring
llvm-svn: 282121
Ed Maste [Wed, 21 Sep 2016 22:36:51 +0000 (22:36 +0000)]
Fix for loop sign fix in r282112 for column = 0
llvm-svn: 282119
Rafael Espindola [Wed, 21 Sep 2016 22:36:19 +0000 (22:36 +0000)]
Once more unto the strict weak ordering, once more.
This should finally give a stable sorting over all implementations.
llvm-svn: 282118
Zachary Turner [Wed, 21 Sep 2016 22:33:30 +0000 (22:33 +0000)]
Fix an incorrect nullptr conversion.
llvm-svn: 282117
Zachary Turner [Wed, 21 Sep 2016 22:29:36 +0000 (22:29 +0000)]
=delete the StringRef(nullptr_t) constructor.
It's a guaranteed crash if you construct a StringRef with
nullptr, so might as well delete the constructor that allows
it.
llvm-svn: 282116
Kostya Serebryany [Wed, 21 Sep 2016 21:41:48 +0000 (21:41 +0000)]
[libFuzzer] more refactoring; don't compute sha1sum every time we mutate a unit from the corpus, use the stored one.
llvm-svn: 282115
Kostya Serebryany [Wed, 21 Sep 2016 21:17:23 +0000 (21:17 +0000)]
[libFuzzer] more refactoring
llvm-svn: 282113
Ed Maste [Wed, 21 Sep 2016 21:14:31 +0000 (21:14 +0000)]
Fix integer sign warning from r282105
llvm-svn: 282112
Ed Maste [Wed, 21 Sep 2016 21:08:30 +0000 (21:08 +0000)]
Fix -Wcovered-switch-default warning in StackFrame.cpp
The switch coveres all possible values. If a new one is added in the
future the compiler will start warning, providing a notification that
the switch needs updating.
llvm-svn: 282111
Chris Bieneman [Wed, 21 Sep 2016 21:02:16 +0000 (21:02 +0000)]
[CMake] Initial support for LLDB.framework
Summary:
This patch adds a CMake option LLDB_BUILD_FRAMEWORK, which builds libLLDB as a macOS framework instead of as a *nix shared library.
With this patch any LLDB executable that has the INCLUDE_IN_FRAMEWORK option set will be built into the Framework's resources directory, and a symlink to the exeuctable will be placed under the build directory's bin folder. Creating the symlinks allows users to run commands from the build directory without altering the workflow.
The framework generated by this patch passes the LLDB test suite, but has not been tested beyond that. It is not expected to be fully ready to ship, but it is a first step.
With this patch binaries that are placed inside the framework aren't being properly installed. Fixing that would increase the patch size significantly, so I'd like to do that in a follow-up.
Reviewers: zturner, tfiala
Subscribers: beanz, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D24749
llvm-svn: 282110
Chris Bieneman [Wed, 21 Sep 2016 20:43:43 +0000 (20:43 +0000)]
[CMake] Pass CLANG_VERSION_* variables into later stages
When supporting overriding clang versions we also need to pass those through to the next stage so they remain overridden.
llvm-svn: 282109
Albert Gutowski [Wed, 21 Sep 2016 20:19:21 +0000 (20:19 +0000)]
Add -Wignored-pragma-intrinsic flag
Summary: People might want to receive warnings about pragmas but not about intrinsics that are implemented in intrin.h.
Reviewers: thakis, hans
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24775
llvm-svn: 282108
Filipe Cabecinhas [Wed, 21 Sep 2016 20:18:18 +0000 (20:18 +0000)]
[asan] Reify ErrorGeneric
Summary:
Finish work on PR30351 (last one, after D24551, D24552, and D24554 land)
Also replace the old ReportData structure/variable with the current_error_ static
member of the ScopedInErrorReport class.
This has the following side-effects:
- Move ASAN_ON_ERROR(); call to the start of the destructor, instead
of in StartReporting().
- We only generate the error structure after the
ScopedInErrorReport constructor finishes, so we can't call
ASAN_ON_ERROR() during the constructor. I think this makes more
sense, since we end up never running two of the ASAN_ON_ERROR()
callback. This also works the same way as error reporting, since
we end up having a lock around it. Otherwise we could end up
with the ASAN_ON_ERROR() call for error 1, then the
ASAN_ON_ERROR() call for error 2, and then lock the mutex for
reporting error 1.
- The __asan_get_report_* functions will be able to, in the future,
provide information about other errors that aren't a "generic
error". But we might want to rethink that API, since it's too
restricted. Ideally we teach lldb about the current_error_ member of
ScopedInErrorReport.
Reviewers: vitalybuka, kcc, eugenis
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D24555
llvm-svn: 282107
Jan Vesely [Wed, 21 Sep 2016 20:15:55 +0000 (20:15 +0000)]
Provide vstore_half helper to workaround clc restrictions
clang won't accept half precision loads and stores without cl_khr_fp16 since r281904
llvm-svn: 282106
Todd Fiala [Wed, 21 Sep 2016 20:13:14 +0000 (20:13 +0000)]
add stop column highlighting support
This change introduces optional marking of the column within a source
line where a thread is stopped. This marking will show up when the
source code for a thread stop is displayed, when the debug info
knows the column information, and if the optional column marking is
enabled.
There are two separate methods for handling the marking of the stop
column:
* via ANSI terminal codes, which are added inline to the source line
display. The default ANSI mark-up is to underline the column.
* via a pure text-based caret that is added in the appropriate column
in a newly-inserted blank line underneath the source line in
question.
There are some new options that control how this all works.
* settings set stop-show-column
This takes one of 4 values:
* ansi-or-caret: use the ANSI terminal code mechanism if LLDB
is running with color enabled; if not, use the caret-based,
pure text method (see the "caret" mode below).
* ansi: only use the ANSI terminal code mechanism to highlight
the stop line. If LLDB is running with color disabled, no
stop column marking will occur.
* caret: only use the pure text caret method, which introduces
a newly-inserted line underneath the current line, where
the only character in the new line is a caret that highlights
the stop column in question.
* none: no stop column marking will be attempted.
* settings set stop-show-column-ansi-prefix
This is a text format that indicates the ANSI formatting
code to insert into the stream immediately preceding the
column where the stop column character will be marked up.
It defaults to ${ansi.underline}; however, it can contain
any valid LLDB format codes, e.g.
${ansi.fg.red}${ansi.bold}${ansi.underline}
* settings set stop-show-column-ansi-suffix
This is the text format that specifies the ANSI terminal
codes to end the markup that was started with the prefix
described above. It defaults to: ${ansi.normal}. This
should be sufficient for the common cases.
Significant leg-work was done by Adrian Prantl. (Thanks, Adrian!)
differential review: https://reviews.llvm.org/D20835
reviewers: clayborg, jingham
llvm-svn: 282105
Kevin Enderby [Wed, 21 Sep 2016 20:03:09 +0000 (20:03 +0000)]
Next set of additional error checks for invalid Mach-O files for bad LC_UUID
load commands. Added a missing check and made the check for more than
one like other other “more than one” checks. And of course added test cases.
llvm-svn: 282104
Jim Ingham [Wed, 21 Sep 2016 19:21:38 +0000 (19:21 +0000)]
Probably should add the breakpoint names test directory as well...
llvm-svn: 282103
Filipe Cabecinhas [Wed, 21 Sep 2016 19:21:01 +0000 (19:21 +0000)]
[asan] Store full AddressDescription objects in ErrorInvalidPointerPair
Reviewers: kcc, vitalybuka, eugenis
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D24777
llvm-svn: 282102
Chad Rosier [Wed, 21 Sep 2016 19:16:47 +0000 (19:16 +0000)]
[LoopInterchange] Track all dependencies, not just anti dependencies.
Currently, we give up on loop interchange if we encounter a flow dependency
anywhere in the loop list. Worse yet, we don't even track output dependencies.
This patch updates the dependency matrix computation to track flow and output
dependencies in the same way we track anti dependencies.
This improves an internal workload by 2.2x.
Note the loop interchange pass is off by default and it can be enabled with
'-mllvm -enable-loopinterchange'
Differential Revision: https://reviews.llvm.org/D24564
llvm-svn: 282101
Teresa Johnson [Wed, 21 Sep 2016 19:12:05 +0000 (19:12 +0000)]
[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.
llvm-svn: 282100
Rafael Espindola [Wed, 21 Sep 2016 18:33:44 +0000 (18:33 +0000)]
Implement ONLY_IF_RO/ONLY_IF_RW like bfd.
The actual logic is to keep the output section if the output section
would have been ro/rw.
This is both simpler and more practical, as the intention is linker
scripts is to always keep of of a pair of ONLY_IF_RO/ONLY_IF_RW.
llvm-svn: 282099
Davide Italiano [Wed, 21 Sep 2016 18:26:08 +0000 (18:26 +0000)]
[MIRParser] Delete dead code. NFCI.
llvm-svn: 282098
Nico Weber [Wed, 21 Sep 2016 18:25:43 +0000 (18:25 +0000)]
revert 281908 because 281909 got reverted
llvm-svn: 282097
Nico Weber [Wed, 21 Sep 2016 18:22:43 +0000 (18:22 +0000)]
revert 282085, 281909, they broke 32-bit dynamic ASan and the sanitizer-windows bot
llvm-svn: 282096
Nico Weber [Wed, 21 Sep 2016 17:41:03 +0000 (17:41 +0000)]
Remove obsolete XFAIL.
The sanitizer-windows bot is currently red because this test unexpectedly passes.
llvm-svn: 282095
Etienne Bergeron [Wed, 21 Sep 2016 17:16:38 +0000 (17:16 +0000)]
Fix typo in comment [NFC]
llvm-svn: 282092
Etienne Bergeron [Wed, 21 Sep 2016 17:15:23 +0000 (17:15 +0000)]
fix typo in comment [NFC]
llvm-svn: 282091
Zachary Turner [Wed, 21 Sep 2016 17:13:51 +0000 (17:13 +0000)]
Fix failing regex tests.
r282079 converted the regular expression interface to accept
and return StringRefs instead of char pointers. In one case
a null pointer check was converted to an empty string check,
but this was an incorrect conversion because an empty string
is a valid regular expression. Removing this check should
fix the test failures.
llvm-svn: 282090
Teresa Johnson [Wed, 21 Sep 2016 16:57:03 +0000 (16:57 +0000)]
[docs] Add ThinLTO user documentation
Summary: Add some user facing documentation on ThinLTO and how to use it.
Reviewers: mehdi_amini
Subscribers: mehdi_amini, cfe-commits
Differential Revision: https://reviews.llvm.org/D24806
llvm-svn: 282089
Arnold Schwaighofer [Wed, 21 Sep 2016 16:53:36 +0000 (16:53 +0000)]
Disable tail calls if there is an swifterror argument
ISel does not handle them correctly yet i.e we crash trying to emit tail call
code.
radar://
28407842
llvm-svn: 282088
Matthew Simpson [Wed, 21 Sep 2016 16:50:24 +0000 (16:50 +0000)]
[LV] Don't emit unused scalars for uniform instructions
If we identify an instruction as uniform after vectorization, we know that we
should only use the value corresponding to the first vector lane of each unroll
iteration. However, when scalarizing such instructions, we still produce values
for the other vector lanes. This patch prevents us from generating the unused
scalars.
Differential Revision: https://reviews.llvm.org/D24275
llvm-svn: 282087
Artem Tamazov [Wed, 21 Sep 2016 16:35:44 +0000 (16:35 +0000)]
[AMDGPU][mc] Add support for ds_add_[rtn_]f32.
Lit tests added.
Resolves https://github.com/RadeonOpenCompute/hcc/issues/122.
Differential Revision: https://reviews.llvm.org/D24765
llvm-svn: 282086
Etienne Bergeron [Wed, 21 Sep 2016 16:32:14 +0000 (16:32 +0000)]
[compiler-rt] Fix Asan build on Android
Summary:
The dynamic shadow code is not detected correctly on Android.
The android shadow seems to start at address zero.
The bug is introduced here:
https://reviews.llvm.org/D23363
Started here: https://build.chromium.org/p/chromium.fyi/builders/ClangToTAndroidASan/builds/4029
Likely due to an asan runtime change, filed https://llvm.org/bugs/show_bug.cgi?id=30462
From asan_mapping.h:
```
#if SANITIZER_WORDSIZE == 32
# if SANITIZER_ANDROID
# define SHADOW_OFFSET (0) <<---- HERE
# elif defined(__mips__)
```
Shadow address on android is 0.
From asan_rtl.c:
```
if (shadow_start == 0) {
[...]
shadow_start = FindAvailableMemoryRange(space_size, alignment, granularity);
}
```
We assumed that 0 is dynamic address.
On windows, the address was determined with:
```
# elif SANITIZER_WINDOWS64
# define SHADOW_OFFSET __asan_shadow_memory_dynamic_address
# else
```
and __asan_shadow_memory_dynamic_address is initially zero.
Reviewers: rnk, eugenis, vitalybuka
Subscribers: kcc, tberghammer, danalbert, kubabrecka, dberris, llvm-commits, chrisha
Differential Revision: https://reviews.llvm.org/D24768
llvm-svn: 282085
Dehao Chen [Wed, 21 Sep 2016 16:26:51 +0000 (16:26 +0000)]
Change the basic block weight calculation algorithm to use max instead of voting.
Summary: Now that we have more precise debug info, we should change back to use maximum to get basic block weight.
Reviewers: dnovillo
Subscribers: andreadb, llvm-commits
Differential Revision: https://reviews.llvm.org/D24788
llvm-svn: 282084
Matthew Simpson [Wed, 21 Sep 2016 16:09:23 +0000 (16:09 +0000)]
[LV] Rename "Width" to "Lane" (NFC)
llvm-svn: 282083