platform/upstream/llvm.git
4 years agoRevert rL372693 : [clang-tidy] New bugprone-infinite-loop check for detecting obvious...
Simon Pilgrim [Tue, 24 Sep 2019 08:56:44 +0000 (08:56 +0000)]
Revert rL372693 : [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

Finding infinite loops is well-known to be impossible (halting problem).
However, it is possible to detect some obvious infinite loops, for example,
if the loop condition is not changed. Detecting such loops is beneficial
since the tests will hang on programs containing infinite loops so
testing-time detection may be costly in large systems. Obvious cases are
where the programmer forgets to increment/decrement the counter or
increments/decrements the wrong variable.

Differential Revision: https://reviews.llvm.org/D64736
-------
Broke some buildbots "No SOURCES given to target: obj.clangTidyBugproneModule"

llvm-svn: 372704

4 years ago[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.
Alexey Lapshin [Tue, 24 Sep 2019 08:47:03 +0000 (08:47 +0000)]
[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.

Induction Variable Simplification pass does not update dbg.value intrinsic.

Before:

%add = add nuw nsw i32 %ArgIndex.06, 1
call void @llvm.dbg.value(metadata i32 %add, metadata !17, metadata !DIExpression())

After:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 undef, metadata !17, metadata !DIExpression())

There should be:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 %indvars.iv.next, metadata !17, metadata !DIExpression())

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

llvm-svn: 372703

4 years ago[lldb][NFC] Relax completion tests for log command to make them pass on Linux
Raphael Isemann [Tue, 24 Sep 2019 08:41:10 +0000 (08:41 +0000)]
[lldb][NFC] Relax completion tests for log command to make them pass on Linux

The log channels change depending on platform, so listing them breaks on
some platforms. Let's just check that the 'lldb' and 'dwarf' channels are
there which are independent of platform.

llvm-svn: 372701

4 years ago[LLDB] Avoid warnings about redefining posix mode defines on MinGW
Martin Storsjo [Tue, 24 Sep 2019 08:39:12 +0000 (08:39 +0000)]
[LLDB] Avoid warnings about redefining posix mode defines on MinGW

Since these defines were added in LLVM SVN r189364 in 2013,
mingw-w64 got defines for S_I?GRP, S_IRWXG, S_I?OTH and S_IRWXO
in 2015.

Also change the existing defined(_MSC_VER) into ifndef S_IRUSR, for
consistency.

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

llvm-svn: 372700

4 years ago[LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architectures
Martin Storsjo [Tue, 24 Sep 2019 08:39:06 +0000 (08:39 +0000)]
[LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architectures

While debugging on those architectures might not be supported yet,
the generic code should still be buildable. This file accesses x86
specific fields in the CONTEXT struct.

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

llvm-svn: 372699

4 years agosanitizer_common: fix freebsd build error
Dmitry Vyukov [Tue, 24 Sep 2019 08:27:51 +0000 (08:27 +0000)]
sanitizer_common: fix freebsd build error

Variable flags is not used. Remove it.

Suggested-by: randall77 (Keith Randall)
Review: https://reviews.llvm.org/D67928
llvm-svn: 372698

4 years ago[lldb] Fix log output and UtilityTests/LogChannelTest.List
Raphael Isemann [Tue, 24 Sep 2019 08:20:05 +0000 (08:20 +0000)]
[lldb] Fix log output and UtilityTests/LogChannelTest.List

I refactored this code in 372691 and it seems I didn't fully
replicate the original log output, so that test was failing.

llvm-svn: 372696

4 years ago[LV] Forced vectorization with runtime checks and OptForSize
Sjoerd Meijer [Tue, 24 Sep 2019 08:03:34 +0000 (08:03 +0000)]
[LV] Forced vectorization with runtime checks and OptForSize

When vectorisation is forced with a pragma, we optimise for min size, and we
need to emit runtime memory checks, then allow this code growth and don't run
in an assert like we currently do.

This is the result of D65197 and D66803, and was a use-case not really
considered before. If this now happens, we emit an optimisation remark warning
about the code-size expansion, which can be avoided by not forcing
vectorisation or possibly source-code modifications.

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

llvm-svn: 372694

4 years ago[clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops
Adam Balogh [Tue, 24 Sep 2019 07:43:26 +0000 (07:43 +0000)]
[clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

Finding infinite loops is well-known to be impossible (halting problem).
However, it is possible to detect some obvious infinite loops, for example,
if the loop condition is not changed. Detecting such loops is beneficial
since the tests will hang on programs containing infinite loops so
testing-time detection may be costly in large systems. Obvious cases are
where the programmer forgets to increment/decrement the counter or
increments/decrements the wrong variable.

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

llvm-svn: 372693

4 years ago[lldb] Remove redundant argument lists in CompletionRequest
Raphael Isemann [Tue, 24 Sep 2019 07:22:44 +0000 (07:22 +0000)]
[lldb] Remove redundant argument lists in CompletionRequest

We currently have two lists in the CompletionRequest that we
inherited from the old API: The complete list of arguments ignoring
where the user requested completion and the list of arguments that
stops at the cursor. Having two lists of arguments is confusing
and can lead to subtle errors, so let's remove the complete list
until we actually need it.

llvm-svn: 372692

4 years ago[lldb] Add completion support for log enable/disable/list
Raphael Isemann [Tue, 24 Sep 2019 07:18:09 +0000 (07:18 +0000)]
[lldb] Add completion support for log enable/disable/list

Reviewers: #lldb, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 372691

4 years agoIgnore generated @import statements in the expression evaluator
Raphael Isemann [Tue, 24 Sep 2019 06:58:39 +0000 (06:58 +0000)]
Ignore generated @import statements in the expression evaluator

Summary:
The ClangModulesDeclVendor is currently interpreting all injected `@import` statements in our expression
wrapper as modules that the user has explicitly requested to be persistently loaded. As we inject
`@import` statements with our std module prototype, the ClangModulesDeclVendor will start compiling
and loading unrelated C++ modules because it thinks the user has requested that it should load them. As
the ClangModulesDeclVendor is lacking the setup to compile these modules (e.g. it lacks the include paths),
it will then actually just fail to compile them and cause the whole expression evaluation to fail. This causes
these tests to fail on systems that enable the ClangModulesDeclVendor (such as macOS).

This patch fixes this by preventing the ClangModulesDeclVendor from interpreting `@import` statements
in the wrapper source code. This is done by check if the import happens in the fake source file containing
our wrapper code (which implies it was generated by LLDB).

This patch doesn't reenable the tests as there is more work needed to get the tests running on macOS (D67760)

Reviewers: aprantl, shafik, jingham

Subscribers: lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

llvm-svn: 372690

4 years ago[clang-format] NFC clang-format the clang-format unit tests
Paul Hoad [Tue, 24 Sep 2019 06:35:37 +0000 (06:35 +0000)]
[clang-format] NFC clang-format the clang-format unit tests

Summary:
It is annoying that the clang-format tests aren't themselves clang-formatted, if you use a format on save option in VS or vim this file gets massively changed then you have to `git difftool` all the other changes back out, which is risky.

I know people don't like mass clang-format changes but sometimes it becomes unmanageable to not. There are no other changes here other than just the reformat.

clang-format tests all pass.

```
[==========] 691 tests from 21 test cases ran. (55990 ms total)
[  PASSED  ] 691 tests.
```

Reviewers: klimek, owenpan, timwoj

Reviewed By: owenpan

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang

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

llvm-svn: 372689

4 years ago[ASTImporter] 3rd attempt to fix Windows buildbot test errors
Gabor Marton [Tue, 24 Sep 2019 05:50:02 +0000 (05:50 +0000)]
[ASTImporter] 3rd attempt to fix Windows buildbot test errors

llvm-svn: 372688

4 years agoRevert "[static analyzer] Define __clang_analyzer__ macro in driver"
Jan Korous [Tue, 24 Sep 2019 03:21:22 +0000 (03:21 +0000)]
Revert "[static analyzer] Define __clang_analyzer__ macro in driver"

This reverts commit fbd13570b0d5f92ef2cf6bcfe7cc2f6178500187.

llvm-svn: 372687

4 years agoRevert "[lit] Add -D__clang_analyzer__ to clang_analyze_cc1"
Jan Korous [Tue, 24 Sep 2019 03:20:59 +0000 (03:20 +0000)]
Revert "[lit] Add -D__clang_analyzer__ to clang_analyze_cc1"

This reverts commit 4185460f758b98ea5b898c04c179704756ca8f53.

llvm-svn: 372686

4 years agoRevert "[static analyzer][test] Test directly that driver sets D__clang_analyzer__"
Jan Korous [Tue, 24 Sep 2019 03:19:20 +0000 (03:19 +0000)]
Revert "[static analyzer][test] Test directly that driver sets D__clang_analyzer__"

This reverts commit c7541903d72765a38808e9973572a8d50c9d94fb.

llvm-svn: 372685

4 years agoFix int to bool errors exposed due to r372612.
Rumeet Dhindsa [Tue, 24 Sep 2019 02:59:02 +0000 (02:59 +0000)]
Fix int to bool errors exposed due to r372612.

Differential Revision: https://reviews.llvm.org/D67937
M    lib/builtins/fp_add_impl.inc
M    lib/builtins/fp_lib.h
M    lib/builtins/fp_trunc_impl.inc

llvm-svn: 372684

4 years ago[static analyzer][test] Test directly that driver sets D__clang_analyzer__
Jan Korous [Tue, 24 Sep 2019 02:06:59 +0000 (02:06 +0000)]
[static analyzer][test] Test directly that driver sets D__clang_analyzer__

Follow-up to fbd13570b0d

llvm-svn: 372683

4 years ago[lit] Add -D__clang_analyzer__ to clang_analyze_cc1
Jan Korous [Tue, 24 Sep 2019 01:59:20 +0000 (01:59 +0000)]
[lit] Add -D__clang_analyzer__ to clang_analyze_cc1

Fixup after fbd13570b0d

llvm-svn: 372682

4 years agoSupport for DWARF-5 C++ language tags.
Adrian Prantl [Tue, 24 Sep 2019 00:38:49 +0000 (00:38 +0000)]
Support for DWARF-5 C++ language tags.

This patch provides support for DW_LANG_C_plus_plus_11,
DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend.

Patch by Sourabh Singh Tomar!
Differential Revision: https://reviews.llvm.org/D67613

Reapplies r372663 after adapting a failing test in the LLDB testsuite.

llvm-svn: 372681

4 years ago[static analyzer] Remove --analyze-auto
Jan Korous [Tue, 24 Sep 2019 00:37:25 +0000 (00:37 +0000)]
[static analyzer] Remove --analyze-auto

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

llvm-svn: 372680

4 years ago[static analyzer] Define __clang_analyzer__ macro in driver
Jan Korous [Tue, 24 Sep 2019 00:33:47 +0000 (00:33 +0000)]
[static analyzer] Define __clang_analyzer__ macro in driver

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

llvm-svn: 372679

4 years ago[InstCombine] Fold a shifty implementation of clamp-to-allones.
Huihui Zhang [Tue, 24 Sep 2019 00:30:09 +0000 (00:30 +0000)]
[InstCombine] Fold a shifty implementation of clamp-to-allones.

Summary:
Fold
or(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X)
into
X s> Y ? -1 : X

https://rise4fun.com/Alive/d8Ab

clamp255 is a common operator in image processing, can be implemented
in a shifty way "(255 - X) >> 31 | X & 255". Fold shift into select
enables more optimization, e.g., vmin generation for ARM target.

Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon

Reviewed By: lebedev.ri

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372678

4 years agoAdapt test to upstream clang compiler changes.
Adrian Prantl [Tue, 24 Sep 2019 00:27:13 +0000 (00:27 +0000)]
Adapt test to upstream clang compiler changes.

Clang now emits the correct C++ language version in DWARF.

llvm-svn: 372677

4 years ago[InstCombine] Fold a shifty implementation of clamp-to-zero.
Huihui Zhang [Tue, 24 Sep 2019 00:15:03 +0000 (00:15 +0000)]
[InstCombine] Fold a shifty implementation of clamp-to-zero.

Summary:
Fold
and(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X)
into
X s> Y ? X : 0

https://rise4fun.com/Alive/lFH

Fold shift into select enables more optimization,
e.g., vmax generation for ARM target.

Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon

Reviewed By: lebedev.ri

Subscribers: xbolva00, andreadb, craig.topper, RKSimon, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372676

4 years ago[GlobalISel][IRTranslator] Fix switch table lowering to use signed LE not unsigned.
Amara Emerson [Tue, 24 Sep 2019 00:09:23 +0000 (00:09 +0000)]
[GlobalISel][IRTranslator] Fix switch table lowering to use signed LE not unsigned.

We were miscompiling switch value comparisons with the wrong signedness, which
shows up when we have things like switch case values with i1 types, which end up
being legalized incorrectly.

Fixes PR43383

llvm-svn: 372675

4 years ago[llvm-cov] NFC: Specify a specific C++ standard in the test.
Artem Dergachev [Tue, 24 Sep 2019 00:01:51 +0000 (00:01 +0000)]
[llvm-cov] NFC: Specify a specific C++ standard in the test.

Makes life easier for downstream users with customized default standard.

llvm-svn: 372674

4 years ago[MemorySSA] Update Phi insertion.
Alina Sbirlea [Mon, 23 Sep 2019 23:50:16 +0000 (23:50 +0000)]
[MemorySSA] Update Phi insertion.

Summary:
MemoryPhis may be needed following a Def insertion inthe IDF of all the
new accesses added (phis + potentially a def). Ensure this also  occurs when
only the new MemoryPhis are the defining accesses.

Note: The need for computing IDF here is because of new Phis added with
edges incoming from unreachable code, Phis that had previously been
simplified. The preferred solution is to not reintroduce such Phis.
This patch is the needed fix while working on the preferred solution.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

llvm-svn: 372673

4 years agoRevert "Support for DWARF-5 C++ language tags."
Jonas Devlieghere [Mon, 23 Sep 2019 23:49:36 +0000 (23:49 +0000)]
Revert "Support for DWARF-5 C++ language tags."

This reverts commit bf9c8ffb54943c6d77398adbedddf05ef9724007.

llvm-svn: 372672

4 years ago[NFC][InstCombine] Add tests for shifty implementation of clamping.
Huihui Zhang [Mon, 23 Sep 2019 23:48:32 +0000 (23:48 +0000)]
[NFC][InstCombine] Add tests for shifty implementation of clamping.

Summary:
Clamp negative to zero and clamp positive to allOnes are common
operation in image saturation.

Add tests for shifty implementation of clamping, as prepare work for
folding:

and(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) --> X s> 0 ? X : 0;

or(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) --> X s> Y ? allOnes : X.

Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 372671

4 years ago[Make] Add support for building NeXT-style frameworks
Jonas Devlieghere [Mon, 23 Sep 2019 22:31:16 +0000 (22:31 +0000)]
[Make] Add support for building NeXT-style frameworks

This patch extends the Makefile.rules to build NeXT-style frameworks. It
also fixes a bug in the clean logic that would accidentally delete the
.mm source file instead of the .o object file.

Thanks a lot to Adrian who was instrumental is getting this to work!

llvm-svn: 372669

4 years ago[NFCI] Return PathSensitiveBugReport where appropriate
Alex Langford [Mon, 23 Sep 2019 22:24:47 +0000 (22:24 +0000)]
[NFCI] Return PathSensitiveBugReport where appropriate

Some compilers have trouble converting unique_ptr<PathSensitiveBugReport> to
unique_ptr<BugReport> causing some functions to fail to compile.
Changing the return type of the functions that fail to compile does not
appear to have any issues.
I ran into this issue building with clang 3.8 on Ubuntu 16.04.

llvm-svn: 372668

4 years agoHotColdSplitting: invalidate the AssumptionCache on split
Saleem Abdulrasool [Mon, 23 Sep 2019 22:23:01 +0000 (22:23 +0000)]
HotColdSplitting: invalidate the AssumptionCache on split

When a cold path is outlined, the value tracking in the assumption cache may be
invalidated due to the code motion.  We would previously trip an assertion in
subsequent passes (but required the passes to happen in a single run as the
assumption cache is shared across the passes).  Invalidating the cache ensures
that we get the correct information when needed with the legacy pass manager as
well.

llvm-svn: 372667

4 years ago[llvm-lipo] Add support for archives
Alexander Shaposhnikov [Mon, 23 Sep 2019 22:22:55 +0000 (22:22 +0000)]
[llvm-lipo] Add support for archives

Add support for creating universal binaries which
can contain an archive.

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

Test plan: make check-all

llvm-svn: 372666

4 years ago[SampleFDO] Treat names in profile as not cold only when profile symbol list
Wei Mi [Mon, 23 Sep 2019 22:11:35 +0000 (22:11 +0000)]
[SampleFDO] Treat names in profile as not cold only when profile symbol list
is available

In rL372232, we treated names showing up in profile as not cold when
profile-sample-accurate is enabled. This caused 70k size regression in
Chrome/Android. The patch put a guard and only enable the change when
profile symbol list is available, i.e., keep the old behavior when profile
symbol list is not available.

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

llvm-svn: 372665

4 years ago[Diagnostics] Warn for enum constants in bool context (-Wint-in-bool-context; GCC...
David Bolvansky [Mon, 23 Sep 2019 22:09:49 +0000 (22:09 +0000)]
[Diagnostics] Warn for enum constants in bool context (-Wint-in-bool-context; GCC compatibility)

Extracted from D63082.

llvm-svn: 372664

4 years agoSupport for DWARF-5 C++ language tags.
Adrian Prantl [Mon, 23 Sep 2019 22:01:49 +0000 (22:01 +0000)]
Support for DWARF-5 C++ language tags.

This patch provides support for DW_LANG_C_plus_plus_11,
DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend.

Patch by Sourabh Singh Tomar!
Differential Revision: https://reviews.llvm.org/D67613

llvm-svn: 372663

4 years agoFix uninitialized variable warning. NFCI.
Simon Pilgrim [Mon, 23 Sep 2019 21:32:38 +0000 (21:32 +0000)]
Fix uninitialized variable warning. NFCI.

llvm-svn: 372662

4 years ago[X86] Reduce the number of unique check prefixes in memset-nonzero.ll. NFC
Craig Topper [Mon, 23 Sep 2019 21:29:28 +0000 (21:29 +0000)]
[X86] Reduce the number of unique check prefixes in memset-nonzero.ll. NFC

The avx512 with prefer-256-bit generates the same code as AVX2 so
just reuse that prefix.

llvm-svn: 372661

4 years ago[lld][WebAssembly] Preserve symbol flags in --relocatable output
Sam Clegg [Mon, 23 Sep 2019 21:28:29 +0000 (21:28 +0000)]
[lld][WebAssembly] Preserve symbol flags in --relocatable output

Fixes https://github.com/emscripten-core/emscripten/issues/8879

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

llvm-svn: 372660

4 years ago[LLDB] [Windows] Map COFF ARM machine ids to the right triple architectures
Martin Storsjo [Mon, 23 Sep 2019 20:43:22 +0000 (20:43 +0000)]
[LLDB] [Windows] Map COFF ARM machine ids to the right triple architectures

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

llvm-svn: 372658

4 years ago[LLDB] [PECOFF] Recognize arm64 executables
Martin Storsjo [Mon, 23 Sep 2019 20:43:16 +0000 (20:43 +0000)]
[LLDB] [PECOFF] Recognize arm64 executables

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

llvm-svn: 372657

4 years ago[LLDB] Rework a MinGW build fix from D65691
Martin Storsjo [Mon, 23 Sep 2019 20:43:11 +0000 (20:43 +0000)]
[LLDB] Rework a MinGW build fix from D65691

That change didn't contain any explanation for this bit. There shouldn't
be any need for a check for MinGW ifdefs here, as long as the include
uses lowercase windows.h (as is used consistently elsewhere in
the llvm projects).

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

llvm-svn: 372656

4 years ago[WebAssembly] vNxM.load_splat instructions
Thomas Lively [Mon, 23 Sep 2019 20:42:12 +0000 (20:42 +0000)]
[WebAssembly] vNxM.load_splat instructions

Summary:
Adds the new load_splat instructions as specified at
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#load-and-splat.

DAGISel does not allow matching multiple copies of the same load in a
single pattern, so we use a new node in WebAssemblyISD to wrap loads
that should be splatted.

Depends on D67783.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 372655

4 years ago[InstCombine] foldOrOfICmps(): Acquire SimplifyQuery with set CxtI
Roman Lebedev [Mon, 23 Sep 2019 20:40:47 +0000 (20:40 +0000)]
[InstCombine] foldOrOfICmps(): Acquire SimplifyQuery with set CxtI

Extracted from https://reviews.llvm.org/D67849#inline-610377

llvm-svn: 372654

4 years ago[InstCombine] foldAndOfICmps(): Acquire SimplifyQuery with set CxtI
Roman Lebedev [Mon, 23 Sep 2019 20:40:40 +0000 (20:40 +0000)]
[InstCombine] foldAndOfICmps(): Acquire SimplifyQuery with set CxtI

Extracted from https://reviews.llvm.org/D67849#inline-610377

llvm-svn: 372653

4 years agoFile::SetDescriptor() should require options
Jonas Devlieghere [Mon, 23 Sep 2019 20:36:46 +0000 (20:36 +0000)]
File::SetDescriptor() should require options

lvm_private::File::GetStream() can fail if m_options == 0

It's not clear from the header a File created with a descriptor will be
not be usable by many parts of LLDB unless SetOptions is also called,
but it is.

This is because those parts of LLDB rely on GetStream() to use the
file, and that in turn relies on calling fdopen on the descriptor. When
calling fdopen, GetStream relies on m_options to determine the access
mode. If m_options has never been set, GetStream() will fail.

This patch adds options as a required argument to File::SetDescriptor
and the corresponding constructor.

Patch by: Lawrence D'Anna

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

llvm-svn: 372652

4 years ago[mips] Support elf32btsmipn32_fbsd / elf32ltsmipn32_fbsd emulations
Simon Atanasyan [Mon, 23 Sep 2019 20:32:43 +0000 (20:32 +0000)]
[mips] Support elf32btsmipn32_fbsd / elf32ltsmipn32_fbsd emulations

Patch by Kyle Evans.

llvm-svn: 372651

4 years ago[mips] Add tests to check MIPS FreeBSD emulations. NFC
Simon Atanasyan [Mon, 23 Sep 2019 20:32:33 +0000 (20:32 +0000)]
[mips] Add tests to check MIPS FreeBSD emulations. NFC

llvm-svn: 372650

4 years ago[mips] Reformat test case to simplify addition new tests. NFC
Simon Atanasyan [Mon, 23 Sep 2019 20:32:27 +0000 (20:32 +0000)]
[mips] Reformat test case to simplify addition new tests. NFC

llvm-svn: 372649

4 years ago[WebAssembly] Remove unused memory instructions and patterns
Thomas Lively [Mon, 23 Sep 2019 20:04:59 +0000 (20:04 +0000)]
[WebAssembly] Remove unused memory instructions and patterns

Summary:
Removes duplicated SIMD loads and store instructions and removes
patterns involving GlobalAddresses that were not used in any tests.

Reviewers: aheejin, sunfish

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 372648

4 years ago[InstCombine] Annotate strndup calls with dereferenceable_or_null
David Bolvansky [Mon, 23 Sep 2019 19:55:45 +0000 (19:55 +0000)]
[InstCombine] Annotate strndup calls with dereferenceable_or_null

"Implementations are free to malloc() a buffer containing either (size + 1) bytes or (strnlen(s, size) + 1) bytes. Applications should not assume that strndup() will allocate (size + 1) bytes when strlen(s) is smaller than size."

llvm-svn: 372647

4 years ago[ASTImporter] 2nd attempt to fix Windows buildbot test errors
Gabor Marton [Mon, 23 Sep 2019 19:49:45 +0000 (19:49 +0000)]
[ASTImporter] 2nd attempt to fix Windows buildbot test errors

llvm-svn: 372646

4 years ago[X86] Use TargetConstant for condition code on X86ISD::SETCC/CMOV/BRCOND nodes.
Craig Topper [Mon, 23 Sep 2019 19:48:20 +0000 (19:48 +0000)]
[X86] Use TargetConstant for condition code on X86ISD::SETCC/CMOV/BRCOND nodes.

This removes the need for ConvertToTarget opcodes in the isel table.
It's also consistent with the recent changes to use TargetConstant
for intrinsic nodes that always take immediates.

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

llvm-svn: 372645

4 years ago[Host] File::GetWaitableHandle() should call fileno()
Jonas Devlieghere [Mon, 23 Sep 2019 19:34:26 +0000 (19:34 +0000)]
[Host] File::GetWaitableHandle() should call fileno()

If the file has m_stream, it may not have a m_descriptor.
GetWaitableHandle() should call GetDescriptor(), which will call
fileno(), so it will get waitable descriptor whenever one is available.

Patch by: Lawrence D'Anna

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

llvm-svn: 372644

4 years ago[ABISysV] Fix regression for Simulator and MacABI
Jonas Devlieghere [Mon, 23 Sep 2019 19:06:00 +0000 (19:06 +0000)]
[ABISysV] Fix regression for Simulator and MacABI

The ABISysV ABI was refactored in r364216 to support the Windows ABI for
x86_64. In particular it changed ABISysV_x86_64::CreateInstance to
switch on the OS type. This breaks debugging MacABI apps as well as apps
in the simulator. This adds back the necessary cases.

We have a test on Github that exercises this code path and which I'd
like to upstream once the remaining MacABI parts become available in
clang.

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

llvm-svn: 372642

4 years ago[TableGen] Emit OperandType enums for RegisterOperands/RegisterClasses
Aditya Nandakumar [Mon, 23 Sep 2019 18:51:00 +0000 (18:51 +0000)]
[TableGen] Emit OperandType enums for RegisterOperands/RegisterClasses

https://reviews.llvm.org/D66773

The OpTypes::OperandType was creating an enum for all records that
inherit from Operand, but in reality there are operands for instructions
that inherit from other types too. In particular, RegisterOperand and
RegisterClass. This commit adds those types to the list of operand types
that are tracked by the OperandType enum.

Patch by: nlguillemot

llvm-svn: 372641

4 years ago[Sema] Fix the atomic expr rebuilding order.
Michael Liao [Mon, 23 Sep 2019 18:48:06 +0000 (18:48 +0000)]
[Sema] Fix the atomic expr rebuilding order.

Summary:
- Rearrange the atomic expr order to the API order when rebuilding
  atomic expr during template instantiation.

Reviewers: erichkeane

Subscribers: jfb, cfe-commits

Tags: #clang

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

llvm-svn: 372640

4 years ago[IR] Add getExtendedType() to IntegerType and Type (dispatching to IntegerType or...
Roman Lebedev [Mon, 23 Sep 2019 18:21:33 +0000 (18:21 +0000)]
[IR] Add getExtendedType() to IntegerType and Type (dispatching to IntegerType or VectorType)

llvm-svn: 372638

4 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): improve comment
Roman Lebedev [Mon, 23 Sep 2019 18:21:14 +0000 (18:21 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): improve comment

llvm-svn: 372637

4 years ago[SLC] Convert some strndup calls to strdup calls
David Bolvansky [Mon, 23 Sep 2019 18:20:01 +0000 (18:20 +0000)]
[SLC] Convert some strndup calls to strdup calls

Summary:
Motivation:
- If we can fold it to strdup, we should (strndup does more things than strdup).
- Annotation mechanism. (Works for strdup well).

strdup and strndup are part of C 20 (currently posix fns), so we should optimize them.

Reviewers: efriedma, jdoerfert

Reviewed By: jdoerfert

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

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

llvm-svn: 372636

4 years ago[OPENMP]Use standard parsing for 'match' clause, NFC.
Alexey Bataev [Mon, 23 Sep 2019 18:13:31 +0000 (18:13 +0000)]
[OPENMP]Use standard parsing for 'match' clause, NFC.

Reused standard clauses parsing scheme for parsing/matching 'match'
clause in 'declare variant' directive.

llvm-svn: 372635

4 years ago[lldb-suite] TestCallOverriddenMethod.py is now passing on Windows
Stella Stamenova [Mon, 23 Sep 2019 17:51:27 +0000 (17:51 +0000)]
[lldb-suite] TestCallOverriddenMethod.py is now passing on Windows

The test is now passing, so remove the expected failure. No other tests associated with the bug are passing, though, so only remove expected failure from this one test

llvm-svn: 372634

4 years ago[ASTImporter] Attempt to fix Windows buildbot test errors
Gabor Marton [Mon, 23 Sep 2019 17:29:08 +0000 (17:29 +0000)]
[ASTImporter] Attempt to fix Windows buildbot test errors

llvm-svn: 372633

4 years ago[libc++] Mark CTAD tests as not failing on AppleClang 10.0.1
Louis Dionne [Mon, 23 Sep 2019 17:22:13 +0000 (17:22 +0000)]
[libc++] Mark CTAD tests as not failing on AppleClang 10.0.1

They do fail on AppleClang 10.0.0, but not AppleClang 10.0.1

llvm-svn: 372632

4 years agoNFC: Fix a poorly-written test
Erik Pilkington [Mon, 23 Sep 2019 17:16:55 +0000 (17:16 +0000)]
NFC: Fix a poorly-written test

The author of r364954 foolishly forgot that == binds tighter than ?:

llvm-svn: 372631

4 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. c/d/e with mask (PR42563)
Roman Lebedev [Mon, 23 Sep 2019 17:04:28 +0000 (17:04 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. c/d/e with mask (PR42563)

Summary:
If we have a pattern `(x & (-1 >> maskNbits)) << shiftNbits`,
we already know (have a fold) that will drop the `& (-1 >> maskNbits)`
mask iff `(shiftNbits-maskNbits) s>= 0` (i.e. `shiftNbits u>= maskNbits`).

So even if `(shiftNbits-maskNbits) s< 0`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: c, normal+mask
  %t0 = lshr i32 -1, C1
  %t1 = and i32 %t0, %x
  %r = shl i32 %t1, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = i32 ((-(C2-C1))+32)
  %n2 = zext i32 %n1 to i64
  %n3 = lshr i64 -1, %n2
  %n4 = trunc i64 %n3 to i32
  %r = and i32 %n0, %n4
```
https://rise4fun.com/Alive/gslRa

Naturally, old `%masked` will have to be one-use.
This is not valid for pattern f - where "masking" is done via `ashr`.

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

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372630

4 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. a/b with mask (PR42563)
Roman Lebedev [Mon, 23 Sep 2019 17:04:14 +0000 (17:04 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. a/b with mask (PR42563)

Summary:
And this is **finally** the interesting part of that fold!

If we have a pattern `(x & (~(-1 << maskNbits))) << shiftNbits`,
we already know (have a fold) that will drop the `& (~(-1 << maskNbits))`
mask iff `(maskNbits+shiftNbits) u>= bitwidth(x)`.
But that is actually ignorant, there's more general fold here:

In this pattern, `(maskNbits+shiftNbits)` actually correlates
with the number of low bits that will remain in the final value.
So even if `(maskNbits+shiftNbits) u< bitwidth(x)`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: a, normal+mask
  %onebit = shl i32 -1, C1
  %mask = xor i32 %onebit, -1
  %masked = and i32 %mask, %x
  %r = shl i32 %masked, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = add i32 C1, C2
  %n2 = zext i32 %n1 to i64
  %n3 = shl i64 -1, %n2
  %n4 = xor i64 %n3, -1
  %n5 = trunc i64 %n4 to i32
  %r = and i32 %n0, %n5
```
https://rise4fun.com/Alive/F5R

Naturally, old `%masked` will have to be one-use.
Similar fold exists for patterns c,d,e, will post patch later.

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

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372629

4 years ago[BreakFalseDeps] ignore function with minsize attribute
Sanjay Patel [Mon, 23 Sep 2019 17:01:01 +0000 (17:01 +0000)]
[BreakFalseDeps] ignore function with minsize attribute

This came up in the x86-specific:
https://bugs.llvm.org/show_bug.cgi?id=43239
...but it is a general problem for the BreakFalseDeps pass.
Dependencies may be broken by adding some other instruction,
so that should be avoided if the overall goal is to minimize size.

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

llvm-svn: 372628

4 years ago[Clang-doc] NFC: Fixed link to llvm bugs in documentation
Shaurya Gupta [Mon, 23 Sep 2019 16:55:13 +0000 (16:55 +0000)]
[Clang-doc] NFC: Fixed link to llvm bugs in documentation

llvm-svn: 372627

4 years ago[SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAdd...
Alexey Bataev [Mon, 23 Sep 2019 16:25:03 +0000 (16:25 +0000)]
[SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!")

Summary:
Initially SLP vectorizer replaced all going-to-be-vectorized
instructions with Undef values. It may break ScalarEvaluation and may
cause a crash.
Reworked SLP vectorizer so that it does not replace vectorized
instructions by UndefValue anymore. Instead vectorized instructions are
marked for deletion inside if BoUpSLP class and deleted upon class
destruction.

Reviewers: mzolotukhin, mkuper, hfinkel, RKSimon, davide, spatel

Subscribers: RKSimon, Gerolf, anemet, hans, majnemer, llvm-commits, sanjoy

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

llvm-svn: 372626

4 years ago[InstCombine] foldUnsignedUnderflowCheck(): s/Subtracted/ZeroCmpOp/
Roman Lebedev [Mon, 23 Sep 2019 16:04:32 +0000 (16:04 +0000)]
[InstCombine] foldUnsignedUnderflowCheck(): s/Subtracted/ZeroCmpOp/

llvm-svn: 372625

4 years ago Fix __is_fundamental to accept nullptr_t
Zoe Carver [Mon, 23 Sep 2019 16:02:46 +0000 (16:02 +0000)]
Fix __is_fundamental to accept nullptr_t

    Summary: This patch updates the __is_fundamental builtin type trait to return true for nullptr_t.

    Reviewers: rsmith, EricWF, efriedma, craig.topper, erichkeane

    Subscribers: cfe-commits

    Tags: #clang

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

llvm-svn: 372624

4 years ago[OPENMP]Fix PR43355: DO not emit target calls if only -fopenmp-targets
Alexey Bataev [Mon, 23 Sep 2019 15:53:51 +0000 (15:53 +0000)]
[OPENMP]Fix PR43355: DO not emit target calls if only -fopenmp-targets
is not provided.

We should not emit any target-dependent code if only -fopenmp flag is
used and device targets are not provided to prevent compiler crash.

llvm-svn: 372623

4 years ago[AMDGPU][MC] Corrected handling of relocatable expressions
Dmitry Preobrazhensky [Mon, 23 Sep 2019 15:41:51 +0000 (15:41 +0000)]
[AMDGPU][MC] Corrected handling of relocatable expressions

See bug 43359: https://bugs.llvm.org//show_bug.cgi?id=43359

Reviewers: rampitec

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

llvm-svn: 372622

4 years ago Fix __is_signed builtin
Zoe Carver [Mon, 23 Sep 2019 15:41:20 +0000 (15:41 +0000)]
Fix __is_signed builtin

    Summary: This patch fixes the __is_signed builtin type trait to work with floating point types and enums. Now, the builtin will return true if it is passed a floating point type and false for an enum type.

    Reviewers: EricWF, rsmith, erichkeane, craig.topper, efriedma

    Subscribers: cfe-commits

    Tags: #clang

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

llvm-svn: 372621

4 years ago[libc++] Mark iostreams test as XFAIL on older macOSes
Louis Dionne [Mon, 23 Sep 2019 15:40:47 +0000 (15:40 +0000)]
[libc++] Mark iostreams test as XFAIL on older macOSes

llvm-svn: 372620

4 years agoHexagonLoopIdiomRecognition - silence static analyzer dyn_cast<> null dereference...
Simon Pilgrim [Mon, 23 Sep 2019 15:36:24 +0000 (15:36 +0000)]
HexagonLoopIdiomRecognition - silence static analyzer dyn_cast<> null dereference warnings. NFCI.

llvm-svn: 372619

4 years ago[TextAPI] Add New Supported Platforms
Cyndy Ishida [Mon, 23 Sep 2019 15:28:02 +0000 (15:28 +0000)]
[TextAPI] Add New Supported Platforms

Summary: This patch introduces simulators, as well was the restriced zippered and macCatalyst to supported platforms

Reviewers: ributzka, steven_wu

Reviewed By: ributzka

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 372618

4 years ago[clangd] Simplify the callside of URI::resolve, NFC.
Haojian Wu [Mon, 23 Sep 2019 14:39:37 +0000 (14:39 +0000)]
[clangd] Simplify the callside of URI::resolve, NFC.

Summary:
- Add a overrloded URI::resolve, which accepts a string URI;
- also fixed some callside that don't check the error;

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 372617

4 years ago[Hexagon] Bitcast v4i16 to v8i8, unify no-op casts between scalar and HVX
Krzysztof Parzyszek [Mon, 23 Sep 2019 14:33:27 +0000 (14:33 +0000)]
[Hexagon] Bitcast v4i16 to v8i8, unify no-op casts between scalar and HVX

llvm-svn: 372616

4 years ago[docs] Fix some typos in InternalsManual
Sven van Haastregt [Mon, 23 Sep 2019 14:24:29 +0000 (14:24 +0000)]
[docs] Fix some typos in InternalsManual

llvm-svn: 372614

4 years ago[Alignment][NFC] Migrate Instructions to Align
Guillaume Chatelet [Mon, 23 Sep 2019 14:23:37 +0000 (14:23 +0000)]
[Alignment][NFC] Migrate Instructions to Align

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372613

4 years ago[Diagnostics] Warn if '<<' in bool context with -Wint-in-bool-context (GCC compatibility)
David Bolvansky [Mon, 23 Sep 2019 14:21:08 +0000 (14:21 +0000)]
[Diagnostics] Warn if '<<' in bool context with -Wint-in-bool-context (GCC compatibility)

Extracted from D63082, addressed review comments related to a warning message.

llvm-svn: 372612

4 years agoFix test atomic-expr.cpp after R372422
Erich Keane [Mon, 23 Sep 2019 14:12:13 +0000 (14:12 +0000)]
Fix test atomic-expr.cpp after R372422

The test tried to match a path in a printout by doing '^:' which failed
on windows, since C:\... is a path.

llvm-svn: 372611

4 years ago[llvm] [cmake] Add possibility to use ChooseMSVCCRT.cmake when include LLVM library
Simon Pilgrim [Mon, 23 Sep 2019 14:11:48 +0000 (14:11 +0000)]
[llvm] [cmake] Add possibility to use ChooseMSVCCRT.cmake when include LLVM library

Modify LLVMConfig to produce LLVM_USE_CRT variables in build-directory. It helps to set the same compiler debug options like in builded library.

Committed on behalf of @igorban (Igor)

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

llvm-svn: 372610

4 years ago[OPENMP]Call __kmpc_push_tripcount in task context.
Alexey Bataev [Mon, 23 Sep 2019 14:06:51 +0000 (14:06 +0000)]
[OPENMP]Call __kmpc_push_tripcount in task context.

Runtime function __kmpc_push_tripcount better to call inside of the task
context for target regions. Otherwise, the libomptarget is unable to
link the provided tripcount value for nowait target regions and
completely looses this information.

llvm-svn: 372609

4 years ago[LLDB] Fix logically dead code
Konrad Kleine [Mon, 23 Sep 2019 14:05:51 +0000 (14:05 +0000)]
[LLDB] Fix logically dead code

Summary:
The indicated dead code may have performed some action; that action will never occur.

In lldb_private::LoadedModuleInfoList::LoadedModuleInfo::operator ==(lldb_private::LoadedModuleInfoList::LoadedModuleInfo const &): Code can never be reached because of a logical contradiction (CWE-561)

Coverity Scan: https://scan.coverity.com/projects/kwk-llvm-project?tab=overview

CID 221581

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 372608

4 years agoAdded a test for agreement between paths used in ClangTidy's diagnostics and header...
Dmitri Gribenko [Mon, 23 Sep 2019 13:44:42 +0000 (13:44 +0000)]
Added a test for agreement between paths used in ClangTidy's diagnostics and header filter

This test would have been broken by r372388.

llvm-svn: 372607

4 years ago[x86] fix assert with horizontal math + broadcast of vector (PR43402)
Sanjay Patel [Mon, 23 Sep 2019 13:30:23 +0000 (13:30 +0000)]
[x86] fix assert with horizontal math + broadcast of vector (PR43402)

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

llvm-svn: 372606

4 years ago[libTooling] Add `access` and `ifBound` combinators to Stencil library.
Yitzhak Mandelbaum [Mon, 23 Sep 2019 13:21:42 +0000 (13:21 +0000)]
[libTooling] Add `access` and `ifBound` combinators to Stencil library.

Summary:
This revision add the `access` and `ifBound` combinators to the Stencil library:
* `access` -- constructs an idiomatic expression for accessing a member (a
  `MemberExpr`).
* `ifBound` -- chooses between two `StencilParts` based on the whether an id is
  bound in the match (corresponds to the combinator of the same name in
  RangeSelector).

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 372605

4 years ago[ValueTracking] Remove unused matchSelectPattern optional argument. NFCI.
Simon Pilgrim [Mon, 23 Sep 2019 13:20:47 +0000 (13:20 +0000)]
[ValueTracking] Remove unused matchSelectPattern optional argument. NFCI.

The matchSelectPattern const wrapper is never explicitly called with the optional Instruction::CastOps argument, and it turns out that it wasn't being forwarded to matchSelectPattern anyway!

Noticed while investigating clang static analyzer warnings.

llvm-svn: 372604

4 years ago[ValueTracking] Fix uninitialized variable warnings in matchSelectPattern const wrapp...
Simon Pilgrim [Mon, 23 Sep 2019 13:15:52 +0000 (13:15 +0000)]
[ValueTracking] Fix uninitialized variable warnings in matchSelectPattern const wrapper. NFCI.

Static analyzer complains about const_cast uninitialized variables, we should explicitly set these to null.

Ideally that const wrapper would go away though.......

llvm-svn: 372603

4 years agollvm-undname: Add support for demangling typeinfo names
Nico Weber [Mon, 23 Sep 2019 13:13:37 +0000 (13:13 +0000)]
llvm-undname: Add support for demangling typeinfo names

typeinfo names aren't symbols but string constant contents
stored in compiler-generated typeinfo objects, but llvm-cxxfilt
can demangle these for Itanium names.

In the MSVC ABI, these are just a '.' followed by a mangled
type -- this means they don't start with '?' like all MS-mangled
symbols do.

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

llvm-svn: 372602

4 years agoRevert "[clang-tidy] Fix relative path in header-filter."
Dmitri Gribenko [Mon, 23 Sep 2019 13:06:25 +0000 (13:06 +0000)]
Revert "[clang-tidy] Fix relative path in header-filter."

This reverts commit r372388. It made '-header-filter' inconsistent with
paths printed in diagnostics.

llvm-svn: 372601

4 years ago[Diagnostics] Avoid -Wsizeof-array-div when dividing the size of a nested array by...
David Bolvansky [Mon, 23 Sep 2019 12:54:35 +0000 (12:54 +0000)]
[Diagnostics] Avoid -Wsizeof-array-div when dividing the size of a nested array by the size of the deepest base type

llvm-svn: 372600

4 years agoCosmetic; don't use the magic constant 35 when HASH is more readable. This matches...
Mark Murray [Mon, 23 Sep 2019 12:52:42 +0000 (12:52 +0000)]
Cosmetic; don't use the magic constant 35 when HASH is more readable. This matches other MCK__<THING>_* usage better.

Summary: No functional change. This fixes a magic constant in MCK__*_... macros only.

Reviewers: ostannard

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372599

4 years agoFunction::BuildLazyArguments() - fix "variable used but never read" analyzer warning...
Simon Pilgrim [Mon, 23 Sep 2019 12:49:39 +0000 (12:49 +0000)]
Function::BuildLazyArguments() - fix "variable used but never read" analyzer warning. NFCI.

Simplify the code by separating the masking of the SDC variable from using it.

llvm-svn: 372598

4 years agogn build: Merge r372595
GN Sync Bot [Mon, 23 Sep 2019 12:44:45 +0000 (12:44 +0000)]
gn build: Merge r372595

llvm-svn: 372597