platform/upstream/llvm.git
4 years ago[CMake] Make Core depend on ClangDriverOptions (NFC)
Jonas Devlieghere [Fri, 27 Sep 2019 17:55:49 +0000 (17:55 +0000)]
[CMake] Make Core depend on ClangDriverOptions (NFC)

ModuleList.cpp includes clang/Driver/Driver.h which depends on
clang/Driver/Options.inc. This patch adds the corresponding TableGen
target to Core.

llvm-svn: 373105

4 years ago[clangd] Fix template type aliases in findExplicitReference
Ilya Biryukov [Fri, 27 Sep 2019 17:55:46 +0000 (17:55 +0000)]
[clangd] Fix template type aliases in findExplicitReference

Reviewers: kadircet

Reviewed By: kadircet

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

Tags: #clang

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

llvm-svn: 373104

4 years agoXFAIL a codegen test AArch64/tailmerging_in_mbp.ll
Jakub Kuderski [Fri, 27 Sep 2019 17:41:17 +0000 (17:41 +0000)]
XFAIL a codegen test AArch64/tailmerging_in_mbp.ll

This test fails when machine dominator tree verifier is run.
Needs more investigation, as this is not a new failure.

llvm-svn: 373103

4 years ago[Reproducer] Always use absolute paths for capture & replay.
Jonas Devlieghere [Fri, 27 Sep 2019 17:30:40 +0000 (17:30 +0000)]
[Reproducer] Always use absolute paths for capture & replay.

The VFS requires files to be have absolute paths. The file collector
makes paths relative to the reproducer root. If the root is a relative
path, this would trigger an assert in the VFS. This patch ensures that
we always make the given path absolute.

Thank you Ted Woodward for pointing this out!

llvm-svn: 373102

4 years ago[Dominators][CodeGen] Clean up MachineDominators
Jakub Kuderski [Fri, 27 Sep 2019 17:25:39 +0000 (17:25 +0000)]
[Dominators][CodeGen] Clean up MachineDominators

Summary: This is a cleanup patch for MachineDominatorTree. It would be an NFC, except for replacing custom DomTree verification with the generic one.

Reviewers: tstellar, tpr, nhaehnle, arsenm, NutshellySima, grosser, hliao

Reviewed By: arsenm

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373101

4 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 27 Sep 2019 16:56:07 +0000 (16:56 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

llvm-svn: 373100

4 years agoModuleUtils - silence static analyzer dyn_cast<> null dereference warning. NFCI.
Simon Pilgrim [Fri, 27 Sep 2019 16:55:49 +0000 (16:55 +0000)]
ModuleUtils - silence static analyzer dyn_cast<> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us.

llvm-svn: 373099

4 years agoChange -march=systemz to triple and fix test
Kai Nacke [Fri, 27 Sep 2019 16:19:15 +0000 (16:19 +0000)]
Change -march=systemz to triple and fix test

These two test cases use -march=systemz instead of a triple. In
particular, the used file format is then based on the default host
triple. This leads to different behaviour on different platforms.

The SystemZ implementation uses the integrated assembler for a
long time now. The mature-mc-support test can be fully enabled.

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

llvm-svn: 373098

4 years agoFunctionImportGlobalProcessing::processGlobalForThinLTO - silence static analyzer...
Simon Pilgrim [Fri, 27 Sep 2019 15:49:19 +0000 (15:49 +0000)]
FunctionImportGlobalProcessing::processGlobalForThinLTO - silence static analyzer dyn_cast<FunctionSummary> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<FunctionSummary> directly and if not assert will fire for us.

llvm-svn: 373097

4 years ago[RISCV] Rename FPRs and use Register arithmetic
Luis Marques [Fri, 27 Sep 2019 15:49:10 +0000 (15:49 +0000)]
[RISCV] Rename FPRs and use Register arithmetic

The new names for FPRs ensure that the Register values within the same class are
enumerated consecutively (the order is determined by the `LessRecordRegister`
function object). Where there were tables mapping between 32- and 64-bit FPRs
(and vice versa) this patch replaces them with Register arithmetic. The
enumeration order between different register classes is expected to continue to
be arbitrary, although it does impact the conversion from the (overloaded) asm
FPR names to Register values, and therefore might require updates to the target
if the sorting algorithm is changed. Static asserts were added to ensure that
changes to the ordering that would impact the current implementation are
detected.

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

llvm-svn: 373096

4 years agoSCCP - silence static analyzer dyn_cast<StructType> null dereference warning. NFCI.
Simon Pilgrim [Fri, 27 Sep 2019 15:49:10 +0000 (15:49 +0000)]
SCCP - silence static analyzer dyn_cast<StructType> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<StructType> directly and if not assert will fire for us.

llvm-svn: 373095

4 years ago[AMDGPU][MC] Corrected parsing of registers
Dmitry Preobrazhensky [Fri, 27 Sep 2019 15:41:31 +0000 (15:41 +0000)]
[AMDGPU][MC] Corrected parsing of registers

Summary of changes:

refactored code for better readability and future improvements;
fixed bug 41281: https://bugs.llvm.org/show_bug.cgi?id=41281

Reviewers: artem.tamazov, arsenm

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

llvm-svn: 373094

4 years ago[libTooling] Transformer: refine `SourceLocation` specified as anchor of changes.
Yitzhak Mandelbaum [Fri, 27 Sep 2019 15:26:04 +0000 (15:26 +0000)]
[libTooling] Transformer: refine `SourceLocation` specified as anchor of changes.

Summary: Every change triggered by a rewrite rule is anchored at a particular
location in the source code.  This patch refines how that location is chosen and
defines it as an explicit function so it can be shared by other Transformer
implementations.

This patch was inspired by a bug found by a clang tidy, wherein two changes were
anchored at the same location (the expansion loc of the macro) resulting in the
discarding of the second change.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373093

4 years ago[libc++] Take 2: Implement LWG 3158
Louis Dionne [Fri, 27 Sep 2019 15:06:52 +0000 (15:06 +0000)]
[libc++] Take 2: Implement LWG 3158

Summary:
LWG 3158 marks the allocator_arg_t constructor of std::tuple as
conditionnally explicit based on whether the default constructors
of the tuple's members are explicitly default constructible.

This was previously committed as r372778 and reverted in r372832 due to
the commit breaking LLVM's build in C++14 mode. This issue has now been
addressed.

Reviewers: mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

llvm-svn: 373092

4 years agoremove File::SetStream(), make new files instead.
Lawrence D'Anna [Fri, 27 Sep 2019 14:33:35 +0000 (14:33 +0000)]
remove File::SetStream(), make new files instead.

Summary:
This patch removes File::SetStream() and File::SetDescriptor(),
and replaces most direct uses of File with pointers to File.
Instead of calling SetStream() on a file, we make a new file and
replace it.

My ultimate goal here is to introduce a new API class SBFile, which
has full support for python io.IOStream file objects.   These can
redirect read() and write() to python code, so lldb::Files will
need a way to dispatch those methods.   Additionally it will need some
form of sharing and assigning files, as a SBFile will be passed in and
assigned to the main IO streams of the debugger.

In my prototype patch queue, I make File itself copyable and add a
secondary class FileOps to manage the sharing and dispatch.  In that
case SBFile was a unique_ptr<File>.
(here: https://github.com/smoofra/llvm-project/tree/files)

However in review, Pavel Labath suggested that it be shared_ptr instead.
(here: https://reviews.llvm.org/D67793)

In order for SBFile to use shared_ptr<File>, everything else should
as well.

If this patch is accepted, I will make SBFile use a shared_ptr
I will remove FileOps from future patches and use subclasses of File
instead.

Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 373090

4 years ago[DebugInfo] Exclude memory location values as parameter entry values
Djordje Todorovic [Fri, 27 Sep 2019 13:52:43 +0000 (13:52 +0000)]
[DebugInfo] Exclude memory location values as parameter entry values

Abandon describing of loaded values due to safety concerns. Loaded
values are described as derefed memory location at caller point.
At callee we can unintentionally change that memory location which
would lead to different entry being printed value before and after
the memory location clobbering. This problem is described in
llvm.org/PR43343.

Patch by Nikola Prica

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

llvm-svn: 373089

4 years ago[OpenCL] Pass LangOptions as const ref
Sven van Haastregt [Fri, 27 Sep 2019 13:31:29 +0000 (13:31 +0000)]
[OpenCL] Pass LangOptions as const ref

llvm-svn: 373088

4 years ago[llvm-exegesis] Fix r373083: Module -> Mod.
Clement Courbet [Fri, 27 Sep 2019 13:21:37 +0000 (13:21 +0000)]
[llvm-exegesis] Fix r373083: Module -> Mod.

SnippetRepetitorTest.cpp:66:27: error: declaration of ‘std::unique_ptr<llvm::Module> llvm::exegesis::{anonymous}::X86SnippetRepetitorTest::Module’ [-fpermissive]
   std::unique_ptr<Module> Module;

llvm-svn: 373087

4 years agogn build: (manually) merge r373082
Nico Weber [Fri, 27 Sep 2019 13:14:34 +0000 (13:14 +0000)]
gn build: (manually) merge r373082

llvm-svn: 373086

4 years agogn build: Merge r373083
GN Sync Bot [Fri, 27 Sep 2019 13:04:46 +0000 (13:04 +0000)]
gn build: Merge r373083

llvm-svn: 373085

4 years ago[CodeGenPrepare] Mend "avoid crashing from replacing a phi twice" fix.
Jesper Antonsson [Fri, 27 Sep 2019 13:01:37 +0000 (13:01 +0000)]
[CodeGenPrepare] Mend "avoid crashing from replacing a phi twice" fix.

Summary:
An erroneously negated if-statement by an earlier (March 2019) bugfix left phi replacement/simplification under optimizeMemoryInst()  in CodeGenPrepare largely inactivated. The error was found when csmith found that the same assert as in the original bug report could still be triggered in a different way. This patch fixes the bugfix. The original bug was:
 https://bugs.llvm.org/show_bug.cgi?id=41052
... and the previous fix was D59358.

Reviewers: aprantl, skatkov

Reviewed By: skatkov

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373084

4 years ago[llvm-exegesis] Add loop mode for repeating the snippet.
Clement Courbet [Fri, 27 Sep 2019 12:56:24 +0000 (12:56 +0000)]
[llvm-exegesis] Add loop mode for repeating the snippet.

Summary:
Before this change the Executable function was made by duplicating the
snippet. This change adds a --repetion-mode={loop|duplicate} flag that
allows choosing between this behaviour and wrapping the snippet instructions
in a loop.

The new mode can help measurements when the snippet fits in the DSB by
short-cirtcuiting decoding. The loop adds a dec + jmp to the measurements, but
since these are not part of the critical path, they execute in parallel
with the measured code and do not impact measurements in practice.

Overview of the change:
 - New SnippetRepetitor abstraction that handles repeating the snippet.
   The assembler delegates repeating the instructions to this class.
 - ExegesisTarget learns how to decrement loop counter and jump.
 - Some refactoring of the assembler into FunctionFiller/BasicBlockFiller.

Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

Tags: #llvm

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

llvm-svn: 373083

4 years agoclang-tidy: Don't repeat list of all checks in three places.
Nico Weber [Fri, 27 Sep 2019 12:56:14 +0000 (12:56 +0000)]
clang-tidy: Don't repeat list of all checks in three places.

Instead, put all checks in a cmake variable and reference this.

Also, make clangd use the the ClangTidyForceLinker.h header instead
of duplicating the list of modules -- the duplicate copy was missing
the new "darwin" checker added in r373065.

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

llvm-svn: 373082

4 years ago[Alignment][NFC] Remove unneeded llvm:: scoping on Align types
Guillaume Chatelet [Fri, 27 Sep 2019 12:54:21 +0000 (12:54 +0000)]
[Alignment][NFC] Remove unneeded llvm:: scoping on Align types

llvm-svn: 373081

4 years ago[clangd] Remove an unrelated comment, NFC.
Haojian Wu [Fri, 27 Sep 2019 12:32:19 +0000 (12:32 +0000)]
[clangd] Remove an unrelated comment, NFC.

llvm-svn: 373079

4 years ago[clang] [AST] Treat "inline gnu_inline" the same way as "extern inline gnu_inline...
Martin Storsjo [Fri, 27 Sep 2019 12:25:19 +0000 (12:25 +0000)]
[clang] [AST] Treat "inline gnu_inline" the same way as "extern inline gnu_inline" in C++ mode

This matches how GCC handles it, see e.g. https://gcc.godbolt.org/z/HPplnl.
GCC documents the gnu_inline attribute with "In C++, this attribute does
not depend on extern in any way, but it still requires the inline keyword
to enable its special behavior."

The previous behaviour of gnu_inline in C++, without the extern
keyword, can be traced back to the original commit that added
support for gnu_inline, SVN r69045.

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

llvm-svn: 373078

4 years ago[LLD] Simplify the demangleItanium function. NFC.
Martin Storsjo [Fri, 27 Sep 2019 12:24:18 +0000 (12:24 +0000)]
[LLD] Simplify the demangleItanium function. NFC.

Instead of returning an optional, just return the input string if
demangling fails, as that's what all callers use anyway.

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

llvm-svn: 373077

4 years ago[LLD] Convert demangleItanium to use the higher level llvm::demangle function. NFC.
Martin Storsjo [Fri, 27 Sep 2019 12:24:03 +0000 (12:24 +0000)]
[LLD] Convert demangleItanium to use the higher level llvm::demangle function. NFC.

This avoids a few lines of boilerplate of dealing with C string
allocations.

Add a testcase for a case where demangling shouldn't happen.

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

llvm-svn: 373076

4 years ago[LLD] [COFF] Use the unified llvm demangle frontend function. NFC.
Martin Storsjo [Fri, 27 Sep 2019 12:23:45 +0000 (12:23 +0000)]
[LLD] [COFF] Use the unified llvm demangle frontend function. NFC.

Add test cases for some cases where we don't want demangling to happen.

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

llvm-svn: 373075

4 years ago[lldb] Disable testing entry values as memory location
Djordje Todorovic [Fri, 27 Sep 2019 12:16:29 +0000 (12:16 +0000)]
[lldb] Disable testing entry values as memory location

The D67717 excludes such locations for now.

llvm-svn: 373074

4 years ago[lldb/cmake] add lldbCore -> clangDriver dependency
Pavel Labath [Fri, 27 Sep 2019 12:10:12 +0000 (12:10 +0000)]
[lldb/cmake] add lldbCore -> clangDriver dependency

ModuleList.cpp includes clang/Driver/Driver.h. Reflect that in the build
system. Not having this can cause build failures if ModuleList.cpp is
built before Driver.inc is generated.

llvm-svn: 373073

4 years agoUnwind: Add a stack scanning mechanism to support win32 unwinding
Pavel Labath [Fri, 27 Sep 2019 12:10:06 +0000 (12:10 +0000)]
Unwind: Add a stack scanning mechanism to support win32 unwinding

Summary:
Windows unwinding is weird. The unwind rules do not (always) describe
the precise layout of the stack, but rather expect the debugger to scan
the stack for something which looks like a plausible return address, and
the unwind based on that. The reason this works somewhat reliably is
because the the unwinder also has access to the frame sizes of the
functions on the stack. This allows it (in most cases) to skip function
pointers in local variables or function arguments, which could otherwise
be mistaken for return addresses.

Implementing this kind of unwind mechanism in lldb was a bit challenging
because we expect to be able to statically describe (in the UnwindPlan)
structure, the layout of the stack for any given instruction. Giving a
precise desription of this is not possible, because it requires
correlating information from two functions -- the pushed arguments to a
function are considered a part of the callers stack frame, and their
size needs to be considered when unwinding the caller, but they are only
present in the unwind entry of the callee. The callee may end up being
in a completely different module, or it may not even be possible to
determine it statically (indirect calls).

This patch implements this functionality by introducing a couple of new
APIs:
SymbolFile::GetParameterStackSize - return the amount of stack space
  taken up by parameters of this function.
SymbolFile::GetOwnFrameSize - the size of this function's frame. This
  excludes the parameters, but includes stuff like local variables and
  spilled registers.

These functions are then used by the unwinder to compute the estimated
location of the return address. This address is not always exact,
because the stack may contain some additional values -- for instance, if
we're getting ready to call a function then the stack will also contain
partially set up arguments, but we will not know their size because we
haven't called the function yet. For this reason the unwinder will crawl
up the stack from the return address position, and look for something
that looks like a possible return address. Currently, we assume that
something is a valid return address if it ends up pointing to an
executable section.

All of this logic kicks in when the UnwindPlan sets the value of CFA as
"isHeuristicallyDetected", which is also the final new API here. Right
now, only SymbolFileBreakpad implements these APIs, but in the future
SymbolFilePDB will use them too.

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

llvm-svn: 373072

4 years agoDisable the empty string check in TestDataFormatterStdString
Pavel Labath [Fri, 27 Sep 2019 11:39:27 +0000 (11:39 +0000)]
Disable the empty string check in TestDataFormatterStdString

This check was failing since it was added in r372837. It should be
possible to re-enable it once D68010 lands.

llvm-svn: 373071

4 years agoReland "gn build: (manually) merge r373028"
Nico Weber [Fri, 27 Sep 2019 11:37:59 +0000 (11:37 +0000)]
Reland "gn build: (manually) merge r373028"

This relands r373029, reverted in 373033, because r373028 relanded in r373066.

llvm-svn: 373070

4 years agoFix some swig warnings
Pavel Labath [Fri, 27 Sep 2019 11:30:16 +0000 (11:30 +0000)]
Fix some swig warnings

Previously, these were unseen because the wrapper script would swallow
them. This fixes the following types of warnings:
- methods being declared more than once
- swig complained about ignoring operator=, so I just removed it

llvm-svn: 373069

4 years agoFixed indentation in a ClangTidy test
Dmitri Gribenko [Fri, 27 Sep 2019 10:58:10 +0000 (10:58 +0000)]
Fixed indentation in a ClangTidy test

llvm-svn: 373068

4 years ago[clangd] Handle type template parameters in findExplicitReferences
Ilya Biryukov [Fri, 27 Sep 2019 10:55:53 +0000 (10:55 +0000)]
[clangd] Handle type template parameters in findExplicitReferences

Reviewers: kadircet

Reviewed By: kadircet

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

Tags: #clang

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

llvm-svn: 373067

4 years agoMoved -fblocks from an individual test to check_clang_tidy.py
Dmitri Gribenko [Fri, 27 Sep 2019 10:54:28 +0000 (10:54 +0000)]
Moved -fblocks from an individual test to check_clang_tidy.py

This way, all tests will benefit from it and will not have to worry
about setting up language options properly.

llvm-svn: 373066

4 years ago[clang-tidy] New check to warn when storing dispatch_once_t in non-static, non-global...
Dmitri Gribenko [Fri, 27 Sep 2019 10:49:12 +0000 (10:49 +0000)]
[clang-tidy] New check to warn when storing dispatch_once_t in non-static, non-global storage.

Summary:
Creates a new darwin ClangTidy module and adds the darwin-dispatch-once-nonstatic check that warns about dispatch_once_t variables not in static or global storage. This catches a missing static for local variables in e.g. singleton initialization behavior, and also warns on storing dispatch_once_t values in Objective-C instance variables. C/C++ struct/class instances may potentially live in static/global storage, and are ignored for this check.

The osx.API static analysis checker can find the non-static storage use of dispatch_once_t; I thought it useful to also catch this issue in clang-tidy when possible.

This is a re-land of https://reviews.llvm.org/D67567

Reviewers: thakis, gribozavr, stephanemoore

Subscribers: Eugene.Zelenko, mgorny, xazax.hun, jkorous, arphaman, kadircet, usaxena95

Tags: #clang-tools-extra, #clang, #llvm

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

llvm-svn: 373065

4 years ago[NFC][ARM] Add some tail-predication tests
Sam Parker [Fri, 27 Sep 2019 10:33:53 +0000 (10:33 +0000)]
[NFC][ARM] Add some tail-predication tests

Use different data types for some simple loops.

llvm-svn: 373064

4 years ago[SLPVectorizer][X86] Regenerate arith-fp tests
Simon Pilgrim [Fri, 27 Sep 2019 10:04:25 +0000 (10:04 +0000)]
[SLPVectorizer][X86] Regenerate arith-fp tests

llvm-svn: 373063

4 years ago[UpdateTestChecks] Fix wildcard support on DOS prompts
Simon Pilgrim [Fri, 27 Sep 2019 10:04:16 +0000 (10:04 +0000)]
[UpdateTestChecks] Fix wildcard support on DOS prompts

D64572 / rL365818 changed the way that the file paths were collected, which meant we lost the file pattern expansion necessary when working with DOS command prompt

llvm-svn: 373062

4 years ago[lldb] [testsuite] Remove redundant MAKE_DSYM := NO
Jan Kratochvil [Fri, 27 Sep 2019 09:59:53 +0000 (09:59 +0000)]
[lldb] [testsuite] Remove redundant MAKE_DSYM := NO

According to a comment by Pavel Labath:
https://reviews.llvm.org/D67589#inline-612375

llvm-svn: 373061

4 years agoRevert r372893 "[CodeGen] Replace -max-jump-table-size with -max-jump-table-targets"
Hans Wennborg [Fri, 27 Sep 2019 09:54:26 +0000 (09:54 +0000)]
Revert r372893 "[CodeGen] Replace -max-jump-table-size with -max-jump-table-targets"

This caused severe compile-time regressions, see PR43455.

> Modern processors predict the targets of an indirect branch regardless of
> the size of any jump table used to glean its target address.  Moreover,
> branch predictors typically use resources limited by the number of actual
> targets that occur at run time.
>
> This patch changes the semantics of the option `-max-jump-table-size` to limit
> the number of different targets instead of the number of entries in a jump
> table.  Thus, it is now renamed to `-max-jump-table-targets`.
>
> Before, when `-max-jump-table-size` was specified, it could happen that
> cluster jump tables could have targets used repeatedly, but each one was
> counted and typically resulted in tables with the same number of entries.
> With this patch, when specifying `-max-jump-table-targets`, tables may have
> different lengths, since the number of unique targets is counted towards the
> limit, but the number of unique targets in tables is the same, but for the
> last one containing the balance of targets.
>
> Differential revision: https://reviews.llvm.org/D60295

llvm-svn: 373060

4 years agoRevert r373056: [clang-format] Reference qualifiers in member templates causing extra...
Ilya Biryukov [Fri, 27 Sep 2019 09:49:20 +0000 (09:49 +0000)]
Revert r373056: [clang-format] Reference qualifiers in member templates causing extra indentation

Reason: this breaks unit tests.
llvm-svn: 373059

4 years ago[sancov][NFC] Make filename Regexes "const"
Thomas Preud'homme [Fri, 27 Sep 2019 09:39:13 +0000 (09:39 +0000)]
[sancov][NFC] Make filename Regexes "const"

Summary:
The const-correctness of match() was fixed in rL372764, which allows
such static Regex objects to be marked const.

Reviewers: thopre

Reviewed By: thopre

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373058

4 years ago[clangd] Support OverloadExpr in findExplicitReferences
Ilya Biryukov [Fri, 27 Sep 2019 09:39:10 +0000 (09:39 +0000)]
[clangd] Support OverloadExpr in findExplicitReferences

Reviewers: kadircet

Reviewed By: kadircet

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

Tags: #clang

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

llvm-svn: 373057

4 years ago[clang-format] Reference qualifiers in member templates causing extra indentation
Ilya Biryukov [Fri, 27 Sep 2019 09:24:58 +0000 (09:24 +0000)]
[clang-format] Reference qualifiers in member templates causing extra indentation

The following code

```
struct f {
  template <class T>
  void bar() && noexcept {}
};
```

will be formatted to the following with LLVM style, and
`AlwaysBreakTemplateDeclarations: Yes`

```
struct f {
  template <class T>
      void bar() && noexcept {}
};
```

The indentation of the `void bar()` line is wrong.

Patch by Andreas Wass (AndWass)!

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

llvm-svn: 373056

4 years ago[NFC][InstCombine] Revisit shift-by-signext tests
Roman Lebedev [Fri, 27 Sep 2019 09:09:15 +0000 (09:09 +0000)]
[NFC][InstCombine] Revisit shift-by-signext tests

llvm-svn: 373055

4 years ago[Alignment][NFC] MaybeAlign in GVNExpression
Guillaume Chatelet [Fri, 27 Sep 2019 08:56:43 +0000 (08:56 +0000)]
[Alignment][NFC] MaybeAlign in GVNExpression

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/D67922

llvm-svn: 373054

4 years ago[lldb] Print an error message for an empty subcommand
Raphael Isemann [Fri, 27 Sep 2019 08:49:41 +0000 (08:49 +0000)]
[lldb] Print an error message for an empty subcommand

llvm-svn: 373053

4 years ago[MC][ARM] vscclrm disassembles as vldmia
Alexandros Lamprineas [Fri, 27 Sep 2019 08:22:24 +0000 (08:22 +0000)]
[MC][ARM] vscclrm disassembles as vldmia

Happens only when the mve.fp subtarget feature is enabled:

$ llvm-mc -triple thumbv8.1m.main -mattr=+mve.fp,+8msecext -disassemble <<< "0x9f,0xec,0x08,0x0b"
  .text
  vldmia  pc, {d0, d1, d2, d3}
$ llvm-mc -triple thumbv8.1m.main -mattr=+8msecext -disassemble <<< "0x9f,0xec,0x08,0x0b"
  .text
  vscclrm {d0, d1, d2, d3, vpr}

Assembling returns the correct encoding with or without mve.fp:

$ llvm-mc -triple thumbv8.1m.main -mattr=+mve.fp,+8msecext -show-encoding <<< "vscclrm {d0-d3, vpr}"
  .text
  vscclrm {d0, d1, d2, d3, vpr}   @ encoding: [0x9f,0xec,0x08,0x0b]
$ llvm-mc -triple thumbv8.1m.main -mattr=+8msecext -show-encoding <<< "vscclrm {d0-d3, vpr}"
  .text
  vscclrm {d0, d1, d2, d3, vpr}   @ encoding: [0x9f,0xec,0x08,0x0b]

The problem seems to be in the TableGen description of VSCCLRMD.
The least significant bit should be set to zero.

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

llvm-svn: 373052

4 years ago[lldb][NFC] Actually test which method we call in TestCallOverriddenMethod
Raphael Isemann [Fri, 27 Sep 2019 08:21:08 +0000 (08:21 +0000)]
[lldb][NFC] Actually test which method we call in TestCallOverriddenMethod

llvm-svn: 373051

4 years ago[lldb][NFC] Test CommandObjectMultiword functionality
Raphael Isemann [Fri, 27 Sep 2019 08:18:38 +0000 (08:18 +0000)]
[lldb][NFC] Test CommandObjectMultiword functionality

A lot of commands are made up of CommandObjectMultiword with
subcommands. CommandObjectMultiword actually has some functionality
on its own that wasn't tested before.

llvm-svn: 373050

4 years agoFix the 'directory' field in DumpCompilationDatabase and add test
Hans Wennborg [Fri, 27 Sep 2019 08:14:45 +0000 (08:14 +0000)]
Fix the 'directory' field in DumpCompilationDatabase and add test

This broke in r371027 due to a missing negation
(llvm::sys::fs::current_path returns false on success).

llvm-svn: 373049

4 years ago[llvm-exegesis] Refactor how forbidden registers are computed.
Clement Courbet [Fri, 27 Sep 2019 08:04:10 +0000 (08:04 +0000)]
[llvm-exegesis] Refactor how forbidden registers are computed.

Summary:
Right now latency generation can incorrectly select the scratch register
as a dependency-carrying register.
 - Move the logic for preventing register selection from Uops
   implementation to common SnippetGenerator class.
 - Aliasing detection now takes a set of forbidden registers just like
   random register assignment does.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

llvm-svn: 373048

4 years agotravis: Add LLVM 9 build
Jan Vesely [Fri, 27 Sep 2019 05:58:15 +0000 (05:58 +0000)]
travis: Add LLVM 9 build

Reviewer: tstellar
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 373047

4 years agotravis: Switch to Ubuntu 16.04 (xenial)
Jan Vesely [Fri, 27 Sep 2019 05:57:38 +0000 (05:57 +0000)]
travis: Switch to Ubuntu 16.04 (xenial)

Use native packages up to llvm-6.

Reviewer: tstellar
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 373046

4 years ago[LoopInfo] Remove duplicates in ExitBlocks to reduce the compile time of
Wei Mi [Fri, 27 Sep 2019 05:43:31 +0000 (05:43 +0000)]
[LoopInfo] Remove duplicates in ExitBlocks to reduce the compile time of
hasDedicatedExits.

For the compile time problem described in https://reviews.llvm.org/D67359,
turns out the root cause is there are many duplicates in ExitBlocks so
the algorithm complexity of hasDedicatedExits gets very high. If we remove
the duplicates, the compile time issue is gone.

Thanks to Philip Reames for raising a good question and it leads me to
find the root cause.

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

llvm-svn: 373045

4 years agoRevert "[LoopInfo] Limit the iterations to check whether a loop has dedicated
Wei Mi [Fri, 27 Sep 2019 05:43:30 +0000 (05:43 +0000)]
Revert "[LoopInfo] Limit the iterations to check whether a loop has dedicated
exits"

Get a better approach in https://reviews.llvm.org/D68107 to solve the problem.
Revert the initial patch and will commit the new one soon.

This reverts commit rL372990.

llvm-svn: 373044

4 years ago[test] Use %clang_cc1 instead of %clang -cc1
Fangrui Song [Fri, 27 Sep 2019 05:37:06 +0000 (05:37 +0000)]
[test] Use %clang_cc1 instead of %clang -cc1

llvm-svn: 373043

4 years agoFix use-after-free found in Clang's testsuite.
Richard Smith [Fri, 27 Sep 2019 05:36:16 +0000 (05:36 +0000)]
Fix use-after-free found in Clang's testsuite.

We need to discard all remaining cleanups if an earlier cleanup failed,
otherwise we may try to rerun the remaining cleanups later, potentially
after the scope containing the object is destroyed. (This can happen
when checking a potential constant expression.)

llvm-svn: 373042

4 years ago[WebAssembly] v128.andnot
Thomas Lively [Fri, 27 Sep 2019 02:11:40 +0000 (02:11 +0000)]
[WebAssembly] v128.andnot

Summary:
As specified at
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#bitwise-and-not

Reviewers: aheejin

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

Tags: #llvm

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

llvm-svn: 373041

4 years ago[WebAssembly] SIMD Load and extend operations
Thomas Lively [Fri, 27 Sep 2019 02:06:50 +0000 (02:06 +0000)]
[WebAssembly] SIMD Load and extend operations

Summary:
As specified at
https://github.com/webassembly/simd/blob/master/proposals/simd/SIMD.md#load-and-extend.
These instructions are behind the unimplemented-simd128 target feature
for now because they have not been implemented in V8 yet.

Reviewers: aheejin

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

Tags: #llvm

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

llvm-svn: 373040

4 years agoRevert r373034
Nicholas Allegra [Fri, 27 Sep 2019 01:58:31 +0000 (01:58 +0000)]
Revert r373034

It breaks the build on MSVC.

llvm-svn: 373039

4 years agoSpeculative fix for gcc build.
Peter Collingbourne [Fri, 27 Sep 2019 01:35:04 +0000 (01:35 +0000)]
Speculative fix for gcc build.

llvm-svn: 373038

4 years agoFor P0784R7: add support for new (std::nothrow).
Richard Smith [Fri, 27 Sep 2019 01:26:49 +0000 (01:26 +0000)]
For P0784R7: add support for new (std::nothrow).

llvm-svn: 373037

4 years agoFor P0784R7: Add support for dynamic allocation with new / delete during
Richard Smith [Fri, 27 Sep 2019 01:26:47 +0000 (01:26 +0000)]
For P0784R7: Add support for dynamic allocation with new / delete during
constant evaluation.

llvm-svn: 373036

4 years agohwasan: Compatibility fixes for short granules.
Peter Collingbourne [Fri, 27 Sep 2019 01:02:10 +0000 (01:02 +0000)]
hwasan: Compatibility fixes for short granules.

We can't use short granules with stack instrumentation when targeting older
API levels because the rest of the system won't understand the short granule
tags stored in shadow memory.

Moreover, we need to be able to let old binaries (which won't understand
short granule tags) run on a new system that supports short granule
tags. Such binaries will call the __hwasan_tag_mismatch function when their
outlined checks fail. We can compensate for the binary's lack of support
for short granules by implementing the short granule part of the check in
the __hwasan_tag_mismatch function. Unfortunately we can't do anything about
inline checks, but I don't believe that we can generate these by default on
aarch64, nor did we do so when the ABI was fixed.

A new function, __hwasan_tag_mismatch_v2, is introduced that lets code
targeting the new runtime avoid redoing the short granule check. Because tag
mismatches are rare this isn't important from a performance perspective; the
main benefit is that it introduces a symbol dependency that prevents binaries
targeting the new runtime from running on older (i.e. incompatible) runtimes.

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

llvm-svn: 373035

4 years ago[Consumed][NFC] Refactor handleCall to take function argument list.
Nicholas Allegra [Thu, 26 Sep 2019 23:47:18 +0000 (23:47 +0000)]
[Consumed][NFC] Refactor handleCall to take function argument list.

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

llvm-svn: 373034

4 years agoRevert "gn build: (manually) merge r373028"
Dmitri Gribenko [Thu, 26 Sep 2019 23:30:47 +0000 (23:30 +0000)]
Revert "gn build: (manually) merge r373028"

This reverts commit r373029, which depends on r373028, which I reverted.

llvm-svn: 373033

4 years agoRevert "[clang-tidy] New check to warn when storing dispatch_once_t in non-static...
Dmitri Gribenko [Thu, 26 Sep 2019 23:28:31 +0000 (23:28 +0000)]
Revert "[clang-tidy] New check to warn when storing dispatch_once_t in non-static, non-global storage"

This reverts commit r373028, because the new test fails on Linux.

llvm-svn: 373032

4 years ago[X86] Remove CodeGenOnly instructions added in r373021, but keep the isel patterns...
Craig Topper [Thu, 26 Sep 2019 23:22:15 +0000 (23:22 +0000)]
[X86] Remove CodeGenOnly instructions added in r373021, but keep the isel patterns and add COPY_TO_REGCLASS to them.

llvm-svn: 373031

4 years agogn build: (manually) merge r373028
Nico Weber [Thu, 26 Sep 2019 23:17:25 +0000 (23:17 +0000)]
gn build: (manually) merge r373028

llvm-svn: 373029

4 years ago[clang-tidy] New check to warn when storing dispatch_once_t in non-static, non-global...
Stephane Moore [Thu, 26 Sep 2019 23:04:59 +0000 (23:04 +0000)]
[clang-tidy] New check to warn when storing dispatch_once_t in non-static, non-global storage

Summary:
Creates a new darwin ClangTidy module and adds the darwin-dispatch-once-nonstatic check that warns about dispatch_once_t variables not in static or global storage. This catches a missing static for local variables in e.g. singleton initialization behavior, and also warns on storing dispatch_once_t values in Objective-C instance variables. C/C++ struct/class instances may potentially live in static/global storage, and are ignored for this check.

The osx.API static analysis checker can find the non-static storage use of dispatch_once_t; I thought it useful to also catch this issue in clang-tidy when possible.

Contributed By: mwyman

Reviewers: benhamilton, hokein, stephanemoore, aaron.ballman, gribozavr

Reviewed By: stephanemoore, gribozavr

Subscribers: jkorous, arphaman, kadircet, usaxena95, NoQ, xazax.hun, lebedev.ri, mgorny, cfe-commits

Tags: #clang, #clang-tools-extra

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

llvm-svn: 373028

4 years ago[X86] Remove unused arguments from a tablegen multiclass. NFC
Craig Topper [Thu, 26 Sep 2019 22:56:19 +0000 (22:56 +0000)]
[X86] Remove unused arguments from a tablegen multiclass. NFC

llvm-svn: 373026

4 years ago[X86] Add VMOVSSZrrk/VMOVSDZrrk/VMOVSSZrrkz/VMOVSDZrrkz to getUndefRegClearance.
Craig Topper [Thu, 26 Sep 2019 22:56:06 +0000 (22:56 +0000)]
[X86] Add VMOVSSZrrk/VMOVSDZrrk/VMOVSSZrrkz/VMOVSDZrrkz to getUndefRegClearance.

We have isel patterns that can put an IMPLICIT_DEF on one of
the sources for these instructions. So we should make sure
we break any dependencies there. This should be done by
just using one of the other sources.

llvm-svn: 373025

4 years agoRemove the AliasAnalysis argument in function areMemAccessesTriviallyDisjoint
Changpeng Fang [Thu, 26 Sep 2019 22:53:44 +0000 (22:53 +0000)]
Remove the AliasAnalysis argument in function areMemAccessesTriviallyDisjoint

Reviewers:
  arsenm

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

llvm-svn: 373024

4 years ago[OpenMP 5.0] Fix user-defined mapper lookup in sema
Michael Kruse [Thu, 26 Sep 2019 22:53:01 +0000 (22:53 +0000)]
[OpenMP 5.0] Fix user-defined mapper lookup in sema

This patches fixes the case when a user-defined mapper is attached to
the elements of an array, and to report error when a mapper is used for
types other than struct, class, and union.

Patch by Lingda Li <lildmh@gmail.com>

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

llvm-svn: 373023

4 years agoAlways rebuild a DeclRefExpr if its FoundDecl would change.
Richard Smith [Thu, 26 Sep 2019 22:28:32 +0000 (22:28 +0000)]
Always rebuild a DeclRefExpr if its FoundDecl would change.

Fixes a regression introduced by r369999.

llvm-svn: 373022

4 years ago[X86] Add CodeGenOnly instructions for (f32 (X86selects $mask, (loadf32 addr), fp32im...
Craig Topper [Thu, 26 Sep 2019 22:23:09 +0000 (22:23 +0000)]
[X86] Add CodeGenOnly instructions for (f32 (X86selects $mask, (loadf32 addr), fp32imm0) to use masked MOVSS from memory.

Similar for f64 and having a non-zero passthru value.

We were previously not trying to fold the load at all. Using
a CodeGenOnly instruction allows us to use FR32X/FR64X as the
register class to avoid a bunch of COPY_TO_REGCLASS.

llvm-svn: 373021

4 years agoRevert [SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L)...
Jordan Rupprecht [Thu, 26 Sep 2019 22:09:17 +0000 (22:09 +0000)]
Revert [SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!")

This reverts r372626 (git commit 6a278d9073bdc158d31d4f4b15bbe34238f22c18)

llvm-svn: 373019

4 years ago[LoopFusion] Add ability to fuse guarded loops
Kit Barton [Thu, 26 Sep 2019 21:42:45 +0000 (21:42 +0000)]
[LoopFusion] Add ability to fuse guarded loops

Summary:
This patch extends the current capabilities in loop fusion to fuse guarded loops
(as defined in https://reviews.llvm.org/D63885). The patch adds the necessary
safety checks to ensure that it safe to fuse the guarded loops (control flow
equivalent, no intervening code, and same guard conditions). It also provides an
alternative method to perform the actual fusion of guarded loops. The mechanics
to fuse guarded loops are slightly different then fusing non-guarded loops, so I
opted to keep them separate methods. I will be cleaning this up in later
patches, and hope to converge on a single method to fuse both guarded and
non-guarded loops, but for now I think the review will be easier to keep them
separate.

Reviewers: jdoerfert, Meinersbur, dmgreen, etiotto, Whitney

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373018

4 years ago[Unroll] Do NOT unroll a loop with small runtime upperbound
Zhaoshi Zheng [Thu, 26 Sep 2019 21:40:27 +0000 (21:40 +0000)]
[Unroll] Do NOT unroll a loop with small runtime upperbound

For a runtime loop if we can compute its trip count upperbound:

Don't unroll if:
1. loop is not guaranteed to run either zero or upperbound iterations; and
2. trip count upperbound is less than UnrollMaxUpperBound
Unless user or TTI asked to do so.

If unrolling, limit unroll factor to loop's trip count upperbound.

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

Change-Id: I6083c46a9d98b2e22cd855e60523fdc5a4929c73
llvm-svn: 373017

4 years ago[lldb-vscode] correctly handle multiple sourceMap entries
Alex Langford [Thu, 26 Sep 2019 21:18:37 +0000 (21:18 +0000)]
[lldb-vscode] correctly handle multiple sourceMap entries

Summary:
`lldb-vscode` concatenates a string of sourceMap entries
specified in the config, but fails to put a space between
each entry, which causes the settings command to fail.
This patch adds a space between each mapping.

Patch by Richard Howell

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

llvm-svn: 373016

4 years ago[AMDGPU] copy OtherPredicates from pseudo to VOP3_Real
Stanislav Mekhanoshin [Thu, 26 Sep 2019 21:06:17 +0000 (21:06 +0000)]
[AMDGPU] copy OtherPredicates from pseudo to VOP3_Real

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

llvm-svn: 373015

4 years ago[DAGCombine][X86][AArch64][NFC] Add tests for shift-by-signext
Roman Lebedev [Thu, 26 Sep 2019 20:49:49 +0000 (20:49 +0000)]
[DAGCombine][X86][AArch64][NFC] Add tests for shift-by-signext

llvm-svn: 373014

4 years ago[InstCombine][NFC] Add tests for shift-by-signext
Roman Lebedev [Thu, 26 Sep 2019 20:49:30 +0000 (20:49 +0000)]
[InstCombine][NFC] Add tests for shift-by-signext

llvm-svn: 373013

4 years ago[InstCombine][NFC] Regenerate load-cmp.ll test
Roman Lebedev [Thu, 26 Sep 2019 20:49:21 +0000 (20:49 +0000)]
[InstCombine][NFC] Regenerate load-cmp.ll test

llvm-svn: 373012

4 years ago[LOOPGUARD] Disable loop with multiple loop exiting blocks.
Whitney Tsang [Thu, 26 Sep 2019 20:20:42 +0000 (20:20 +0000)]
[LOOPGUARD] Disable loop with multiple loop exiting blocks.
Summary: As discussed in the loop group meeting. With the current
definition of loop guard, we should not allow multiple loop exiting
blocks. For loops that has multiple loop exiting blocks, we can simply
unable to find the loop guard.
When getUniqueExitBlock() obtains a vector size not equals to one, that
means there is either no exit blocks or there exists more than one
unique block the loop exit to.
If we don't disallow loop with multiple loop exit blocks, then with our
current implementation, there can exist exit blocks don't post dominated
by the non pre-header successor of the guard block.
Reviewer: reames, Meinersbur, kbarton, etiotto, bmahjour
Reviewed By: Meinersbur, kbarton
Subscribers: fhahn, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D66529

llvm-svn: 373011

4 years ago[OPENMP50]Emit warnings if the functions was defined/used before marked
Alexey Bataev [Thu, 26 Sep 2019 20:04:15 +0000 (20:04 +0000)]
[OPENMP50]Emit warnings if the functions was defined/used before marked
declare variant.

We can use the original function if it was used/emitted already. So,
just use warnings for these cases, not errors.

llvm-svn: 373010

4 years ago[AIX]Emit function descriptor csect in assembly
Xiangling Liao [Thu, 26 Sep 2019 19:38:32 +0000 (19:38 +0000)]
[AIX]Emit function descriptor csect in assembly

This patch emits the function descriptor csect for functions with definitions
under both 32-bit/64-bit mode on AIX.

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

llvm-svn: 373009

4 years ago[NFC][emacs] remove out-of-date comment from tablegen-mode.el
Bob Haarman [Thu, 26 Sep 2019 19:36:01 +0000 (19:36 +0000)]
[NFC][emacs] remove out-of-date comment from tablegen-mode.el

Summary:
The syntax table was originally based on and attributed to
jasmin.el, but was rewritten in r45192, so the comment that
says the code comes from jasmin.el is no longer accurate. This
change removes the comment, shortening the code a bit.

Reviewers: MaskRay, lattner

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373008

4 years ago[clang-scan-deps] Allow continuation line backslashes followed by whitespace
Alex Lorenz [Thu, 26 Sep 2019 19:28:51 +0000 (19:28 +0000)]
[clang-scan-deps] Allow continuation line backslashes followed by whitespace
in the dependency source minimizer

Clang allows continuations that have whitespace between the backslash and the newline.
This patch ensures that the dependency source minimizer can handle the whitespace between
the backslash and the newline when looking for a line continuation.

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

llvm-svn: 373007

4 years ago[NFC] Precommit tests for D68089
David Bolvansky [Thu, 26 Sep 2019 19:01:18 +0000 (19:01 +0000)]
[NFC] Precommit tests for D68089

llvm-svn: 373006

4 years agoRevert "[analyzer] A speculative attempt to avoid gcc-7 crashes..."
Artem Dergachev [Thu, 26 Sep 2019 18:52:00 +0000 (18:52 +0000)]
Revert "[analyzer] A speculative attempt to avoid gcc-7 crashes..."

This reverts commit r372940 which was an overreaction to a flaky buildbot.

llvm-svn: 373005

4 years agoOnly pass -coverage-notes-file when emitting coverage
Reid Kleckner [Thu, 26 Sep 2019 18:13:19 +0000 (18:13 +0000)]
Only pass -coverage-notes-file when emitting coverage

The only functional change here is that -coverage-notes-file is not
passed to -cc1 in some situations.

This code appears to be trying to put the gcno and gcda output next to
the final object file, but it's doing that in a really convoluted way
that needs to be re-examined. It looks for -c or -S in the original
command, and then looks at the -o argument if present in order to handle
the -fno-integrated-as case. However, this doesn't work if this is a
link command with multiple inputs. I looked into fixing this, but the
check-profile test suite has a lot of dependencies on this behavior, so
I left it all alone.

llvm-svn: 373004

4 years agoConvert FileSystem::Open() to return Expected<FileUP>
Lawrence D'Anna [Thu, 26 Sep 2019 17:54:59 +0000 (17:54 +0000)]
Convert FileSystem::Open() to return Expected<FileUP>

Summary:
This patch converts FileSystem::Open from this prototype:

Status
Open(File &File, const FileSpec &file_spec, ...);

to this one:

llvm::Expected<std::unique_ptr<File>>
Open(const FileSpec &file_spec, ...);

This is beneficial on its own, as llvm::Expected is a more modern
and recommended error type than Status.  It is also a necessary step
towards https://reviews.llvm.org/D67891, and further developments
for lldb_private::File.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 373003

4 years agoDocument requirement of function attributes with constrained floating
Kevin P. Neal [Thu, 26 Sep 2019 17:50:25 +0000 (17:50 +0000)]
Document requirement of function attributes with constrained floating
point.

Reviewed by:    andrew.w.kaylor, uweigand, efriedma
Approved by:    andrew.w.kaylor
Differential Revision:  https://reviews.llvm.org/D67839

llvm-svn: 373002

4 years agoDAGISelMatcherOpt - TGParser::ParseOperation - silence static analyzer cast_or_null...
Simon Pilgrim [Thu, 26 Sep 2019 17:38:47 +0000 (17:38 +0000)]
DAGISelMatcherOpt - TGParser::ParseOperation - silence static analyzer cast_or_null<CheckTypeMatcher> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, replace with an null/isa assertion and cast<CheckTypeMatcher>.

llvm-svn: 373001