NAKAMURA Takumi [Thu, 27 Apr 2017 13:08:48 +0000 (13:08 +0000)]
clang/test/Modules/malformed-overload.m: Make sure module cache is clean.
llvm-svn: 301539
Martin Probst [Thu, 27 Apr 2017 13:07:24 +0000 (13:07 +0000)]
clang-format: [JS] parse async function declarations.
Summary:
Previously, clang-format would accidentally parse an async function
declaration as a function expression, and thus not insert an unwrapped
line for async functions, causing subsequent functions to run into the
function:
async function f() {
x();
} function g() { ...
With this change, async functions get parsed as top level function
declarations and get their own unwrapped line context.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D32590
llvm-svn: 301538
Nitesh Jain [Thu, 27 Apr 2017 12:27:42 +0000 (12:27 +0000)]
[LLDB][MIPS] Forgot to add check in commit rl301530
Reviewers: ki.stfu, labath
Subscribers: jaydeep, bhushan, lldb-commits, slthakur
llvm-svn: 301537
Haojian Wu [Thu, 27 Apr 2017 12:22:33 +0000 (12:22 +0000)]
Fix asan failures on OpenMP.
llvm-svn: 301536
Oren Ben Simhon [Thu, 27 Apr 2017 12:01:00 +0000 (12:01 +0000)]
[X86] Support of no_caller_saved_registers attribute
Implements the Clang part for no_caller_saved_registers attribute as appears here:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=
5ed3cc7b66af4758f7849ed6f65f4365be8223be.
Differential Revision: https://reviews.llvm.org/D31871
llvm-svn: 301535
Pavel Labath [Thu, 27 Apr 2017 11:32:25 +0000 (11:32 +0000)]
TCPSocket: add back support for "*" address
before r301492, we could specify "*:1234" as an address to lldb-server
and it would interpret that as "any". I am not sure that's a good idea,
but we have usages of that in the test suite, and without this the
remote test suite fails.
I'm adding that back, as it does not seem it was an intended side-effect
of that change, but I am open to removing it in the future, after
discussion and test suite fixup.
llvm-svn: 301534
Jonas Paulsson [Thu, 27 Apr 2017 11:01:18 +0000 (11:01 +0000)]
[SystemZ] Remove incorrect assert in SystemZTTIImpl
In getCmpSelInstrCost(), CondTy may actually be scalar while ValTy is a
vector when LoopVectorizer is the caller. Therefore the assert that CondTy
must be a vector type if ValTy is was wrong and is now removed.
Review: Ulrich Weigand
llvm-svn: 301533
Alex Lorenz [Thu, 27 Apr 2017 10:43:48 +0000 (10:43 +0000)]
[ObjC] Disallow vector parameters and return values in Objective-C methods
for iOS < 9 and OS X < 10.11 X86 targets
This commit adds a new error that disallows methods that have parameters/return
values with a vector type for some older X86 targets. This diagnostic is
needed because objc_msgSend doesn't support SIMD vector registers/return values
on X86 in iOS < 9 and OS X < 10.11. Note that we don't necessarily know if the
vector argument/return value will use a SIMD register, so instead we chose to
be conservative and prohibit all vector types.
rdar://
21662309
Differential Revision: https://reviews.llvm.org/D28670
llvm-svn: 301532
Diana Picus [Thu, 27 Apr 2017 10:23:30 +0000 (10:23 +0000)]
[ARM] GlobalISel: Fix extended stack operands
Fix a crash when trying to extend a value passed as a sign- or
zero-extended stack parameter. The cause of the crash was that we were
setting the size of the loaded value to 32 bits, and then tyring to
extend again to 32 bits.
This patch addresses the issue by also introducing a G_TRUNC after the
load. This will leave the unused bits to their original values set by
the caller, while being consistent about the types. For values that are
not extended, we just use a smaller load.
llvm-svn: 301531
Nitesh Jain [Thu, 27 Apr 2017 10:21:46 +0000 (10:21 +0000)]
[LLDB][MIPS] Fix TestMiExec.py failure.
Reviewers: ki.stfu, labath
Subscribers: jaydeep, bhushan, lldb-commits, slthakur
Differential Revision: https://reviews.llvm.org/D32340
llvm-svn: 301530
Andrew V. Tischenko [Thu, 27 Apr 2017 10:20:35 +0000 (10:20 +0000)]
2 tests that were lost in rL301390
llvm-svn: 301529
George Rimar [Thu, 27 Apr 2017 10:00:39 +0000 (10:00 +0000)]
[ELF] - Modify testcase because of llvm-dwarfdump dump format change.
llvm-dwarfdump format changed in r301527
llvm-svn: 301528
George Rimar [Thu, 27 Apr 2017 10:00:13 +0000 (10:00 +0000)]
[llvm-dwarfdump] - Change format for .gdb_index dump.
It is useful to output size of ranges when address ranges
section of .gdb_index is dumped.
It helps to compare outputs produced by different linkers,
for example. In that case address ranges can look very different,
when they are the same at fact. Difference comes from different
low address because of different address of .text.
Differential revision: https://reviews.llvm.org/D32492
llvm-svn: 301527
Yaron Keren [Thu, 27 Apr 2017 09:56:39 +0000 (09:56 +0000)]
Constify SourceManager input to MacroInfo::getDefinitionLengthSlow, NFC.
llvm-svn: 301526
Haojian Wu [Thu, 27 Apr 2017 09:20:46 +0000 (09:20 +0000)]
Don't hard-code "modules-cache-path" in the test.
llvm-svn: 301525
Pavel Labath [Thu, 27 Apr 2017 08:49:19 +0000 (08:49 +0000)]
Fix build for clang r301507
LangStandard::lang_opencl -> LangStandard::lang_opencl10
llvm-svn: 301524
Igor Breger [Thu, 27 Apr 2017 08:02:03 +0000 (08:02 +0000)]
[GlobalISel][X86] handle not symmetric G_COPY
Summary: handle not symmetric G_COPY
Reviewers: zvi, guyblank
Reviewed By: guyblank
Subscribers: rovka, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D32420
llvm-svn: 301523
Nick Lewycky [Thu, 27 Apr 2017 07:27:36 +0000 (07:27 +0000)]
In the expression evaluator, visit the index of an ArraySubscriptExpr even if we can't evaluate the base, if the evaluation mode tells us to continue evaluation.
llvm-svn: 301522
Clement Courbet [Thu, 27 Apr 2017 07:22:30 +0000 (07:22 +0000)]
[CodeGen][NFC] Rename 'Src' to 'Val'.
'Src' looks like it was borrowed from memcpy, 'Val' makes more sense for
memset and is consistent with naming within the function.
Differential Revision: https://reviews.llvm.org/D32580
llvm-svn: 301521
Nick Lewycky [Thu, 27 Apr 2017 07:11:09 +0000 (07:11 +0000)]
In the expression evaluator, descend into both the true and false expressions of a ConditionalOperator when the condition can't be evaluated and we're in an evaluation mode that says we should continue evaluating.
llvm-svn: 301520
Hongbin Zheng [Thu, 27 Apr 2017 06:42:14 +0000 (06:42 +0000)]
[Polly] Do not introduce address space cast
Do not introduce address space cast in IslNodeBuilder::preloadUnconditionally.
Differential Revision: https://reviews.llvm.org/D32581
llvm-svn: 301519
Sanjoy Das [Thu, 27 Apr 2017 06:02:18 +0000 (06:02 +0000)]
Use accessors for ValueHandleBase::V; NFC
This changes code that touches ValueHandleBase::V to go through
getValPtr and (newly added) setValPtr. This functionality will be
used later, but also seemed like a generally good cleanup.
I also renamed the field to Val, but that's just to make it obvious
that I fixed all the uses.
llvm-svn: 301518
Craig Topper [Thu, 27 Apr 2017 05:48:29 +0000 (05:48 +0000)]
[Metadata] Fix typos in comments. NFC
llvm-svn: 301517
Craig Topper [Thu, 27 Apr 2017 04:51:25 +0000 (04:51 +0000)]
[InstCombine] Use APInt bit counting methods to avoid a temporary APInt. NFC
llvm-svn: 301516
Rui Ueyama [Thu, 27 Apr 2017 04:50:08 +0000 (04:50 +0000)]
Recommend users use readelf instead of objdump to dump .comment contents.
readelf's output is much easier to read than objdump's as you can see below.
$ readelf --string-dump .comment foo
String dump of section '.comment':
[ 1] GCC: (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
[ 2c] clang version 5.0.0
[ 41] Linker: LLD 5.0.0
$ objdump -j .comment -s foo
Contents of section .comment:
0000
00474343 3a202855 62756e74 7520342e .GCC: (Ubuntu 4.
0010
382e342d 32756275 6e747531 7e31342e 8.4-2ubuntu1~14.
0020
30342e33 2920342e 382e3400 636c616e 04.3) 4.8.4.clan
0030
67207665 7273696f 6e20352e 302e3020 g version 5.0.0
0040
004c696e 6b65723a 204c4c44 20352e30 .Linker: LLD 5.0
0050 2e3000 .0.
llvm-svn: 301515
Rui Ueyama [Thu, 27 Apr 2017 04:01:36 +0000 (04:01 +0000)]
Simplify BinaryFile::parse and add comments.
llvm-svn: 301514
Rui Ueyama [Thu, 27 Apr 2017 04:01:14 +0000 (04:01 +0000)]
Remove needless type conversions.
llvm-svn: 301513
Rui Ueyama [Thu, 27 Apr 2017 03:45:33 +0000 (03:45 +0000)]
Make StringSaver::save less ambiguous.
Previously, an expression such as Saver.save(std::string("foo") + "bar")
didn't compile because there is an ambiguity as to whether the argument
is of const Twine& or StringRef.
llvm-svn: 301512
Konstantin Zhuravlyov [Thu, 27 Apr 2017 03:22:44 +0000 (03:22 +0000)]
AMDGPU: Fix assert in scheduler
Assert is triggered if DBG_VALUE is first instruction in BB
Differential Revision: https://reviews.llvm.org/D32572
llvm-svn: 301511
Ahmed Bougacha [Thu, 27 Apr 2017 02:09:44 +0000 (02:09 +0000)]
[Support] Fix overflow in SLEB128 decoding.
decodeULEB128 was fixed in r216268, but decodeSLEB128 always had the
same issue, which is now exposed in r301369.
llvm-svn: 301510
Ahmed Bougacha [Thu, 27 Apr 2017 02:09:42 +0000 (02:09 +0000)]
[Support] clang-format LEB128.h. NFC.
llvm-svn: 301509
Duncan P. N. Exon Smith [Thu, 27 Apr 2017 01:47:22 +0000 (01:47 +0000)]
Darwin: Define __STDC_NO_THREADS__ on Darwin targets
Darwin doesn't support C11 threads.h. Define `__STDC_NO_THREADS__` so
that users can check for it.
rdar://problem/
18461003
llvm-svn: 301508
Richard Smith [Thu, 27 Apr 2017 01:17:05 +0000 (01:17 +0000)]
Improve diagnostics for bad -std= flag.
Don't list deprecated -std= values (c++0x etc). Only produce one line of output
per standard, even if we know it by multiple names.
In passing, add missing -std=gnu++03 alias (supported by GCC), and add new
spelling '-std=cl1.0' for OpenCL 1.0 for consistency with the other values,
with the same meaning as the preexisting '-std=cl'.
llvm-svn: 301507
Chris Bieneman [Thu, 27 Apr 2017 00:47:19 +0000 (00:47 +0000)]
One more try at the whole compiling thing...
Need to actually use the right type in both parts of the cast.
llvm-svn: 301506
Chandler Carruth [Thu, 27 Apr 2017 00:28:03 +0000 (00:28 +0000)]
Disable GVN Hoist due to still more bugs being found in it. There is
also a discussion about exactly what we should do prior to re-enabling
it.
The current bug is http://llvm.org/PR32821 and the discussion about this
is in the review thread for r300200.
llvm-svn: 301505
Chris Bieneman [Thu, 27 Apr 2017 00:23:41 +0000 (00:23 +0000)]
One more attempt to fix the broken bots.
llvm-svn: 301504
NAKAMURA Takumi [Thu, 27 Apr 2017 00:09:42 +0000 (00:09 +0000)]
clang/Lex/PPCallbacks.h: Fix a warning in r301472. [-Wdocumentation]
llvm-svn: 301503
Chris Bieneman [Thu, 27 Apr 2017 00:03:27 +0000 (00:03 +0000)]
Fix Windows bots broken by r301492
http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/8644/
llvm-svn: 301502
Adrian Prantl [Wed, 26 Apr 2017 23:59:52 +0000 (23:59 +0000)]
Turn DISubprogram into a variable-length node.
DISubprogram currently has 10 pointer operands, several of which are
often nullptr. This patch reduces the amount of memory allocated by
DISubprogram by rearranging the operands such that containing type,
template params, and thrown types come last, and are only allocated
when they are non-null (or followed by non-null operands).
This patch also eliminates the entirely unused DisplayName operand.
This saves up to 4 pointer operands per DISubprogram. (I tried
measuring the effect on peak memory usage on an LTO link of an X86
llc, but the results were very noisy).
This reapplies r301498 with an attempted workaround for g++.
Differential Revision: https://reviews.llvm.org/D32560
llvm-svn: 301501
Richard Smith [Wed, 26 Apr 2017 23:49:57 +0000 (23:49 +0000)]
Remove unnecessary and somewhat inaccurate "C89" flag from language standards.
llvm-svn: 301500
Adrian Prantl [Wed, 26 Apr 2017 23:49:30 +0000 (23:49 +0000)]
Revert "Turn DISubprogram into a variable-length node."
This reverts commit r301498 while investigating bot breakage.
llvm-svn: 301499
Adrian Prantl [Wed, 26 Apr 2017 23:44:54 +0000 (23:44 +0000)]
Turn DISubprogram into a variable-length node.
DISubprogram currently has 10 pointer operands, several of which are
often nullptr. This patch reduces the amount of memory allocated by
DISubprogram by rearranging the operands such that containing type,
template params, and thrown types come last, and are only allocated
when they are non-null (or followed by non-null operands).
This patch also eliminates the entirely unused DisplayName operand.
This saves up to 4 pointer operands per DISubprogram. (I tried
measuring the effect on peak memory usage on an LTO link of an X86
llc, but the results were very noisy).
llvm-svn: 301498
Richard Smith [Wed, 26 Apr 2017 23:44:33 +0000 (23:44 +0000)]
Don't accept -std= values that would switch us to a different source language.
We already prohibited this in most cases (in r130710), but had some bugs in our
enforcement of this rule. Specifically, this prevents the following
combinations:
* -x c -std=clN.M, which would previously effectively act as if -x cl were
used, despite the input being a C source file. (-x cl -std=cNN continues
to be disallowed.)
* -x c++ -std=cuda, which would previously select C++98 + CUDA, despite that
not being a C++ standard. (-x cuda -std=c++NN is still permitted, and
selects CUDA with the given C++ standard as its base language.
-x cuda -std=cuda is still supported with the meaning of CUDA + C++98.)
* -x renderscript -std=c++NN, which would previously form a hybrid "C++ with
RenderScript extensions" language. We could support such a thing, but
shouldn't do so by accident.
llvm-svn: 301497
Matthias Braun [Wed, 26 Apr 2017 23:37:04 +0000 (23:37 +0000)]
MachineFrameInfo.h: Remove unnecessary forward declarations; NFC
llvm-svn: 301496
Matthias Braun [Wed, 26 Apr 2017 23:37:01 +0000 (23:37 +0000)]
Lanai: Remove unnecessary canRealignStack() override; NFC
It was doing the same as the base implementation and was irritating me
when I was searching for backends that have custom behavior for
canRealignStack.
llvm-svn: 301495
Matthias Braun [Wed, 26 Apr 2017 23:36:58 +0000 (23:36 +0000)]
MachineFrameInfo: Move implementation to an own file; NFC
Move implementation of the MachineFrameInfo class into
MachineFrameInfo.cpp
llvm-svn: 301494
Lang Hames [Wed, 26 Apr 2017 23:29:59 +0000 (23:29 +0000)]
Fix libcxx formatters for changes in r300140.
Summary:
LLVM r300140 changed the layout and field names of __compressed_pair, which
broke LLDB's std::vector, std::map and std::unsorted_map formatters.
This patch attempts to fix these formatters by having them interogate the
__compressed_pair values to determine whether they're pre- or post-r300140
variants, then access them accordingly.
Reviewers: jingham, EricWF
Reviewed By: jingham
Differential Revision: https://reviews.llvm.org/D32554
llvm-svn: 301493
Chris Bieneman [Wed, 26 Apr 2017 23:17:20 +0000 (23:17 +0000)]
Re-landing IPv6 support for LLDB Host
This support was landed in r300579, and reverted in r300669 due to failures on the bots.
The failures were caused by sockets not being properly closed, and this updated version of the patches should resolve that.
Summary from the original change:
This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way.
This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me).
The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call.
This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address.
The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else.
https://reviews.llvm.org/D31823
llvm-svn: 301492
Rui Ueyama [Wed, 26 Apr 2017 23:15:10 +0000 (23:15 +0000)]
Revert r301487: Replace HashString algorithm with xxHash64
This reverts commit r301487 to make buildbots green.
llvm-svn: 301491
Rui Ueyama [Wed, 26 Apr 2017 23:00:32 +0000 (23:00 +0000)]
Remove unnecessary instantiation of StringRef.
SoName's type has changed from StringRef to std::string, so this
code does not make sense anymore.
llvm-svn: 301490
Adrian Prantl [Wed, 26 Apr 2017 22:56:44 +0000 (22:56 +0000)]
Add support for DW_TAG_thrown_type.
For Swift we would like to be able to encode the error types that a
function may throw, so the debugger can display them alongside the
function's return value when finish-ing a function.
DWARF defines DW_TAG_thrown_type (intended to be used for C++ throw()
declarations) that is a perfect fit for this purpose. This patch wires
up support for DW_TAG_thrown_type in LLVM by adding a list of thrown
types to DISubprogram.
To offset the cost of the extra pointer, there is a follow-up patch
that turns DISubprogram into a variable-length node.
rdar://problem/
29481673
Differential Revision: https://reviews.llvm.org/D32559
llvm-svn: 301489
Rui Ueyama [Wed, 26 Apr 2017 22:51:51 +0000 (22:51 +0000)]
Removes createELFFile which takes a template class as a template parameter.
This patch is to reduce amount of template uses. The new code is less
exciting and boring than before, but I think it is easier to read.
Differential Revision: https://reviews.llvm.org/D32467
llvm-svn: 301488
Rui Ueyama [Wed, 26 Apr 2017 22:45:04 +0000 (22:45 +0000)]
Replace HashString algorithm with xxHash64
The previous algorithm processed one character at a time, which is very
painful on a modern CPU. Replace it with xxHash64, which both already
exists in the codebase and is fairly fast.
Patch from Scott Smith!
Differential Revision: https://reviews.llvm.org/D32509
llvm-svn: 301487
George Burgess IV [Wed, 26 Apr 2017 22:37:38 +0000 (22:37 +0000)]
Fix comment. NFC
llvm-svn: 301486
Eugene Zelenko [Wed, 26 Apr 2017 22:31:39 +0000 (22:31 +0000)]
[MC] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).
llvm-svn: 301485
Rafael Espindola [Wed, 26 Apr 2017 22:30:15 +0000 (22:30 +0000)]
Create an OutputSection for each non-empty OutputSectionCommand.
We were already pretty close, the one exception was when a name was
reused in another SECTIONS directive:
SECTIONS {
.text : { *(.text) }
.data : { *(.data) }
}
SECTIONS {
.data : { *(other) }
}
In this case we would create a single .data and magically output
"other" while looking at the first OutputSectionCommand.
We now create two .data sections. This matches what gold does. If we
really want to create a single one, we should change the parser so that
the above is parsed as if the user had written
SECTIONS {
.text : { *(.text) }
.data : { *(.data) *(other)}
}
That is, there should be only one OutputSectionCommand for .data and
it would have two InputSectionDescriptions.
By itself this patch makes the code a bit more complicated, but is an
important step in allowing assignAddresses to operate just on the
linker script.
llvm-svn: 301484
Richard Smith [Wed, 26 Apr 2017 22:10:53 +0000 (22:10 +0000)]
Update lldb to match clang r301442.
This code really doesn't make any sense: there is only ever one InputKind here.
Plus, this is an incomplete and out-of-date copy-paste of some Clang code. This
really ought to be revisited, but this change should get the bots green again.
llvm-svn: 301483
Vedant Kumar [Wed, 26 Apr 2017 21:55:17 +0000 (21:55 +0000)]
[ubsan] nullability-assign: Check assignments into C++ structs
Fix the nullability-assign check so that it can handle assignments into
C++ structs. Previously, such assignments were not instrumented.
Testing: check-clang, check-ubsan, enabling the existing test in ObjC++
mode, and building some Apple frameworks with -fsanitize=nullability.
llvm-svn: 301482
Michael Kruse [Wed, 26 Apr 2017 21:52:55 +0000 (21:52 +0000)]
[unittests/DeLICM] Add test for Written vs Written.
The interpretation of multiple known ValInsts for the same element and
timepoint is that these are alterntivate names for the same values,
for instance a PHINode and the incoming value when knowning it was
the last executed block. That means that known values do not conflict
if there at least (but necessarily all) one common ValInst.
This prinviple also applies to Written values. Add a test for this
principle.
llvm-svn: 301481
Michael Kruse [Wed, 26 Apr 2017 21:52:51 +0000 (21:52 +0000)]
[unittests/DeLICM] Add test for Occipied vs Occupied.
The interpretation of multiple known ValInsts for the same element and
timepoint is that these are alterntivate names for the same values,
for instance a PHINode and the incoming value when knowning it was
the last executed block. That means that known values do not conflict
if there at least (but necessarily all) one common ValInst.
Add a case to test this principle.
llvm-svn: 301480
Kuba Mracek [Wed, 26 Apr 2017 21:34:18 +0000 (21:34 +0000)]
Mark two tests (dead-strip.c, initialization-bug.cc) as unsupported on iOS.
llvm-svn: 301478
Davide Italiano [Wed, 26 Apr 2017 21:28:40 +0000 (21:28 +0000)]
[LibCallsShrinkWrap] Remove an unnecessary class member variable.
llvm-svn: 301477
Rui Ueyama [Wed, 26 Apr 2017 21:27:33 +0000 (21:27 +0000)]
Do flag compatibility check in checkOptions. NFC.
llvm-svn: 301476
Rui Ueyama [Wed, 26 Apr 2017 21:23:11 +0000 (21:23 +0000)]
Factor out code to parse -build-id. NFC.
llvm-svn: 301475
Davide Italiano [Wed, 26 Apr 2017 21:21:02 +0000 (21:21 +0000)]
[LibCallsShrinkWrap] More descriptive assertion messages.
Fix a typo while I'm here.
llvm-svn: 301474
Davide Italiano [Wed, 26 Apr 2017 21:19:05 +0000 (21:19 +0000)]
[LibCallsShrinkWrap] Remove some temporary cl::opt(s).
The pass has been on and working for a while.
llvm-svn: 301473
Vedant Kumar [Wed, 26 Apr 2017 21:05:44 +0000 (21:05 +0000)]
Revert "Revert "PPCallbacks::MacroUndefined, change signature and add test.""
This reverts commit r301469. It isn't needed with r301470, which fixes
the API break introduced in the original commit.
llvm-svn: 301472
Davide Italiano [Wed, 26 Apr 2017 21:05:40 +0000 (21:05 +0000)]
[LibCallsShrinkWrap] Teach the pass how to preserve the dominator.
llvm-svn: 301471
David Blaikie [Wed, 26 Apr 2017 20:58:21 +0000 (20:58 +0000)]
Fix API breaks
llvm-svn: 301470
Vedant Kumar [Wed, 26 Apr 2017 20:58:19 +0000 (20:58 +0000)]
Revert "PPCallbacks::MacroUndefined, change signature and add test."
This reverts commit r301449. It breaks the build with:
MacroPPCallbacks.h:114:50: error: non-virtual member function marked 'override' hides virtual member function
llvm-svn: 301469
David Blaikie [Wed, 26 Apr 2017 20:58:03 +0000 (20:58 +0000)]
Fix API breaks
llvm-svn: 301468
Daniel Berlin [Wed, 26 Apr 2017 20:56:17 +0000 (20:56 +0000)]
Kill the old Simplify* APIs, leave SimplifyInstruction for the moment
llvm-svn: 301467
Daniel Berlin [Wed, 26 Apr 2017 20:56:14 +0000 (20:56 +0000)]
NewGVN: Use new SimplifyQuery based API
llvm-svn: 301466
Daniel Berlin [Wed, 26 Apr 2017 20:56:13 +0000 (20:56 +0000)]
PHITransAddr: Use new SimplifyQuery based API.
llvm-svn: 301465
Daniel Berlin [Wed, 26 Apr 2017 20:56:07 +0000 (20:56 +0000)]
InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere.
llvm-svn: 301464
Kuba Mracek [Wed, 26 Apr 2017 20:38:24 +0000 (20:38 +0000)]
[asan] Allow propagating env variables when testing on iOS Simulator
This patch adds "%env" as a way to express that the environment variable should be set on the target device/simulator. This fixes some test failures when testing on iOS/Simulator.
Differential Revision: https://reviews.llvm.org/D32556
llvm-svn: 301462
Sean Callanan [Wed, 26 Apr 2017 20:36:47 +0000 (20:36 +0000)]
Fixed a crash when dealing with an empty method name in the ObjC runtime.
I've filed a bug covering better unit testing of our runtime metadata reader, which will allow this to be testable..
<rdar://problem/
31793264>
llvm-svn: 301461
Michael Kruse [Wed, 26 Apr 2017 20:35:07 +0000 (20:35 +0000)]
[DeLICM] Use Known information when comparing Occupied and Written.
Do not conflict if a write writes the same value as already known.
This change only affects unit tests, but no functional changes are
expected on LLVM-IR, as no Known information is yet extracted and
consequently this functionality is only triggered through unit tests.
Differential Revision: https://reviews.llvm.org/D32026
llvm-svn: 301460
Kuba Mracek [Wed, 26 Apr 2017 20:29:30 +0000 (20:29 +0000)]
XFAIL the TSan XPC tests on iOS. XPC isn't available on iOS.
llvm-svn: 301459
Kuba Mracek [Wed, 26 Apr 2017 20:27:06 +0000 (20:27 +0000)]
Fix the dump_registers.cc ASan testcase on iOS to allow both SIGSEGV and SIGBUS.
llvm-svn: 301458
Sanjay Patel [Wed, 26 Apr 2017 20:26:46 +0000 (20:26 +0000)]
[DAGCombiner] add (sext i1 X), 1 --> zext (not i1 X)
Besides better codegen, the motivation is to be able to canonicalize this pattern
in IR (currently we don't) knowing that the backend is prepared for that.
This may also allow removing code for special constant cases in
DAGCombiner::foldSelectOfConstants() that was added in D30180.
Differential Revision: https://reviews.llvm.org/D31944
llvm-svn: 301457
Kuba Mracek [Wed, 26 Apr 2017 20:23:23 +0000 (20:23 +0000)]
Mark the asan-sigbus.cpp ASan testcase as unsupported on iOS. We don't handle propagating crashes from/to iOS well.
llvm-svn: 301456
Kuba Mracek [Wed, 26 Apr 2017 20:20:35 +0000 (20:20 +0000)]
Add a missing "%run" expansion to fread_fwrite.cc test case to support testing on iOS simulator.
llvm-svn: 301455
Rui Ueyama [Wed, 26 Apr 2017 20:20:05 +0000 (20:20 +0000)]
Fix comments again.
I thought I fixed the page size, but there were still errors.
This patch also contains fixes for grammatical errors.
Thanks pcc for proofreading!
llvm-svn: 301454
Bruno Cardoso Lopes [Wed, 26 Apr 2017 20:13:45 +0000 (20:13 +0000)]
[Modules] Fix a crash-on-invalid with overloaded functions
Do not add an overload if the function doesn't have a prototype; this
can happen if, for instance, a misplaced/malformed call site is
considered like a declaration for recovery purposes.
rdar://problem/
31306325
llvm-svn: 301453
Kuba Mracek [Wed, 26 Apr 2017 20:02:14 +0000 (20:02 +0000)]
Fix the typo in strtok.c testcase: There was a missing space in %run expansion.
llvm-svn: 301451
Rui Ueyama [Wed, 26 Apr 2017 19:50:49 +0000 (19:50 +0000)]
Fix comment.
llvm-svn: 301450
Frederich Munch [Wed, 26 Apr 2017 19:47:31 +0000 (19:47 +0000)]
PPCallbacks::MacroUndefined, change signature and add test.
Summary:
The PPCallbacks::MacroUndefined callback is currently insufficient for clients that need to track the MacroDirectives.
This patch adds an additional argument to PPCallbacks::MacroUndefined that is the undef MacroDirective.
Reviewers: bruno, manmanren
Reviewed By: bruno
Subscribers: nemanjai, cfe-commits
Differential Revision: https://reviews.llvm.org/D29923
llvm-svn: 301449
Kuba Mracek [Wed, 26 Apr 2017 19:43:56 +0000 (19:43 +0000)]
Follow-up for r301443: The python scrips need to be executable.
llvm-svn: 301448
Kuba Mracek [Wed, 26 Apr 2017 18:59:22 +0000 (18:59 +0000)]
[asan] Add support for running lit tests in the iOS Simulator
This patch adds a basic support for running the ASan lit test suite against an iOS Simulator. This is done by generating more lit.site.cfg configurations into subdirectories such as IOSSimI386Config and IOSSimX86_64Config. These test suites are not added into "check-all" or into "check-asan", they have to be run manually.
Differential Revision: https://reviews.llvm.org/D31477
llvm-svn: 301443
Richard Smith [Wed, 26 Apr 2017 18:57:40 +0000 (18:57 +0000)]
Refactor frontend InputKind to prepare for treating module maps as a distinct kind of input.
No functionality change intended.
llvm-svn: 301442
Lang Hames [Wed, 26 Apr 2017 18:15:40 +0000 (18:15 +0000)]
Use llvm::ArrayRef rather than std::vector/std::initializer lists for some
ValueObject methods.
Using ArrayRef allows us to remove some overloads, work with more array-like
types, and avoid some std::vector temporaries.
https://reviews.llvm.org/D32518
llvm-svn: 301441
Haojian Wu [Wed, 26 Apr 2017 18:13:05 +0000 (18:13 +0000)]
[clang-tidy] Support detecting for-range loop in inefficient-vector-operation check.
Summary:
Also add an option "VectorLikeClasses" allowing user specify customized
vectors.
Reviewers: alexfh, aaron.ballman
Reviewed By: alexfh
Subscribers: Eugene.Zelenko, cfe-commits
Differential Revision: https://reviews.llvm.org/D32436
llvm-svn: 301440
Dmitry Preobrazhensky [Wed, 26 Apr 2017 17:55:50 +0000 (17:55 +0000)]
[AMDGPU][MC] Added arg checks for vmcnt, expcnt, lgkmcnt helpers
Summary of changes:
- corrected vmcnt, expcnt, lgkmcnt helpers to checks their argument for truncation;
- added saturated versions of these helpers.
See bug 32711 for details: https://bugs.llvm.org//show_bug.cgi?id=32711
Reviewers: artem.tamazov, vpykhtin
Differential Revision: https://reviews.llvm.org/D32546
llvm-svn: 301439
Peter Collingbourne [Wed, 26 Apr 2017 17:53:39 +0000 (17:53 +0000)]
LTO: Mark undefined module asm symbols as used.
Marking them as used causes them to be considered visible outside of LTO. This
prevents the symbols from being internalized or discarded, either by GlobalDCE
or by summary-based dead stripping in ThinLTO.
This change makes it unnecessary to add these symbols to llvm.compiler.used
in the backend, as the symbols are kept alive by virtue of being external,
so remove the backend code that handles that.
Fixes PR32798.
Differential Revision: https://reviews.llvm.org/D32544
llvm-svn: 301438
Daniel Berlin [Wed, 26 Apr 2017 17:41:46 +0000 (17:41 +0000)]
CorrelatedValuePropagation: Rename a variable for consistency
llvm-svn: 301435
Alex Shlyapnikov [Wed, 26 Apr 2017 17:13:31 +0000 (17:13 +0000)]
[lsan] When necessary, define LSan suppression for tls_get_addr.
Summary:
Generalize already defined LSan suppression for the leak on
tls_get_addr, some envs do not have the entire call stack symbolized,
so we have to be less specific.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32545
llvm-svn: 301434
Tobias Grosser [Wed, 26 Apr 2017 17:08:02 +0000 (17:08 +0000)]
Update to isl-0.18-423-g30331fe
This is just a general maintenance update.
llvm-svn: 301433
Craig Topper [Wed, 26 Apr 2017 16:39:58 +0000 (16:39 +0000)]
[ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits
This patch introduces a new KnownBits struct that wraps the two APInt used by computeKnownBits. This allows us to treat them as more of a unit.
Initially I've just altered the signatures of computeKnownBits and InstCombine's simplifyDemandedBits to pass a KnownBits reference instead of two separate APInt references. I'll do similar to the SelectionDAG version of computeKnownBits/simplifyDemandedBits as a separate patch.
I've added a constructor that allows initializing both APInts to the same bit width with a starting value of 0. This reduces the repeated pattern of initializing both APInts. Once place default constructed the APInts so I added a default constructor for those cases.
Going forward I would like to add more methods that will work on the pairs. For example trunc, zext, and sext occur on both APInts together in several places. We should probably add a clear method that can be used to clear both pieces. Maybe a method to check for conflicting information. A method to return (Zero|One) so we don't write it out everywhere. Maybe a method for (Zero|One).isAllOnesValue() to determine if all bits are known. I'm sure there are many other methods we can come up with.
Differential Revision: https://reviews.llvm.org/D32376
llvm-svn: 301432
Alexander Kornienko [Wed, 26 Apr 2017 16:39:11 +0000 (16:39 +0000)]
[clang-tidy] Update IdentifierNamingCheck to remove extra leading/trailing underscores
Summary:
The goal of this change is to fix the following suboptimal replacements currently suggested by clang-tidy:
```
// with MemberPrefix == "_"
int __foo; // accepted without complaint
```
```
// with MemberPrefix == "m_"
int _foo;
^~~~~~
m__foo
```
I fixed this by
- updating `matchesStyle()` to reject names which have a leading underscore after a prefix has already been stripped, or a trailing underscore if a suffix has already been stripped;
- updating `fixupWithStyle()` to strip leading & trailing underscores before adding the user-defined prefix and suffix.
The replacements are now:
```
// MemberPrefix == "_"
int __foo;
^~~~~~
_foo
```
```
// MemberPrefix == "m_"
int _foo;
^~~~~
m_foo
```
Future improvements might elect to add .clang-tidy flags to improve what is being stripped. For instance, stripping `m_` could allow `m_foo` to be automatically replaced with `_foo`.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: cfe-commits
Patch by Jacob Bandes-Storch!
Differential Revision: https://reviews.llvm.org/D32333
llvm-svn: 301431