platform/upstream/llvm.git
5 years agoOne more fix while I'm looking at this - remove the
Jason Molenda [Mon, 18 Feb 2019 22:18:11 +0000 (22:18 +0000)]
One more fix while I'm looking at this - remove the
unused IsSBProcess method, and have IsFBSProcess
return false if we don't have API that we can use to
make that determination, so we'll try other API
if we can.

llvm-svn: 354289

5 years agoAh, misunderstood Jonas' feedback - fix this so we'll
Jason Molenda [Mon, 18 Feb 2019 22:13:34 +0000 (22:13 +0000)]
Ah, misunderstood Jonas' feedback - fix this so we'll
do the right thing when both API are available.  We
want to try both of them if the first one fails.

llvm-svn: 354288

5 years agoClean up an unused variable warning when building this for
Jason Molenda [Mon, 18 Feb 2019 22:10:23 +0000 (22:10 +0000)]
Clean up an unused variable warning when building this for
mac native.

llvm-svn: 354287

5 years ago[Python3] Fix TestObjCMethods.py to work with py2 and 3.
Davide Italiano [Mon, 18 Feb 2019 21:53:02 +0000 (21:53 +0000)]
[Python3] Fix TestObjCMethods.py to work with py2 and 3.

llvm-svn: 354286

5 years ago[libcxxabi][CMake] Drop unused HandleOutOfTreeLLVM include
Petr Hosek [Mon, 18 Feb 2019 20:58:06 +0000 (20:58 +0000)]
[libcxxabi][CMake] Drop unused HandleOutOfTreeLLVM include

This include doesn't seem to be needed for the standalone build (it's
not being used by libc++ build either), but introduces unnecessary
dependency because HandleOutOfTreeLLVM performs checks that require
a working C++ library. We shouldn't require a working C++ library to
build libc++abi or libc++ (it's what we're building after all).

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

llvm-svn: 354284

5 years ago[Reproducers] Make clang use lldb's VFS.
Jonas Devlieghere [Mon, 18 Feb 2019 20:31:18 +0000 (20:31 +0000)]
[Reproducers] Make clang use lldb's VFS.

In r353906 we hooked up clang and lldb's reproducer infrastructure to
capture files used by clang. This patch adds the necessary logic to have
clang reuse the files from lldb's reproducer during replay.

Differential revision: https://reviews.llvm.org/D58309

llvm-svn: 354283

5 years ago[Sanitizer] On Darwin `__sanitizer_print_stack_trace` only prints topmost frame
Julian Lettner [Mon, 18 Feb 2019 18:47:49 +0000 (18:47 +0000)]
[Sanitizer] On Darwin `__sanitizer_print_stack_trace` only prints topmost frame

In compiler-rt we have the notion of a `fast` and a `slow` stack
unwinder. Darwin currently only supports the fast unwinder.

From reading the code, my understanding is that
`BufferedStackTrace::Unwind` can be called with `bp=0, stack_top=0,
stack_bottom=0, request_fast_unwind=false`. If
`request_fast_unwind=true`, then we alos need to supply bp, stack_top,
and stack_bottom.

However, `BufferedStackTrace::Unwind` uses
`StackTrace::WillUseFastUnwind` which will adapt `request_fast_unwind`
if the requested unwinder is not supported. On Darwin, the result is
that we don't pass actual values for bp, stack_top, and stack_bottom,
but end up using the fast unwinder. The tests then fail because we only
print the topmost stack frame.

This patch adds a check to `WillUseFastUnwind` at the point of usage to
avoid the mismatch between `request_fast_unwind` and what `Unwind`
actually does. I am also interested in cleaning up the
`request_fast_unwind` machinery so this patch just the simplest thing
possible so I can enable the tests.

Reviewers: vitalybuka, vsk

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

llvm-svn: 354282

5 years agoGlobalISel: Fix double count of offset for irregular vector breakdowns
Matt Arsenault [Mon, 18 Feb 2019 17:01:09 +0000 (17:01 +0000)]
GlobalISel: Fix double count of offset for irregular vector breakdowns

Fixes cases with odd vectors that break into multiple requested size
pieces.

llvm-svn: 354280

5 years ago[x86] split more v8f32/v8i32 shuffles in lowering
Sanjay Patel [Mon, 18 Feb 2019 16:46:12 +0000 (16:46 +0000)]
[x86] split more v8f32/v8i32 shuffles in lowering

Similar to D57867 - this is a small patch with lots of test diffs.
With half-vector-width narrowing potential, using an extract + 128-bit vshufps
is a win because it replaces a 256-bit shuffle with a 128-bit shufle.

This seems like it should be a win even for targets with 'fast-variable-shuffle',
but we are intentionally deferring that to an independent change to make sure
that is true.

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

llvm-svn: 354279

5 years agoUn-XFAIL TestLinuxCore for windows
Pavel Labath [Mon, 18 Feb 2019 16:05:26 +0000 (16:05 +0000)]
Un-XFAIL TestLinuxCore for windows

It turns out all that was needed to get this test passing was to fix the
python3 incompatibility.

llvm-svn: 354278

5 years agoRevert "[InstCombine] reduce even more unsigned saturated add with 'not' op"
Sanjay Patel [Mon, 18 Feb 2019 16:04:22 +0000 (16:04 +0000)]
Revert "[InstCombine] reduce even more unsigned saturated add with 'not' op"

This reverts commit 079b610c29b4a428b3ae7b64dbac0378facf6632.
Bots are failing after this change on a stage 2 compile of clang.

llvm-svn: 354277

5 years ago[InstCombine] reduce even more unsigned saturated add with 'not' op
Sanjay Patel [Mon, 18 Feb 2019 15:21:39 +0000 (15:21 +0000)]
[InstCombine] reduce even more unsigned saturated add with 'not' op

We want to use the sum in the icmp to allow matching with
m_UAddWithOverflow and eliminate the 'not'. This is discussed
in D51929 and is another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

  Name: uaddsat, -1 fval
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ugt i32 %notx, %y
  %r = select i1 %c, i32 %a, i32 -1
  =>
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a
  %r = select i1 %c2, i32 -1, i32 %a

  Name: uaddsat, -1 fval + ult
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ult i32 %y, %notx
  %r = select i1 %c, i32 %a, i32 -1
  =>
  %a = add i32 %x, %y
  %c2 = icmp ugt i32 %y, %a
  %r = select i1 %c2, i32 -1, i32 %a

https://rise4fun.com/Alive/nTp

llvm-svn: 354276

5 years agoFix TestLinuxCore for python3
Pavel Labath [Mon, 18 Feb 2019 15:04:33 +0000 (15:04 +0000)]
Fix TestLinuxCore for python3

- dictionaries don't have iteritems()
- division returns floats

llvm-svn: 354273

5 years ago[clangd] Add tests for template specializations
Kadir Cetinkaya [Mon, 18 Feb 2019 14:23:19 +0000 (14:23 +0000)]
[clangd] Add tests for template specializations

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 354272

5 years ago[MCA] Correctly update register definitions in the PRF after move elimination.
Andrea Di Biagio [Mon, 18 Feb 2019 14:15:25 +0000 (14:15 +0000)]
[MCA] Correctly update register definitions in the PRF after move elimination.

This patch fixes a bug where register writes performed by optimizable register
moves were sometimes wrongly treated like partial register updates.  Before this
patch, llvm-mca wrongly predicted a 1.50 IPC for test reg-move-elimination-6.s
(added by this patch).  With this patch, llvm-mca correctly updates the register
defintions in the PRF, and the IPC for that test is now correctly reported as 2.

llvm-svn: 354271

5 years ago[llvm-readobj] - Simplify .gnu.version_d dumping.
George Rimar [Mon, 18 Feb 2019 13:58:12 +0000 (13:58 +0000)]
[llvm-readobj] - Simplify .gnu.version_d dumping.

This is similar to D58048.

Instead of scanning the dynamic table to read the
DT_VERDEFNUM, we could take it from the sh_info field.
(https://docs.oracle.com/cd/E19683-01/816-1386/chapter6-94076/index.html)

The patch does this.

llvm-svn: 354270

5 years ago[clangd] Cache include fixes for diagnostics caused by the same unresolved name or...
Eric Liu [Mon, 18 Feb 2019 13:12:10 +0000 (13:12 +0000)]
[clangd] Cache include fixes for diagnostics caused by the same unresolved name or incomplete type.

Summary:
Multiple diagnostics can be caused by the same unresolved name or incomplete type,
especially if the code is copy-pasted without #includes. The cache can avoid making
repetitive index requests, and thus reduce latency and allow more diagnostics to be
fixed (we limit the number of index requests for each parse).

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354268

5 years ago[ASTImporter] Find previous friend function template
Gabor Marton [Mon, 18 Feb 2019 13:09:27 +0000 (13:09 +0000)]
[ASTImporter] Find previous friend function template

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 354267

5 years ago[clang-tidy] Fix links in docs.
Alexander Kornienko [Mon, 18 Feb 2019 12:50:35 +0000 (12:50 +0000)]
[clang-tidy] Fix links in docs.

llvm-svn: 354266

5 years ago[ARM] Add pre-defined macros for ROPI and RWPI
Oliver Stannard [Mon, 18 Feb 2019 12:39:47 +0000 (12:39 +0000)]
[ARM] Add pre-defined macros for ROPI and RWPI

This adds ACLE-defined macros to test for code being compiled in the ROPI and
RWPI position-independence modes.

Differential revision: https://reviews.llvm.org/D23610

llvm-svn: 354265

5 years ago[NFC] Make Optional<T> trivially copyable when T is trivially copyable
Serge Guelton [Mon, 18 Feb 2019 12:07:12 +0000 (12:07 +0000)]
[NFC] Make Optional<T> trivially copyable when T is trivially copyable

This is a follow-up to r354246 and a reimplementation of https://reviews.llvm.org/D57097?id=186600
that should not trigger any UB thanks to the use of an union.

This may still be subject to the problem solved by std::launder, but I'm unsure how it interacts whith union.
/me plans to revert if this triggers any relevant bot failure. At least this validates in Release mode with
clang 6.0.1 and gcc 4.8.5.

llvm-svn: 354264

5 years agominidump: Add ability to attach (breakpad) symbol files to placeholder modules
Pavel Labath [Mon, 18 Feb 2019 11:55:01 +0000 (11:55 +0000)]
minidump: Add ability to attach (breakpad) symbol files to placeholder modules

This re-commits r353677, which was reverted due to test failures on the
windows bot. The issue there was that ObjectFilePECOFF vended its base
address through the incorrect interface. SymbolFilePDB depended on that,
which lead to assertion failures when SymbolFilePDB was attempting to
use the placeholder object files as a base. This has been fixed in
r354258

It also fixes one small problem in the original patch. The issue was that the
Module class would attempt to overwrite the object file we created in
CreateModuleFromObjectFile if the file corresponding to the placeholder object
file happened to exist (but we have already disqualified it due to UUID
mismatch. The fix is simple -- we set the m_did_load_objfile flag to properly
record the fact that we have already created an object file for the module.

The original commit message was:

The reason this wasn't working was that ProcessMinidump was creating odd
object-file-less modules, and SymbolFileBreakpad required the module to
have an associated object file because it needed to get its base
address.

This fixes that by introducing a PlaceholderObjectFile to serve as a
dummy object file. The general idea for this is taken from D55142, but
I've reworked it a bit to avoid the need for the PlaceholderModule
class. Now that we have an object file, our modules are sufficiently
similar to regular modules that we can use the regular Module class
almost out of the box -- the only thing I needed to tweak was the
Module::CreateModuleFromObjectFile functon to set the module's FileSpec
in addition to it's architecture. This wasn't needed for ObjectFileJIT
(the other user of CreateModuleFromObjectFile), but it shouldn't hurt it
either, and the change seems like a straightforward extension of this
function.

Reviewers: clayborg, lemo, amccarth

Subscribers: lldb-commits

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

llvm-svn: 354263

5 years ago[clang][Index] Fix usage of IndexImplicitInstantiation
Kadir Cetinkaya [Mon, 18 Feb 2019 11:30:43 +0000 (11:30 +0000)]
[clang][Index] Fix usage of IndexImplicitInstantiation

Summary:
Indexing context was skipping explicit template instantiations as well.
This patch makes sure it only skips implicit ones.

Subscribers: arphaman, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 354262

5 years ago[MCA] Slightly refactor method writeStartEvent in WriteState and ReadState. NFCI
Andrea Di Biagio [Mon, 18 Feb 2019 11:27:11 +0000 (11:27 +0000)]
[MCA] Slightly refactor method writeStartEvent in WriteState and ReadState. NFCI

This is another change in preparation for PR37494.
No functional change intended.

llvm-svn: 354261

5 years ago[ASTImporter] Unify redecl chain tests as type parameterized tests
Gabor Marton [Mon, 18 Feb 2019 11:09:56 +0000 (11:09 +0000)]
[ASTImporter] Unify redecl chain tests as type parameterized tests

Summary:
This patch unifies all those tests which check the correctness of the
redecl chains. Previously we had several structurally very similar test
cases for each language construct (class, function, variable, function
template, ...).

We still use value-parameterized tests for the different AST
compatibility switches (-fdelayed-template-parsing, -fms-compatibility).
Gtest makes it possible to have either value-parameterized or
type-parameterized fixtures. However, we cannot have both value- and
type-parameterized test fixtures. So we use a value-parameterized test
fixture in the gtest sense. We intend to mimic gtest's type-parameters
via the type template parameter. We manually instantiate the different
tests with the each types.

After this patch I am planning to put the "generic redecl chain" related
tests into their own separate test file (in another patch).

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

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

llvm-svn: 354259

5 years agoPECOFF: Implement GetBaseAddress
Pavel Labath [Mon, 18 Feb 2019 11:06:57 +0000 (11:06 +0000)]
PECOFF: Implement GetBaseAddress

COFF files are modelled in lldb as having one big container section
spanning the entire module image, with the actual sections being
subsections of that. In this model, the base address is simply the
address of the first byte of that section.

This also removes the hack where ObjectFilePECOFF was using the
m_file_offset field to communicate this information. Using file offset
for this purpose is completely wrong, as that is supposed to indicate
where is this ObjectFile located in the file on disk. This field is only
meaningful for fat binaries, and should normally be 0.

Both PDB plugins have been updated to use GetBaseAddress instead of
GetFileOffset.

llvm-svn: 354258

5 years agoReturn better error message from GDBRemoteCommunication::ConnectLocally
Pavel Labath [Mon, 18 Feb 2019 10:36:23 +0000 (10:36 +0000)]
Return better error message from GDBRemoteCommunication::ConnectLocally

llvm-svn: 354256

5 years agoSet cmake policy CMP0075 to NEW
Pavel Labath [Mon, 18 Feb 2019 10:09:29 +0000 (10:09 +0000)]
Set cmake policy CMP0075 to NEW

Summary:
The policy is about cmake_include_files ignoring
CMAKE_REQUIRED_LIBRARIES in the OLD behavior. Llvm already sets this
policy to NEW, but that is overridden by our cmake_minimum_required
command.

This makes our cmake policy setup consistent with the llvm build files
and avoids a warning when using newer versions of cmake.

Reviewers: sgraenitz, xiaobai

Subscribers: mgorny, lldb-commits

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

llvm-svn: 354251

5 years ago[llvm-exegesis] [NFC] Fixing typo.
Guillaume Chatelet [Mon, 18 Feb 2019 10:08:20 +0000 (10:08 +0000)]
[llvm-exegesis] [NFC] Fixing typo.

Reviewers: courbet, gchatelet

Reviewed By: courbet, gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 354250

5 years agoRecommit [NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Mon, 18 Feb 2019 08:46:32 +0000 (08:46 +0000)]
Recommit [NFC] Better encapsulation of llvm::Optional Storage

Second attempt, trying to navigate out of the UB zone using
union for storage instead of raw bytes.

I'm prepared to revert that commit as soon as validation breaks,
which is likely to happen.

llvm-svn: 354246

5 years agoRevert r354244 "[DAGCombiner] Eliminate dead stores to stack."
Clement Courbet [Mon, 18 Feb 2019 08:24:29 +0000 (08:24 +0000)]
Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."

Breaks some bots.

llvm-svn: 354245

5 years ago[DAGCombiner] Eliminate dead stores to stack.
Clement Courbet [Mon, 18 Feb 2019 07:59:01 +0000 (07:59 +0000)]
[DAGCombiner] Eliminate dead stores to stack.

Summary:
A store to an object whose lifetime is about to end can be removed.

See PR40550 for motivation.

Reviewers: niravd

Subscribers: llvm-commits

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

llvm-svn: 354244

5 years ago[MC] Make SubtargetFeatureKV only store one FeatureBitset and use an 'unsigned' to...
Craig Topper [Mon, 18 Feb 2019 06:46:17 +0000 (06:46 +0000)]
[MC] Make SubtargetFeatureKV only store one FeatureBitset and use an 'unsigned' to hold the value.

This class is used for two difference tablegen generated tables. For one of the tables the Value FeatureBitset only has one bit set. For the other usage the Implies field was unused.

This patch changes the Value field to just be an unsigned. For the usage that put a real vector in bitset, we now use the previously unused Implies field and leave the Value field unused instead.

This is good for a 16K reduction in the size of llc on my local build with all targets enabled.

llvm-svn: 354243

5 years agogn build: Merge r354156
Nico Weber [Mon, 18 Feb 2019 01:36:52 +0000 (01:36 +0000)]
gn build: Merge r354156

llvm-svn: 354242

5 years agolld-link: Mention comdat selection work in the 9.0.0 wip release notes
Nico Weber [Mon, 18 Feb 2019 01:32:16 +0000 (01:32 +0000)]
lld-link: Mention comdat selection work in the 9.0.0 wip release notes

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

llvm-svn: 354241

5 years agoRevert [NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Sun, 17 Feb 2019 23:01:41 +0000 (23:01 +0000)]
Revert [NFC] Better encapsulation of llvm::Optional Storage

llvm-svn: 354240

5 years ago[NFC] Better encapsulation of llvm::Optional Storage, part II
Serge Guelton [Sun, 17 Feb 2019 22:54:23 +0000 (22:54 +0000)]
[NFC] Better encapsulation of llvm::Optional Storage, part II

Fix for better Windows support.

llvm-svn: 354239

5 years ago[NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Sun, 17 Feb 2019 22:41:14 +0000 (22:41 +0000)]
[NFC] Better encapsulation of llvm::Optional Storage

Second attempt, trying to navigate out of the UB zone using
union for storage instead of raw bytes.

I'm prepared to revert that commit as soon as validation breaks,
which is likely to happen.

llvm-svn: 354238

5 years ago[LLVM-C] Add bindings to create enumerators
Robert Widmann [Sun, 17 Feb 2019 21:25:47 +0000 (21:25 +0000)]
[LLVM-C] Add bindings to create enumerators

Summary: The C API don't have the bindings to create enumerators, needed to create an enumeration.

Reviewers: whitequark, CodaFi, harlanhaskins, deadalnix

Reviewed By: whitequark, CodaFi, harlanhaskins

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 354237

5 years ago[InstCombine] add even more tests for unsigned saturated add; NFC
Sanjay Patel [Sun, 17 Feb 2019 20:01:59 +0000 (20:01 +0000)]
[InstCombine] add even more tests for unsigned saturated add; NFC

The pattern-matching from rL354221 / rL354224 doesn't cover
these, so we're up to 8 different commuted possibilities.

There may still be 1 more variant of this pattern.

llvm-svn: 354236

5 years ago[analyzer] Make valist.Uninitialized depend on ValistBase
Kristof Umann [Sun, 17 Feb 2019 19:51:42 +0000 (19:51 +0000)]
[analyzer] Make valist.Uninitialized depend on ValistBase

Accidentally left this dependency out, resulting in an assert failure if
only valist.Uninitialized is enabled from the valist package.

llvm-svn: 354235

5 years ago[X86] In FP_TO_INTHelper, when moving data from SSE register to X87 register file...
Craig Topper [Sun, 17 Feb 2019 19:23:49 +0000 (19:23 +0000)]
[X86] In FP_TO_INTHelper, when moving data from SSE register to X87 register file via the stack, use the same stack slot we use for the integer conversion.

No need for a separate stack slot. The lifetimes don't overlap.

Also fix the MachinePointerInfo for the final load after the integer conversion to indicate it came from the stack slot.

llvm-svn: 354234

5 years ago[NFC] Add a llvm_unreachable to silence a warning in SubstObjCTypeArgsVisitor
Bruno Ricci [Sun, 17 Feb 2019 19:18:38 +0000 (19:18 +0000)]
[NFC] Add a llvm_unreachable to silence a warning in SubstObjCTypeArgsVisitor

All cases in the switch are covered. NFC.

llvm-svn: 354233

5 years agoRecommit "[AST] Factor out the logic of the various Expr::Ignore*"
Bruno Ricci [Sun, 17 Feb 2019 18:50:51 +0000 (18:50 +0000)]
Recommit "[AST] Factor out the logic of the various Expr::Ignore*"

(Originally commited in r354215 and reverted in r354216 because of a
 missed failing clang-tidy test (fix in r354228))

Now that the implementation of all of the Expr::Ignore* is in Expr.cpp
we can try to remove some duplication. Do this by separating the logic
of the Expr::Ignore* from the iterative loop.

This is NFC, except for one change: IgnoreParenImpCasts now skips,
among other things, everything that IgnoreImpCasts skips. This means
FullExpr are now skipped by IgnoreParenImpCasts. This was likely an
oversight when FullExpr was added to the nodes skipped by IgnoreImpCasts.

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

Reviewed By: aaron.ballman (with comments from void and rnk)

llvm-svn: 354232

5 years ago[compiler-rt] Fix broken sanitizer bots (hopefully)
Jonas Hahnfeld [Sun, 17 Feb 2019 18:47:33 +0000 (18:47 +0000)]
[compiler-rt] Fix broken sanitizer bots (hopefully)

According to the logs and local debugging there were two issues:
1) tsan tests listed libc++.a before the source file. That's usually
   ok for shared libraries, but the linker will not add symbols from
   a static library unless needed at that time. As a result the tests
   that rely upon symbols from the library (and not only include the
   headers) had undefined references.
   To solve this I'm adding a new substitution %link_libcxx_tsan which
   expands to libc++.a if available.
2) The target Fuzzer-x86_64-Test linked in SANITIZER_TEST_CXX_LIBRARIES
   which defaults to -lstdc++. This resulted in error messages like
     hidden symbol '_ZdlPv' is not defined locally
     hidden symbol '_Znwm' is not defined locally
   when using GNU gold (ld.bfd and lld are fine). Removing the linkage
   is fine because we build a custom libc++ for that purpose.

llvm-svn: 354231

5 years ago[TEST] Remove 2>&1 from tests
Max Kazantsev [Sun, 17 Feb 2019 18:22:00 +0000 (18:22 +0000)]
[TEST] Remove 2>&1 from tests

Avoid confusing CHECKS with debug dumps of sets that can be printed differently.

llvm-svn: 354229

5 years ago[clang-tidy][NFCI] DanglingHandleCheck: Remove a superflous IgnoreParenImpCasts
Bruno Ricci [Sun, 17 Feb 2019 18:21:54 +0000 (18:21 +0000)]
[clang-tidy][NFCI] DanglingHandleCheck: Remove a superflous IgnoreParenImpCasts

ExprWithCleanups is currently not skipped by IgnoreParenImpCasts, but is skipped
by IgnoreImpCasts. In view of fixing this inconsistency in D57267, remove the
IgnoreParenImpCasts between the ReturnStmt and the ExprWithCleanups which
is not needed since ExprWithCleanups is always created as a direct child of
ReturnStmt (by inspection of each ReturnStmt::Create in Sema/SemaStmt.cpp).

NFC intended.

llvm-svn: 354228

5 years ago[NFC] Teach getInnermostLoopFor walk up the loop trees
Max Kazantsev [Sun, 17 Feb 2019 18:21:51 +0000 (18:21 +0000)]
[NFC] Teach getInnermostLoopFor walk up the loop trees

This should be NFC in current use case of this method, but it will
help to use it for solving more compex tasks in follow-up patches.

llvm-svn: 354227

5 years ago[SelectionDAG] Extract [US]MULO expansion into TL method; NFC
Nikita Popov [Sun, 17 Feb 2019 17:40:47 +0000 (17:40 +0000)]
[SelectionDAG] Extract [US]MULO expansion into TL method; NFC

In preparation for supporting vector expansion.

Add an isPostTypeLegalization flag to makeLibCall(), because this
expansion relies on the legalized form using MERGE_VALUES. Drop
the corresponding variant of ExpandLibCall, which is no longer used.

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

llvm-svn: 354226

5 years agoRemove unused extern declaration as removed by D32167
Jan Kratochvil [Sun, 17 Feb 2019 17:12:37 +0000 (17:12 +0000)]
Remove unused extern declaration as removed by D32167

llvm-svn: 354225

5 years ago[InstCombine] reduce more unsigned saturated add with 'not' op
Sanjay Patel [Sun, 17 Feb 2019 16:48:50 +0000 (16:48 +0000)]
[InstCombine] reduce more unsigned saturated add with 'not' op

We want to use the sum in the icmp to allow matching with
m_UAddWithOverflow and eliminate the 'not'. This is discussed
in D51929 and is another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

  Name: not op
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ult i32 %notx, %y
  %r = select i1 %c, i32 -1, i32 %a
  =>
  %a = add i32 %x, %y
  %c2 = icmp ult i32 %a, %y
  %r = select i1 %c2, i32 -1, i32 %a

  Name: not op ugt
  %notx = xor i32 %x, -1
  %a = add i32 %x, %y
  %c = icmp ugt i32 %y, %notx
  %r = select i1 %c, i32 -1, i32 %a
  =>
  %a = add i32 %x, %y
  %c2 = icmp ult i32 %a, %y
  %r = select i1 %c2, i32 -1, i32 %a

https://rise4fun.com/Alive/niom

(The matching here is still incomplete.)

llvm-svn: 354224

5 years ago[InstCombine] add more tests for unsigned saturated add; NFC
Sanjay Patel [Sun, 17 Feb 2019 16:44:11 +0000 (16:44 +0000)]
[InstCombine] add more tests for unsigned saturated add; NFC

Extend the pattern-matching from rL354219 / rL354221.

llvm-svn: 354223

5 years ago[RISCV] Default enable RISCV linker relaxation
Shiva Chen [Sun, 17 Feb 2019 16:05:51 +0000 (16:05 +0000)]
[RISCV] Default enable RISCV linker relaxation

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

llvm-svn: 354222

5 years ago[InstCombine] reduce unsigned saturated add with 'not' op
Sanjay Patel [Sun, 17 Feb 2019 15:58:48 +0000 (15:58 +0000)]
[InstCombine] reduce unsigned saturated add with 'not' op

We want to use the sum in the icmp to allow matching with
m_UAddWithOverflow and eliminate the 'not'. This is discussed
in D51929 and is another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

(The matching here is incomplete. Trying to take minimal steps
to make sure we don't induce infinite looping from existing
canonicalizations of the 'select'.)

llvm-svn: 354221

5 years ago[NFC] Fix name and clarifying comment for factored-out function
Max Kazantsev [Sun, 17 Feb 2019 15:22:48 +0000 (15:22 +0000)]
[NFC] Fix name and clarifying comment for factored-out function

llvm-svn: 354220

5 years ago[InstCombine] add tests for unsigned saturated add; NFC
Sanjay Patel [Sun, 17 Feb 2019 15:09:41 +0000 (15:09 +0000)]
[InstCombine] add tests for unsigned saturated add; NFC

We're missing IR canonicalizations for this op as shown in D51929.

llvm-svn: 354219

5 years ago[NFC] Factor out a function for future reuse
Max Kazantsev [Sun, 17 Feb 2019 15:04:09 +0000 (15:04 +0000)]
[NFC] Factor out a function for future reuse

llvm-svn: 354218

5 years agoRevert [NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Sun, 17 Feb 2019 14:59:21 +0000 (14:59 +0000)]
Revert  [NFC] Better encapsulation of llvm::Optional Storage

I'm getting the feealing that current Optional implementation is full of UB :-/

llvm-svn: 354217

5 years agoRevert "[AST] Factor out the logic of the various Expr::Ignore*"
Bruno Ricci [Sun, 17 Feb 2019 13:47:29 +0000 (13:47 +0000)]
Revert "[AST] Factor out the logic of the various Expr::Ignore*"

This breaks some clang-tidy checks. For some reason they were
not included in check-clang ?

llvm-svn: 354216

5 years ago[AST] Factor out the logic of the various Expr::Ignore*
Bruno Ricci [Sun, 17 Feb 2019 13:32:39 +0000 (13:32 +0000)]
[AST] Factor out the logic of the various Expr::Ignore*

Now that the implementation of all of the Expr::Ignore* is in Expr.cpp
we can try to remove some duplication. Do this by separating the logic of
the Expr::Ignore* from the iterative loop.

This is NFC, except for one change: IgnoreParenImpCasts now skips, among
other things, everything that IgnoreImpCasts skips. This means FullExpr
are now skipped by IgnoreParenImpCasts. This was likely an oversight when
FullExpr was added to the nodes skipped by IgnoreImpCasts.

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

Reviewed By: aaron.ballman (with comments from void and rnk)

llvm-svn: 354215

5 years ago[NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Sun, 17 Feb 2019 13:12:42 +0000 (13:12 +0000)]
[NFC] Better encapsulation of llvm::Optional Storage

llvm-svn: 354214

5 years ago[compiler-rt] Build custom libcxx with libcxxabi
Jonas Hahnfeld [Sun, 17 Feb 2019 12:16:20 +0000 (12:16 +0000)]
[compiler-rt] Build custom libcxx with libcxxabi

This changes add_custom_libcxx to also build libcxxabi and merges
the two into a static and hermetic library.
There are multiple advantages:
1) The resulting libFuzzer doesn't expose C++ internals and looks
   like a plain C library.
2) We don't have to manually link in libstdc++ to provide cxxabi.
3) The sanitizer tests cannot interfere with an installed version
   of libc++.so in LD_LIBRARY_PATH.

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

llvm-svn: 354212

5 years ago[X86] Prevent clang clobber checking for asm flag constraints.
Nirav Dave [Sun, 17 Feb 2019 03:53:23 +0000 (03:53 +0000)]
[X86] Prevent clang clobber checking for asm flag constraints.

Update getConstraintRegister as X86 Asm flag output constraints are no
longer fully alphanumeric,

llvm-svn: 354211

5 years ago[Driver][Gnu] Support -nolibc flag
Petr Hosek [Sun, 17 Feb 2019 02:42:48 +0000 (02:42 +0000)]
[Driver][Gnu] Support -nolibc flag

This can be used to disable libc linking. This flag is supported by
GCC since version 9 as well as some Clang target toolchains.

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

llvm-svn: 354210

5 years ago[LLVMSupport]: Remove a severely outdated README.
Kristina Brooks [Sun, 17 Feb 2019 01:52:18 +0000 (01:52 +0000)]
[LLVMSupport]: Remove a severely outdated README.

The LLVM Support library implementation has resided in
//llvm/lib/Support for a significant amount of time now,
with documentation having been updated with all references
to the "System library" being replaced with "Support library".

Since this file mirrors already existing documentation available
for Support library, includes dead links to documentation and
still refers to it as "System library", having it there is
confusing and updating it has very little point as it duplicates
information in documentation, except documentation is a lot more
up to date while this file has not been maintained.

Up to date documentation concerning this can be found here:
  http://llvm.org/docs/SupportLibrary.html

llvm-svn: 354209

5 years ago[Driver][Fuchsia] Support -nolibc flag
Petr Hosek [Sun, 17 Feb 2019 01:02:40 +0000 (01:02 +0000)]
[Driver][Fuchsia] Support -nolibc flag

This can be used to disable libc linking. This flag is supported by
GCC since version 9 as well as some Clang target toolchains. This
change also includes tests for all -no* flags which previously weren't
covered.

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

llvm-svn: 354208

5 years ago[bindings/go] Fix building on 32-bit systems (ARM etc.)
whitequark [Sat, 16 Feb 2019 22:33:10 +0000 (22:33 +0000)]
[bindings/go] Fix building on 32-bit systems (ARM etc.)

Summary:
The patch in https://reviews.llvm.org/D53883 (by me) fails to build on 32-bit systems like ARM. Fix the array size to be less ridiculously large. 2<<20 should still be enough for all practical purposes.

Bug: https://bugs.llvm.org/show_bug.cgi?id=40426

Reviewers: whitequark, pcc

Reviewed By: whitequark

Subscribers: javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

llvm-svn: 354207

5 years agoAdd PythonBoolean type to the PythonDataObjects
Tatyana Krasnukha [Sat, 16 Feb 2019 18:39:14 +0000 (18:39 +0000)]
Add PythonBoolean type to the PythonDataObjects

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

llvm-svn: 354206

5 years agoFixed code snippet in Kaleidoscope tutorial to reflect final full code listing
Wilfred Hughes [Sat, 16 Feb 2019 18:37:55 +0000 (18:37 +0000)]
Fixed code snippet in Kaleidoscope tutorial to reflect final full code listing

Patch by Frank He.

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

llvm-svn: 354205

5 years ago[testsuite] Skip this test correctly also on macOS.
Davide Italiano [Sat, 16 Feb 2019 17:16:53 +0000 (17:16 +0000)]
[testsuite] Skip this test correctly also on macOS.

llvm-svn: 354204

5 years agoFix typo in docs
Dmitri Gribenko [Sat, 16 Feb 2019 14:51:44 +0000 (14:51 +0000)]
Fix typo in docs

Patch by Alex Yursha.

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

llvm-svn: 354203

5 years agoFix TestDataFormatterLibcxxListLoop.py test
Raphael Isemann [Sat, 16 Feb 2019 12:13:30 +0000 (12:13 +0000)]
Fix TestDataFormatterLibcxxListLoop.py test

Summary:
The compilation of the TestDataFormatterLibcxxListLoop.py currently fails with this error:

```
functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp:19:24: error: no member named '__value_' in 'std::__1::__list_node_base<int, void *>'
    assert(third_elem->__value_ == 3);
           ~~~~~~~~~~  ^
```

It seems the internal structure of list has changed with the 3.8 release. This patch makes the test compile with the current libc++ and with the previous libc++.

Reviewers: shafik, zturner, labath

Reviewed By: labath

Subscribers: christof, jdoerfert, lldb-commits

Tags: #lldb

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

llvm-svn: 354202

5 years agoMove multiline raw string literal out of macro. NFC
David Green [Sat, 16 Feb 2019 11:19:04 +0000 (11:19 +0000)]
Move multiline raw string literal out of macro. NFC

Certain combinations of gcc and ccache fail when the raw
string literal is preprocessed. This just moves the string
out as is done elsewhere in the same file.

llvm-svn: 354201

5 years agoRevert r354199: Make Optional<T> Trivially Copyable when T is trivially copyable
Serge Guelton [Sat, 16 Feb 2019 09:47:23 +0000 (09:47 +0000)]
Revert r354199: Make Optional<T> Trivially Copyable when T is trivially copyable

llvm-svn: 354200

5 years agoMake Optional<T> Trivially Copyable when T is trivially copyable
Serge Guelton [Sat, 16 Feb 2019 09:19:58 +0000 (09:19 +0000)]
Make Optional<T> Trivially Copyable when T is trivially copyable

This is another attempt in the process, works nicely on my setup,
let's check how it behaves on other targets.

llvm-svn: 354199

5 years ago[compiler-rt] Cleanup usage of C++ ABI library
Jonas Hahnfeld [Sat, 16 Feb 2019 08:34:26 +0000 (08:34 +0000)]
[compiler-rt] Cleanup usage of C++ ABI library

Add missed value "libcxxabi" and introduce SANITIZER_TEST_CXX for linking
unit tests. This needs to be a full C++ library and cannot be libcxxabi.

Recommit r354132 which I reverted in r354153 because it broke a sanitizer
bot. This was because of the "fixes" for pthread linking, so I've removed
these changes.

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

llvm-svn: 354198

5 years ago[X86] When type legalizing the result of a i64 fp_to_uint on 32-bit targets. Generate...
Craig Topper [Sat, 16 Feb 2019 08:25:42 +0000 (08:25 +0000)]
[X86] When type legalizing the result of a i64 fp_to_uint on 32-bit targets. Generate all of the ops as i64 and let them be legalized.

No need to manually split everything. We can let the type legalizer work for us.

The test change seems to be caused by some DAG ordering issue that was previously circumventing a one use check in LowerSELECT where FP selects are turned into blends if the setcc has one use. But it was running after an integer select and the same setcc had been legalized to cmov and X86SISD::CMP. This dropped the use count of the setcc, but wasn't what was intended.

llvm-svn: 354197

5 years agollvm-nm: Observe -no-llvm-bc for archive members
Dave Lee [Sat, 16 Feb 2019 06:59:49 +0000 (06:59 +0000)]
llvm-nm: Observe -no-llvm-bc for archive members

Summary:
This change fixes the `-no-llvm-bc` flag to work with object files within
archives. Currently the `-no-llvm-bc` flag works for regular object files, but
not static libraries, where it continues to show bitcode symbol info.

Original support was added in D4371.

Reviewers: compnerd, smeenai, pcc

Reviewed By: compnerd

Subscribers: rupprecht, keith, llvm-commits

Tags: #llvm

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

llvm-svn: 354196

5 years ago[clang-tidy] Delete obsolete objc-property-declaration options ✂️
Stephane Moore [Sat, 16 Feb 2019 04:27:12 +0000 (04:27 +0000)]
[clang-tidy] Delete obsolete objc-property-declaration options ✂️

Summary:
The Acronyms and IncludeDefaultAcronyms options were deprecated in
https://reviews.llvm.org/D51832. These options can be removed.

Tested by running the clang-tidy tests.

This is an amended resubmission of https://reviews.llvm.org/D56945.

Reviewers: Eugene.Zelenko, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 354195

5 years ago[CMake] Use variables rather than ":" delimiters
Petr Hosek [Sat, 16 Feb 2019 03:57:35 +0000 (03:57 +0000)]
[CMake] Use variables rather than ":" delimiters

This is a follow up to D37644, this block was missed in that change.

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

llvm-svn: 354194

5 years ago[X86] Don't prevent load folding for cvtsi2ss/cvtsi2sd based on hasPartialRegUpdate.
Craig Topper [Sat, 16 Feb 2019 03:34:54 +0000 (03:34 +0000)]
[X86] Don't prevent load folding for cvtsi2ss/cvtsi2sd based on hasPartialRegUpdate.

Preventing the load fold won't fix the partial register update since the
input we can fold is a GPR. So it will do nothing to prevent a false dependency
on an XMM register.

llvm-svn: 354193

5 years agoFix some tests I broke in r354190
Erik Pilkington [Sat, 16 Feb 2019 01:51:19 +0000 (01:51 +0000)]
Fix some tests I broke in r354190

This was breaking on MSVC, since long double and double have the same
semantics there.

llvm-svn: 354192

5 years ago[libFuzzer] make len_control less agressive: set the initial max len to the length...
Kostya Serebryany [Sat, 16 Feb 2019 01:23:41 +0000 (01:23 +0000)]
[libFuzzer] make len_control less agressive: set the initial max len to the length of the largest seed. This was the original intent, but... Now, with a test, to ensure it stays this way

llvm-svn: 354191

5 years ago[Sema] Diagnose floating point conversions based on target semantics
Erik Pilkington [Sat, 16 Feb 2019 01:11:47 +0000 (01:11 +0000)]
[Sema] Diagnose floating point conversions based on target semantics

...instead of just comparing rank. Also, fix a bad warning about
_Float16, since its declared out of order in BuiltinTypes.def,
meaning comparing rank using BuiltinType::getKind() is incorrect.

Differential revision: https://reviews.llvm.org/D58254

llvm-svn: 354190

5 years ago[ObjC generics] Fix applying `__kindof` to the type parameter.
Volodymyr Sapsai [Sat, 16 Feb 2019 01:01:08 +0000 (01:01 +0000)]
[ObjC generics] Fix applying `__kindof` to the type parameter.

Fixes the warning about incompatible pointer types on assigning to a
subclass of type argument an expression of type `__kindof TypeParam`.

We already have a mechanism in `ASTContext::canAssignObjCInterfaces`
that handles `ObjCObjectType` with `__kindof`. But it wasn't triggered
because during type substitution `__kindof TypeParam` was represented as
`AttributedType` with attribute `ObjCKindOf` and equivalent type
`TypeArg`. For assignment type checking we use canonical types so
attributed type was desugared and the attribute was ignored.

The fix is in checking transformed `AttributedType` and pushing
`__kindof` down into `ObjCObjectType` when necessary.

rdar://problem/38514910

Reviewers: ahatanak, erik.pilkington, doug.gregor

Reviewed By: doug.gregor

Subscribers: jkorous, dexonsmith, manmanren, jordan_rose, doug.gregor, cfe-commits

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

llvm-svn: 354189

5 years ago[lit] Remove LitTestCase
Julian Lettner [Sat, 16 Feb 2019 00:44:00 +0000 (00:44 +0000)]
[lit] Remove LitTestCase

From the docs: `class LitTestCase(unittest.TestCase)`
LitTestCase is an adaptor for providing a 'unittest' compatible
interface to 'lit' tests so that we can run lit tests with standard
python test runners.

It does not seem to be used anywhere.

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

llvm-svn: 354188

5 years ago[lit][NFC] Cleanup lit worker process handling
Julian Lettner [Sat, 16 Feb 2019 00:40:40 +0000 (00:40 +0000)]
[lit][NFC] Cleanup lit worker process handling

Move code that is executed on worker process to separate file. This
makes the use of the pickled arguments stored in global variables in the
worker a bit clearer. (Still not pretty though.)

Extract handling of parallelism groups to it's own function.

Use BoundedSemaphore instead of Semaphore. BoundedSemaphore raises for
unmatched release() calls.

Cleanup imports.

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

llvm-svn: 354187

5 years ago[libFuzzer] fork mode: try harder to cleanup after itself
Kostya Serebryany [Sat, 16 Feb 2019 00:14:16 +0000 (00:14 +0000)]
[libFuzzer] fork mode: try harder to cleanup after itself

llvm-svn: 354186

5 years agoTemporarily disable test:
Richard Smith [Sat, 16 Feb 2019 00:13:26 +0000 (00:13 +0000)]
Temporarily disable test:

test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py

It fails on Mac OS; apparently a VarDecl 'void *&C' is implicitly
declared there, making the class template name C ambiguous.

llvm-svn: 354185

5 years ago[PPC64] Preserve LocalEntry when linking
Rui Ueyama [Fri, 15 Feb 2019 23:11:18 +0000 (23:11 +0000)]
[PPC64] Preserve LocalEntry when linking

On PowerPC64, it is necessary to keep the LocalEntry bits in st_other,
especially when -r is used. Otherwise, when the resulting object is used
in a posterior linking, LocalEntry info will be unavailable and
functions may be called through the wrong entrypoint.

Patch by Leandro Lupori.

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

llvm-svn: 354184

5 years agoclang-format with UseTab: Always sometimes doesn't insert the right amount of tabs.
Alexander Kornienko [Fri, 15 Feb 2019 23:07:43 +0000 (23:07 +0000)]
clang-format with UseTab: Always sometimes doesn't insert the right amount of tabs.

Trailing comments are not always aligned properly when UseTab is set to Always.

Consider:

int a;        // x
int bbbbbbbb; // x
With .clang-format:

---
Language:        Cpp
BasedOnStyle: LLVM
UseTab: Always
...
The trailing comments of this code block should be aligned, but aren't

To align the first trailing comment it needs to insert 8 spaces. This should be
one tab plus six spaces. It skips the logic of the first partial tab in
FirstTabWidth (=2) + Style.TabWidth (=8) <= Spaces (=8) and only inserts one
tab. Proposed fix and test is attached.

Patch by Hylke Kleve.

Differential revision: https://reviews.llvm.org/D57655

llvm-svn: 354183

5 years ago[EarlyCSE & MSSA] Cap the clobbering calls in EarlyCSE.
Alina Sbirlea [Fri, 15 Feb 2019 22:47:54 +0000 (22:47 +0000)]
[EarlyCSE & MSSA] Cap the clobbering calls in EarlyCSE.

Summary:
Unlimitted number of calls to getClobberingAccess can lead to high
compile times in pathological cases.
Limitting getClobberingAccess to a fairly high number. Can be adjusted
based on users/need.
Note: this is the only user of MemorySSA currently enabled by default.
The same handling exists in LICM (disabled atm). As MemorySSA gains more
users, this logic of capping will need to move inside MemorySSA.

Reviewers: george.burgess.iv

Subscribers: llvm-commits

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

llvm-svn: 354182

5 years agoAdd some unconditional logging on the failure points when attaching
Jason Molenda [Fri, 15 Feb 2019 22:39:30 +0000 (22:39 +0000)]
Add some unconditional logging on the failure points when attaching
to a process so we'll always get messages in the console logs.

Also make the "is frontboard process" / "is backboard process"
determination lazy, specifically take it out of the
MachProcess::AttachForDebug codepath when we are attaching to a
process, to simplify attaching.

<rdar://problem/47982516>
<rdar://problem/48060134>

llvm-svn: 354181

5 years ago[ObjC] For type substitution in generics use a regular recursive type visitor.
Volodymyr Sapsai [Fri, 15 Feb 2019 22:14:58 +0000 (22:14 +0000)]
[ObjC] For type substitution in generics use a regular recursive type visitor.

Switch to the inheritance-based visitor from the lambda-based visitor to
allow both preorder and postorder customizations during type
transformation. NFC intended.

Reviewers: ahatanak, erik.pilkington

Reviewed By: erik.pilkington

Subscribers: jkorous, dexonsmith, cfe-commits

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

llvm-svn: 354180

5 years ago[Sanitizer] iOS: Pull up parallelism_group handling into common.lit.config
Julian Lettner [Fri, 15 Feb 2019 22:12:36 +0000 (22:12 +0000)]
[Sanitizer] iOS: Pull up parallelism_group handling into common.lit.config

Serial execution on iOS devices is not specific to sanitizers. We want
to throttle all on-device tests. Pull the setting of the
parallelism_group up into the common lit configuration file.

Rename `darwin-ios-device-sanitizer` to `ios-device`. This group is not
specific to sanitizers and (theoretically) independent from the host OS.

Note that we don't support running unit tests on-device (there are no
configurations generated for that). If that ever changes, we also need
this configuration in `unittests/lit.common.unit.cfg`.

Reviewers: delcypher

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

llvm-svn: 354179

5 years ago[X86] Don't set exception mask bits when modifying FPCW to change rounding mode for...
Craig Topper [Fri, 15 Feb 2019 21:59:33 +0000 (21:59 +0000)]
[X86] Don't set exception mask bits when modifying FPCW to change rounding mode for fp->int conversion

When we need to do an fp->int conversion using x87 instructions, we need to temporarily change the rounding mode to 0b11 and perform a store. To do this we save the old value of the fpcw to the stack, then set the fpcw to 0xc7f, do the store, then restore fpcw. But the 0xc7f value forces the exception mask bits 1. While this is what they would be in the default FP environment, as we move to support changing the FP environments, we shouldn't make this assumption.

This patch changes the code to explicitly OR 0xc00 with the old value so that only the rounding mode is changed. Unfortunately, this requires two stack temporaries instead of one. One to hold the old value and one to hold the new value. Without two stack temporaries we would need an additional GPR. We already need one to do the OR operation in. This is similar to what gcc and icc do for this operation. Though they are both better at reusing the stack temporaries when there are multiple truncates in a function(or at least in a basic block)

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

llvm-svn: 354178

5 years agoRevert "Don't include UnixSignals.h from Host."
Davide Italiano [Fri, 15 Feb 2019 21:55:29 +0000 (21:55 +0000)]
Revert "Don't include UnixSignals.h from Host."

It broke the modules green dragon buildbot.

llvm-svn: 354177

5 years agoFix implementation of [temp.local]p4.
Richard Smith [Fri, 15 Feb 2019 21:53:07 +0000 (21:53 +0000)]
Fix implementation of [temp.local]p4.

When a template-name is looked up, we need to give injected-class-name
declarations of class templates special treatment, as they denote a
template rather than a type.

Previously we achieved this by applying a filter to the lookup results
after completing name lookup, but that is incorrect in various ways, not
least of which is that it lost all information about access and how
members were named, and the filtering caused us to generally lose
all ambiguity errors between templates and non-templates.

We now preserve the lookup results exactly, and the few places that need
to map from a declaration found by name lookup into a declaration of a
template do so explicitly. Deduplication of repeated lookup results of
the same injected-class-name declaration is done by name lookup instead
of after the fact.

This reinstates r354091, which was previously reverted in r354097
because it exposed bugs in lldb and compiler-rt. Those bugs were fixed
in r354173 and r354174 respectively.

llvm-svn: 354176

5 years ago[libFuzzer] form mode: add -ignore_crashes flag, honor the max_total_time flag, print...
Kostya Serebryany [Fri, 15 Feb 2019 21:51:15 +0000 (21:51 +0000)]
[libFuzzer] form mode: add -ignore_crashes flag, honor the max_total_time flag, print the number of ooms/timeouts/crashes, fix a typo

llvm-svn: 354175

5 years agoFix invalid code that Clang trunk will soon diagnose.
Richard Smith [Fri, 15 Feb 2019 21:48:57 +0000 (21:48 +0000)]
Fix invalid code that Clang trunk will soon diagnose.

There is an ambiguity between ::SizeClassMap (the typedef declared near
the start of this file) and __sanitizer::SizeClassMap (found by the
'using namespace __sanitizer;' near the start of this file).

Historically a Clang bug has meant that the error was not diagnosed, but
soon Clang will start diagnosing it. Explicitly qualify this use of
SizeClassMap so that it finds __sanitizer::SizeClassMap rather than
being ill-formed due to ambiguity.

llvm-svn: 354174