platform/upstream/llvm.git
5 years ago[clang-format] [PR43338] C# clang format has space issues betweern C# only keywords
Paul Hoad [Fri, 4 Oct 2019 08:10:22 +0000 (08:10 +0000)]
[clang-format] [PR43338] C# clang format has space issues betweern C# only keywords

Summary:
When formatting C# there can be issues with a lack of spaces between `using (` , `foreach (` and generic types

The C# code

```
public class Foo
{
    Dictionary<string,string> foo;
}

```
will be formatted as

```
public class Foo
{
    Dictionary<string, string>foo;
                           ^^^^^   missing a space
}
```

This revision also reverts some of {D66662} in order to make this cleaner and resolve an issues seen by @owenpan that the formatting didn't add a space when not in a code block

This also transforms C# foreach commands to be seen as tok::kw_for commands (to ensure foreach gets the same Brace Wrapping behavior as for without littering the code with `if(Style.isCSharp())`

Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

llvm-svn: 373709

5 years ago[ELF] Use union-find set and doubly linked list in Call-Chain Clustering (C³) heuristic
Fangrui Song [Fri, 4 Oct 2019 07:56:54 +0000 (07:56 +0000)]
[ELF] Use union-find set and doubly linked list in Call-Chain Clustering (C³) heuristic

Before, SecToClusters[*] was used to track the belonged cluster.
During a merge (From -> Into), every element of From has to be updated.
Use a union-find set to speed up this use case.

Also, replace `std::vector<int> Sections;` with a doubly-linked
pointers: int Next, Prev;

Reviewed By: Bigcheese

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

llvm-svn: 373708

5 years ago[clang-format] [PR43333] Fix C# breaking before function name when using Attributes
Paul Hoad [Fri, 4 Oct 2019 07:56:49 +0000 (07:56 +0000)]
[clang-format] [PR43333] Fix C# breaking before function name when using Attributes

Summary:
This is  a fix for https://bugs.llvm.org/show_bug.cgi?id=43333

This comes with 3 main parts

  - C# attributes cause function names on a new line even when AlwaysBreakAfterReturnType is set to None
  - Add AlwaysBreakAfterReturnType  to None by default in the Microsoft style,
  - C# unit tests are not using Microsoft style (which we created to define the default C# style to match a vanilla C# project).

Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

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

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

llvm-svn: 373707

5 years ago[X86] Enable inline memcmp() to use AVX512
David Zarzycki [Fri, 4 Oct 2019 07:42:34 +0000 (07:42 +0000)]
[X86] Enable inline memcmp() to use AVX512

llvm-svn: 373706

5 years ago[MinGW] Add --reproduce option
Rui Ueyama [Fri, 4 Oct 2019 07:27:45 +0000 (07:27 +0000)]
[MinGW] Add --reproduce option

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

llvm-svn: 373705

5 years agoAdd /reproduce option to lld/COFF
Rui Ueyama [Fri, 4 Oct 2019 07:27:38 +0000 (07:27 +0000)]
Add /reproduce option to lld/COFF

This patch adds /reproduce:<path> option to lld/COFF. This is an
lld-specific option, so we can name it freely. I chose /reproduce
over other names (e.g. /lldlinkrepro) for consistency with other lld
ports.

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

llvm-svn: 373704

5 years agoRevert r371729: lld-link: Make /linkrepro: take a filename, not a directory.
Rui Ueyama [Fri, 4 Oct 2019 07:27:31 +0000 (07:27 +0000)]
Revert r371729: lld-link: Make /linkrepro: take a filename, not a directory.

This reverts commit r371729 because /linkrepro option also exists
in Microsoft link.exe and their linker takes not a filename but a
directory name as an argument for /linkrepro.

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

llvm-svn: 373703

5 years ago[compiler-rt] Remove O1 tests from signal_line.cpp
Vitaly Buka [Fri, 4 Oct 2019 07:25:53 +0000 (07:25 +0000)]
[compiler-rt] Remove O1 tests from signal_line.cpp

It does not work on arm

llvm-svn: 373702

5 years agoRevert "[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp...
Martin Storsjo [Fri, 4 Oct 2019 07:22:37 +0000 (07:22 +0000)]
Revert "[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC."

This reverts SVN r373698, as it broke sanitizer tests, e.g. in
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/52441.

llvm-svn: 373701

5 years ago[test] Remove locale dependency for mri-utf8.test
Thomas Preud'homme [Fri, 4 Oct 2019 07:13:46 +0000 (07:13 +0000)]
[test] Remove locale dependency for mri-utf8.test

Summary:
llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be
installed for its last RUN line to work. If not installed, the unicode
string gets encoded (interpreted) as ascii which fails since the most
significant byte is non zero. This commit changes the call to open to
use a binary literal of the UTF-8 encoding for the pound sign instead,
thus bypassing the encoding step.

Note that the echo to create the <pound sign>.txt file will work
regardless of the locale because both the shell and the echo (in case
it's not a builtin of the shell concerned) only care about ascii
character to operate. Indeed, the mri-utf8.test file (and in particular
the pound sign) is encoded in UTF-8 and UTF-8 guarantees only ascii
characters can create bytes that can be interpreted as ascii characters
(i.e. bytes with the most significant bit null).

So the process to break down the filename in the line goes something
along:
- find an ascii chevron '>'
- find beginning of the filename by removing ascii space-like characters
- find ascii newline character indicating the end of the redirection (no
  semicolon ';', closing curly bracket '}' or parenthesis ')' or the
  like
- create a file whose name is made of all the bytes in between beginning
  and end of filename *without interpretting them*

Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373700

5 years ago[AMDGPU][SILoadStoreOptimizer] NFC: Refactor code
Piotr Sobczak [Fri, 4 Oct 2019 07:09:40 +0000 (07:09 +0000)]
[AMDGPU][SILoadStoreOptimizer] NFC: Refactor code

Summary:
This patch fixes a potential aliasing problem in InstClassEnum,
where local values were mixed with machine opcodes.

Introducing InstSubclass will keep them separate and help extending
InstClassEnum with other instruction types (e.g. MIMG) in the future.

This patch also makes getSubRegIdxs() more concise.

Reviewers: nhaehnle, arsenm, tstellar

Reviewed By: arsenm

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

llvm-svn: 373699

5 years ago[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC.
Martin Storsjo [Fri, 4 Oct 2019 07:05:42 +0000 (07:05 +0000)]
[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC.

This allows making a couple llvm-symbolizer tests run in all
environments.

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

llvm-svn: 373698

5 years ago[test] Remove a needless declaration of REQUIRES: target-windows
Martin Storsjo [Fri, 4 Oct 2019 07:05:29 +0000 (07:05 +0000)]
[test] Remove a needless declaration of REQUIRES: target-windows

This test only relies on running on a case insensitive file system,
the exact target triple of the toolchain shouldn't matter.

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

llvm-svn: 373697

5 years ago[JITLink] Remove a redundant semicolon, silencing -Wpedantic warnings with GCC. NFC.
Martin Storsjo [Fri, 4 Oct 2019 07:05:22 +0000 (07:05 +0000)]
[JITLink] Remove a redundant semicolon, silencing -Wpedantic warnings with GCC. NFC.

llvm-svn: 373696

5 years ago[clang] [cmake] Add distribution install targets for remaining components
Michal Gorny [Fri, 4 Oct 2019 05:43:20 +0000 (05:43 +0000)]
[clang] [cmake] Add distribution install targets for remaining components

Add install targets as necessary to install bash-autocomplete,
scan-build and scan-view via LLVM_DISTRIBUTION_TARGETS.

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

llvm-svn: 373695

5 years ago[clang-tools-extra] [cmake] Use add_clang_tool() to install tools
Michal Gorny [Fri, 4 Oct 2019 05:40:29 +0000 (05:40 +0000)]
[clang-tools-extra] [cmake] Use add_clang_tool() to install tools

Replace add_clang_executable() calls with add_clang_tool() that takes
care of creating correct, distribution-friendly install target.  While
at it, remove redundant install calls.

This change also causes clang-move and pp-trace to be installed.

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

llvm-svn: 373694

5 years ago[JITLink] Explicitly destroy bumpptr-allocated blocks to avoid a memory leak.
Lang Hames [Fri, 4 Oct 2019 05:24:40 +0000 (05:24 +0000)]
[JITLink] Explicitly destroy bumpptr-allocated blocks to avoid a memory leak.

llvm-svn: 373693

5 years ago[JITLink] Fix an unused variable warning.
Lang Hames [Fri, 4 Oct 2019 05:24:39 +0000 (05:24 +0000)]
[JITLink] Fix an unused variable warning.

llvm-svn: 373692

5 years agoMake libc++ gdb pretty printer Python 3 compatible
Fangrui Song [Fri, 4 Oct 2019 04:47:33 +0000 (04:47 +0000)]
Make libc++ gdb pretty printer Python 3 compatible

llvm-svn: 373691

5 years agogn build: Merge r373689
GN Sync Bot [Fri, 4 Oct 2019 04:00:11 +0000 (04:00 +0000)]
gn build: Merge r373689

llvm-svn: 373690

5 years ago[JITLink] Switch from an atom-based model to a "blocks and symbols" model.
Lang Hames [Fri, 4 Oct 2019 03:55:26 +0000 (03:55 +0000)]
[JITLink] Switch from an atom-based model to a "blocks and symbols" model.

In the Atom model the symbols, content and relocations of a relocatable object
file are represented as a graph of atoms, where each Atom represents a
contiguous block of content with a single name (or no name at all if the
content is anonymous), and where edges between Atoms represent relocations.
If more than one symbol is associated with a contiguous block of content then
the content is broken into multiple atoms and layout constraints (represented by
edges) are introduced to ensure that the content remains effectively contiguous.
These layout constraints must be kept in mind when examining the content
associated with a symbol (it may be spread over multiple atoms) or when applying
certain relocation types (e.g. MachO subtractors).

This patch replaces the Atom model in JITLink with a blocks-and-symbols model.
The blocks-and-symbols model represents relocatable object files as bipartite
graphs, with one set of nodes representing contiguous content (Blocks) and
another representing named or anonymous locations (Symbols) within a Block.
Relocations are represented as edges from Blocks to Symbols. This scheme
removes layout constraints (simplifying handling of MachO alt-entry symbols,
and hopefully ELF sections at some point in the future) and simplifies some
relocation logic.

llvm-svn: 373689

5 years ago[RISCV] Split SP adjustment to reduce the offset of callee saved register spill and...
Shiva Chen [Fri, 4 Oct 2019 02:00:57 +0000 (02:00 +0000)]
[RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore

We would like to split the SP adjustment to reduce the instructions in
prologue and epilogue as the following case. In this way, the offset of
the callee saved register could fit in a single store.

    add     sp,sp,-2032
    sw      ra,2028(sp)
    sw      s0,2024(sp)
    sw      s1,2020(sp)
    sw      s3,2012(sp)
    sw      s4,2008(sp)
    add     sp,sp,-64

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

llvm-svn: 373688

5 years agoRevert "Explicitly set entry point arch when it's thumb"
Antonio Afonso [Fri, 4 Oct 2019 01:45:58 +0000 (01:45 +0000)]
Revert "Explicitly set entry point arch when it's thumb"

Backing out because SymbolFile/Breakpad/symtab.test is failing and it seems to be a legit issue. Will investigate.

This reverts commit 72153f95ee4c1b52d2f4f483f0ea4f650ec863be.

llvm-svn: 373687

5 years ago[Python] Remove unused variable
Jonas Devlieghere [Fri, 4 Oct 2019 01:38:57 +0000 (01:38 +0000)]
[Python] Remove unused variable

warning: unused variable 'py_func_obj' [-Wunused-variable]
  PyObject *py_func_obj = m_py_obj;
llvm-svn: 373686

5 years agoProperly handle instantiation-dependent array bounds.
Richard Smith [Fri, 4 Oct 2019 01:25:59 +0000 (01:25 +0000)]
Properly handle instantiation-dependent array bounds.

We previously failed to treat an array with an instantiation-dependent
but not value-dependent bound as being an instantiation-dependent type.
We now track the array bound expression as part of a constant array type
if it's an instantiation-dependent expression.

llvm-svn: 373685

5 years ago[compiler-rt] Fix signal_line.cpp test
Vitaly Buka [Fri, 4 Oct 2019 00:43:05 +0000 (00:43 +0000)]
[compiler-rt] Fix signal_line.cpp test

r373682 committed wrong experimental version

llvm-svn: 373684

5 years ago[dsymutil] Fix stack-use-after-scope
Jonas Devlieghere [Fri, 4 Oct 2019 00:39:48 +0000 (00:39 +0000)]
[dsymutil] Fix stack-use-after-scope

The lambda is taking the stack-allocated Verify boolean by reference and
it would go out of scope on the next iteration. Moving it out of the
loop should fix the issue.

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

llvm-svn: 373683

5 years ago[compiler-rt] Remove O2, O3 from signal_line test for fix android tests
Vitaly Buka [Fri, 4 Oct 2019 00:38:08 +0000 (00:38 +0000)]
[compiler-rt] Remove O2, O3 from signal_line test for fix android tests

llvm-svn: 373682

5 years agocompiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM
Vitaly Buka [Fri, 4 Oct 2019 00:38:07 +0000 (00:38 +0000)]
compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM

Summary: Fixes https://github.com/google/oss-fuzz/issues/2836

Reviewers: eugenis

Subscribers: dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373681

5 years agoExplicitly set entry point arch when it's thumb
Antonio Afonso [Fri, 4 Oct 2019 00:11:22 +0000 (00:11 +0000)]
Explicitly set entry point arch when it's thumb

Summary:
I found a case where the main android binary (app_process32) had thumb code at its entry point but no entry in the symbol table indicating this. This made lldb set a 4 byte breakpoint at that address (we default to arm code) instead of a 2 byte one (like we should for thumb).
The big deal with this is that the expression evaluator uses the entry point as a way to know when a JITed expression has finished executing by putting a breakpoint there. Because of this, evaluating expressions on certain android devices (Google Pixel something) made the process crash.
This was fixed by checking this specific situation when we parse the symbol table and add an artificial symbol for this 2 byte range and indicating that it's arm thumb.

I created 2 unit tests for this, one to check that now we know that the entry point is arm thumb, and the other to make sure we didn't change the behaviour for arm code.

I also run the following on the command line with the `app_process32` where I found the issue:
**Before:**
```
(lldb) dis -s 0x1640 -e 0x1644
app_process32[0x1640]: .long  0xf0004668                ; unknown opcode
```
**After:**
```
(lldb) dis -s 0x1640 -e 0x1644
app_process32`:
app_process32[0x1640] <+0>: mov    r0, sp
app_process32[0x1642]:      andeq  r0, r0, r0
```

Reviewers: clayborg, labath, wallace, espindola

Subscribers: srhines, emaste, arichardson, kristof.beyls, MaskRay, lldb-commits

Tags: #lldb

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

llvm-svn: 373680

5 years agoPython3 doesn't seem to allow you to tell whether an object is a class
Jim Ingham [Thu, 3 Oct 2019 23:57:34 +0000 (23:57 +0000)]
Python3 doesn't seem to allow you to tell whether an object is a class

PyClass_Check and everything it relied on seems gone from Python3.7.  So
I won't check whether it is a class first...

Also cleaned up a couple of warnings.

llvm-svn: 373679

5 years agoLowerTypeTests: Rename local functions to avoid collisions with identically named...
Peter Collingbourne [Thu, 3 Oct 2019 23:42:44 +0000 (23:42 +0000)]
LowerTypeTests: Rename local functions to avoid collisions with identically named functions in ThinLTO modules.

Without this we can encounter link errors or incorrect behaviour
at runtime as a result of the wrong function being referenced.

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

llvm-svn: 373678

5 years agoForgot to change the header guards on OptionGroupPythonClassWithDict.
Jim Ingham [Thu, 3 Oct 2019 23:32:42 +0000 (23:32 +0000)]
Forgot to change the header guards on OptionGroupPythonClassWithDict.

I think that's what is confusing the modules build on the bots.

llvm-svn: 373677

5 years ago[llvm-objdump][test] Move test to X86 dir to avoid errors disassembling on non-x86
Jordan Rupprecht [Thu, 3 Oct 2019 23:08:22 +0000 (23:08 +0000)]
[llvm-objdump][test] Move test to X86 dir to avoid errors disassembling on non-x86

llvm-svn: 373676

5 years agoPass an SBStructuredData to scripted ThreadPlans on use.
Jim Ingham [Thu, 3 Oct 2019 22:50:18 +0000 (22:50 +0000)]
Pass an SBStructuredData to scripted ThreadPlans on use.

This will allow us to write reusable scripted ThreadPlans, since
you can use key/value pairs with known keys in the plan to parametrize
its behavior.

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

llvm-svn: 373675

5 years ago[MemorySSA] Don't hoist stores if interfering uses (as calls) exist.
Alina Sbirlea [Thu, 3 Oct 2019 22:20:04 +0000 (22:20 +0000)]
[MemorySSA] Don't hoist stores if interfering uses (as calls) exist.

llvm-svn: 373674

5 years agoBreak out the Python class & key/value options into a separate OptionGroup.
Jim Ingham [Thu, 3 Oct 2019 22:18:51 +0000 (22:18 +0000)]
Break out the Python class & key/value options into a separate OptionGroup.

Use this in the scripted breakpoint command.  Added some tests for parsing
the key/value options.  This uncovered a bug in handling parsing errors mid-line.
I also fixed that bug.

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

llvm-svn: 373673

5 years ago[OPENMP]Fix the test on Windows, NFC.
Alexey Bataev [Thu, 3 Oct 2019 22:10:33 +0000 (22:10 +0000)]
[OPENMP]Fix the test on Windows, NFC.

llvm-svn: 373672

5 years ago[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Jordan Rupprecht [Thu, 3 Oct 2019 22:01:08 +0000 (22:01 +0000)]
[llvm-objdump] Further rearrange llvm-objdump sections for compatability

Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.

I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly

Reviewers: jhenderson, justice_adams, grimar, ychen, espindola

Reviewed By: jhenderson

Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay

Tags: #llvm

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

llvm-svn: 373671

5 years ago[process list] make the TRIPLE column wider
Walter Erquinigo [Thu, 3 Oct 2019 21:57:01 +0000 (21:57 +0000)]
[process list] make the TRIPLE column wider

Summary:
Now that `process list` works better on the android platform, the arch aarch64-unknown-linux-android appears quite often.
The existing printed width of the TRIPLE column is not long enough, which doesn't look okay.
E.g.
```
1561   1016                    aarch64-unknown-linux-android ip6tables-restore
1999   1                       aarch64-unknown-linux-android tlc_server
2332   982                                              com.android.systemui
2378   983                                              webview_zygote
```

Now, after adding 6 spaces, it looks better

```
PID    PARENT USER       TRIPLE                         NAME
====== ====== ========== ============================== ============================
...
1561   1016              aarch64-unknown-linux-android  ip6tables-restore
1999   1                 aarch64-unknown-linux-android  tlc_server
2332   982                                              com.android.systemui
2378   983                                              webview_zygote
2448   982                                              com.sec.location.nsflp2
```

Reviewers: clayborg, labath, xiaobai, aadsm

Reviewed By: labath

Subscribers: srhines, kristof.beyls, lldb-commits

Tags: #lldb

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

llvm-svn: 373670

5 years ago[lldb] Remove unused variables.
Haibo Huang [Thu, 3 Oct 2019 21:56:59 +0000 (21:56 +0000)]
[lldb] Remove unused variables.

Fixes the comment in https://reviews.llvm.org/D67993

llvm-svn: 373669

5 years ago[lldb] Calculate relative path for symbol links
Haibo Huang [Thu, 3 Oct 2019 21:52:20 +0000 (21:52 +0000)]
[lldb] Calculate relative path for symbol links

Summary: This replaces the hard coded path.

Reviewers: labath, mgorny

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 373668

5 years agoASTContext - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 21:47:42 +0000 (21:47 +0000)]
ASTContext - silence static analyzer getAs<> null dereference warnings. NFCI.

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

We can also remove a number of explicit asserts and reply on the internal asserts in castAs<>

llvm-svn: 373667

5 years ago[DAGCombiner] add operation legality checks before creating shift ops (PR43542)
Sanjay Patel [Thu, 3 Oct 2019 21:34:04 +0000 (21:34 +0000)]
[DAGCombiner] add operation legality checks before creating shift ops (PR43542)

As discussed on llvm-dev and:
https://bugs.llvm.org/show_bug.cgi?id=43542
...we have transforms that assume shift operations are legal and transforms to
use them are profitable, but that may not hold for simple targets.

In this case, the MSP430 target custom lowers shifts by repeating (many)
simpler/fixed ops. That can be avoided by keeping this code as setcc/select.

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

llvm-svn: 373666

5 years agoOverloadCandidate::getNumParams - silence static analyzer getAs<FunctionProtoType...
Simon Pilgrim [Thu, 3 Oct 2019 21:27:02 +0000 (21:27 +0000)]
OverloadCandidate::getNumParams - silence static analyzer getAs<FunctionProtoType> null dereference warning. NFCI.

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

Also replaces an auto to make the type more obvious.

llvm-svn: 373665

5 years agoReland r349624: Let TableGen write output only if it changed, instead of doing so...
Nico Weber [Thu, 3 Oct 2019 21:22:28 +0000 (21:22 +0000)]
Reland r349624: Let TableGen write output only if it changed, instead of doing so in cmake

Move the write-if-changed logic behind a flag and don't pass it
with the MSVC generator. msbuild doesn't have a restat optimization,
so not doing write-if-change there doesn't have a cost, and it
should fix whatever causes PR43385.

llvm-svn: 373664

5 years agoDebugInfo: Generalize rnglist emission as a precursor to reusing it for loclist emission
David Blaikie [Thu, 3 Oct 2019 20:56:23 +0000 (20:56 +0000)]
DebugInfo: Generalize rnglist emission as a precursor to reusing it for loclist emission

llvm-svn: 373663

5 years ago[test] Disable TestCustomShell on Linux
Jonas Devlieghere [Thu, 3 Oct 2019 20:49:55 +0000 (20:49 +0000)]
[test] Disable TestCustomShell on Linux

ShellExpandArguments is unimplemented on Linux. I need to come up with
another way to test this on Linux.

llvm-svn: 373662

5 years ago[OPENMP50]Codegen support for scores in context selectors.
Alexey Bataev [Thu, 3 Oct 2019 20:49:48 +0000 (20:49 +0000)]
[OPENMP50]Codegen support for scores in context selectors.

If the context selector has associated score and several contexts
selectors matches current context, the function with the highest score
must be selected.

llvm-svn: 373661

5 years agogn build: (manually) merge 373651 better
Nico Weber [Thu, 3 Oct 2019 20:41:57 +0000 (20:41 +0000)]
gn build: (manually) merge 373651 better

The reland uses a static library, not an object library.
Doesn't really matter for the gn build, but it's probalby
nice to have the same semantics for the target type.

llvm-svn: 373660

5 years ago[Tests] Add a unordered atomic load combine test
Philip Reames [Thu, 3 Oct 2019 20:28:59 +0000 (20:28 +0000)]
[Tests] Add a unordered atomic load combine test

llvm-svn: 373659

5 years ago[Test] Fix inconsistency in alignment in test case
Philip Reames [Thu, 3 Oct 2019 20:24:18 +0000 (20:24 +0000)]
[Test] Fix inconsistency in alignment in test case

The IR was using a fixed 8 byte alignment, but the MIR portion was using native alignment.  Since the test doesn't appear to be deliberately testing overalignment, just make the IR match the MIR.

llvm-svn: 373658

5 years ago[AArch64][SVE] Move the testcase into CodeGen dir
Jinsong Ji [Thu, 3 Oct 2019 20:21:23 +0000 (20:21 +0000)]
[AArch64][SVE] Move the testcase into CodeGen dir

https://reviews.llvm.org/rL373600 added an AArch64 testcase in top dir
which should be moved to Codegen dir.

llvm-svn: 373657

5 years ago[JSON] Don't wrap json::Array in a value (NFC)
Jonas Devlieghere [Thu, 3 Oct 2019 20:10:56 +0000 (20:10 +0000)]
[JSON] Don't wrap json::Array in a value (NFC)

There's no need to wrap the just-constructed json::Array in a
json::Value, we can just return that and pass ownership to the
raw_ostream.

llvm-svn: 373656

5 years ago[AArch64InstPrinter] prefer bfi to bfc for < armv8.2-a
Nick Desaulniers [Thu, 3 Oct 2019 20:10:02 +0000 (20:10 +0000)]
[AArch64InstPrinter] prefer bfi to bfc for < armv8.2-a

Summary:
Fixes pr/42576.

Link: https://github.com/ClangBuiltLinux/linux/issues/697
Reviewers: t.p.northover

Reviewed By: t.p.northover

Subscribers: kristof.beyls, hiraditya, llvm-commits, srhines

Tags: #llvm

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

llvm-svn: 373655

5 years agoReland "gn build: (manually) merge r373551"
Nico Weber [Thu, 3 Oct 2019 20:07:03 +0000 (20:07 +0000)]
Reland "gn build: (manually) merge r373551"

373551 relanded in 373651.

llvm-svn: 373654

5 years agoAttempt to remove linker workaround on the buildbots: Attempt 2
Eric Fiselier [Thu, 3 Oct 2019 19:38:44 +0000 (19:38 +0000)]
Attempt to remove linker workaround on the buildbots: Attempt 2

The first commit removed the workaround in a old script.
This patch removes it in the file actually used by the bots.

I have no idea if this is still needed, but removing the
workaround seems like the easiest way to test.

I'll revert this change if the bots go red.

llvm-svn: 373653

5 years ago[PowerPC] Adjust the naming and operand order of fnmsub patterns
Jinsong Ji [Thu, 3 Oct 2019 19:36:42 +0000 (19:36 +0000)]
[PowerPC] Adjust the naming and operand order of fnmsub patterns

Summary:
This is follow up patch of https://reviews.llvm.org/D67595.
Adjust naming and the Commutable operands for additional patterns
to make it easier to read.

The testcase update also show that we can save some unecessary fmr as
well.

Reviewers: #powerpc, steven.zhang, hfinkel, nemanjai

Reviewed By: #powerpc, nemanjai

Subscribers: wuzish, hiraditya, kbarton, MaskRay, shchenz, llvm-commits

Tags: #llvm

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

llvm-svn: 373652

5 years ago[gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion
Daniel Sanders [Thu, 3 Oct 2019 19:13:39 +0000 (19:13 +0000)]
[gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion

Summary:
This will handle expansion of C++ fragments in the declarative combiner
including custom predicates, and escapes into C++ to aid the migration
effort.

Fixed the -DLLVM_LINK_LLVM_DYLIB=ON using DISABLE_LLVM_LINK_LLVM_DYLIB when
creating the library. Apparently it automatically links to libLLVM.dylib
and we don't want that from tablegen.

Reviewers: bogner, volkan

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

> llvm-svn: 373551

llvm-svn: 373651

5 years agoAttempt to remove linker workaround on the buildbots.
Eric Fiselier [Thu, 3 Oct 2019 19:13:35 +0000 (19:13 +0000)]
Attempt to remove linker workaround on the buildbots.

I have no idea if this is still needed, but removing the
workaround seems like the easiest way to test.

I'll revert this change if the bots go red.

llvm-svn: 373650

5 years ago[HIP] Use option -nogpulib to disable linking device lib
Yaxun Liu [Thu, 3 Oct 2019 18:59:56 +0000 (18:59 +0000)]
[HIP] Use option -nogpulib to disable linking device lib

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

llvm-svn: 373649

5 years agoCheck for qualified function types after substituting into the operand
Richard Smith [Thu, 3 Oct 2019 18:55:23 +0000 (18:55 +0000)]
Check for qualified function types after substituting into the operand
of 'typeid'.

This is a rare place where it's valid for a function type to be
substituted but not valid for a qualified function type to be
substituted, so needs a special check.

llvm-svn: 373648

5 years ago[clang-format] Add ability to wrap braces after multi-line control statements
Paul Hoad [Thu, 3 Oct 2019 18:42:31 +0000 (18:42 +0000)]
[clang-format] Add ability to wrap braces after multi-line control statements

Summary:
Change the BraceWrappingFlags' AfterControlStatement from a bool to an enum with three values:

* "Never": This is the default, and does not do any brace wrapping after control statements.
* "MultiLine": This only wraps braces after multi-line control statements (this really only happens when a ColumnLimit is specified).
* "Always": This always wraps braces after control statements.

The first and last options are backwards-compatible with "false" and "true", respectively.

The new "MultiLine" option is useful for when a wrapped control statement's indentation matches the subsequent block's indentation. It makes it easier to see at a glance where the control statement ends and where the block's code begins. For example:

```
if (
  foo
  && bar )
{
  baz();
}
```

vs.

```
if (
  foo
  && bar ) {
  baz();
}
```

Short control statements (1 line) do not wrap the brace to the next line, e.g.

```
if (foo) {
  bar();
} else {
  baz();
}
```

Reviewers: sammccall, owenpan, reuk, MyDeveloperDay, klimek

Reviewed By: MyDeveloperDay

Subscribers: MyDeveloperDay, cfe-commits

Patch By: mitchell-stellar

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

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

llvm-svn: 373647

5 years ago[NFC] Fix unused variable in release builds
Jordan Rupprecht [Thu, 3 Oct 2019 18:35:44 +0000 (18:35 +0000)]
[NFC] Fix unused variable in release builds

llvm-svn: 373646

5 years ago[X86] Add v32i8 shuffle lowering strategy to recognize two v4i64 vectors truncated...
Craig Topper [Thu, 3 Oct 2019 18:34:42 +0000 (18:34 +0000)]
[X86] Add v32i8 shuffle lowering strategy to recognize two v4i64 vectors truncated to v4i8 and concatenated into the lower 8 bytes with undef/zero upper bytes.

This patch recognizes the shuffle pattern we get from a
v8i64->v8i8 truncate when v8i64 isn't a legal type.

With VLX we can use two VTRUNCs, unpckldq, and a insert_subvector.

Diffrential Revision: https://reviews.llvm.org/D68374

llvm-svn: 373645

5 years ago[Host] Return the user's shell from GetDefaultShell
Jonas Devlieghere [Thu, 3 Oct 2019 18:29:01 +0000 (18:29 +0000)]
[Host] Return the user's shell from GetDefaultShell

LLDB handles shell expansion by running lldb-argdumper under a shell.
Currently, this is always /bin/sh on POSIX. This potentially leads to
different behavior between lldb and the user's current shell. Here's an
example of different expansions between shells:

$ /bin/bash -c 'echo -config={Options:[{key:foo_key,value:foo_value}]}'
-config={Options:[key:foo_key]} -config={Options:[value:foo_value]}

$ /bin/zsh -c 'echo -config={Options:[{key:foo_key,value:foo_value}]}'
zsh:1: no matches found: -config={Options:[key:foo_key]}

$ /bin/sh -c 'echo -config={Options:[{key:foo_key,value:foo_value}]}'
-config={Options:[key:foo_key]} -config={Options:[value:foo_value]}

$ /bin/fish -c 'echo -config={Options:[{key:foo_key,value:foo_value}]}'
-config=Options:[key:foo_key] -config=Options:[value:foo_value]

To reduce surprises, this patch returns the user's current shell. It
first looks at the SHELL environment variable. If that isn't set, it'll
ask for the user's default shell. Only if that fails, we'll fallback to
/bin/sh, which should always be available.

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

llvm-svn: 373644

5 years agoPR43547: substitute into the type of a non-type template parameter if
Richard Smith [Thu, 3 Oct 2019 18:24:40 +0000 (18:24 +0000)]
PR43547: substitute into the type of a non-type template parameter if
it's instantiation-dependent, even if it's not dependent.

There might be a SFINAE check in the parameter type.

llvm-svn: 373643

5 years ago[compiler-rt] More optimization levels in signal_line.cpp test
Vitaly Buka [Thu, 3 Oct 2019 18:18:35 +0000 (18:18 +0000)]
[compiler-rt] More optimization levels in signal_line.cpp test

llvm-svn: 373642

5 years ago[X86] matchShuffleWithSHUFPD - use Zeroable element mask directly. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 18:13:50 +0000 (18:13 +0000)]
[X86] matchShuffleWithSHUFPD - use Zeroable element mask directly. NFCI.

We can make use of the Zeroable mask to indicate which elements we can safely set to zero instead of creating a target shuffle mask on the fly.

This only leaves one user of createTargetShuffleMask which we can hopefully get rid of in a similar manner.

This is part of the work to fix PR43024 and allow us to use SimplifyDemandedElts to simplify shuffle chains - we need to get to a point where the target shuffle masks isn't adjusted by its source inputs in setTargetShuffleZeroElements but instead we cache them in a parallel Zeroable mask.

llvm-svn: 373641

5 years ago[dsymutil] Don't overload LinkOptions.
Jonas Devlieghere [Thu, 3 Oct 2019 18:02:09 +0000 (18:02 +0000)]
[dsymutil] Don't overload LinkOptions.

This should fix the build bots:

  error: declaration of ‘llvm::dsymutil::LinkOptions
  DsymutilOptions::LinkOptions’ [-fpermissive]

llvm-svn: 373640

5 years agoAMDGPU/GlobalISel: Handle RegBankSelect of G_INSERT_VECTOR_ELT
Matt Arsenault [Thu, 3 Oct 2019 17:59:03 +0000 (17:59 +0000)]
AMDGPU/GlobalISel: Handle RegBankSelect of G_INSERT_VECTOR_ELT

llvm-svn: 373639

5 years agoAMDGPU/GlobalISel: Split 64-bit vector extracts during RegBankSelect
Matt Arsenault [Thu, 3 Oct 2019 17:55:27 +0000 (17:55 +0000)]
AMDGPU/GlobalISel: Split 64-bit vector extracts during RegBankSelect

Register indexing 64-bit elements is possible on the SALU, but not the
VALU. Handle splitting this into two 32-bit indexes. Extend waterfall
loop handling to allow moving a range of instructions.

llvm-svn: 373638

5 years agoAMDGPU/GlobalISel: Allow VGPR to index SGPR register
Matt Arsenault [Thu, 3 Oct 2019 17:50:32 +0000 (17:50 +0000)]
AMDGPU/GlobalISel: Allow VGPR to index SGPR register

We can still do a waterfall loop over the index if using a VGPR to
index an SGPR. The result will still be a VGPR, but we can avoid the
wide copy of the source register to a VGPR.

llvm-svn: 373637

5 years agoAMDGPU/GlobalISel: Add some more tests for G_INSERT legalization
Matt Arsenault [Thu, 3 Oct 2019 17:50:31 +0000 (17:50 +0000)]
AMDGPU/GlobalISel: Add some more tests for G_INSERT legalization

llvm-svn: 373636

5 years agoAMDGPU/GlobalISel: Fix mutationIsSane assert v8s8 and
Matt Arsenault [Thu, 3 Oct 2019 17:50:29 +0000 (17:50 +0000)]
AMDGPU/GlobalISel: Fix mutationIsSane assert v8s8 and

This would try to do FewerElements to v9s8

llvm-svn: 373635

5 years ago[HIP] Enable specifying different default gpu arch for HIP/CUDA.
Michael Liao [Thu, 3 Oct 2019 17:49:20 +0000 (17:49 +0000)]
[HIP] Enable specifying different default gpu arch for HIP/CUDA.

Reviewers: tra, yaxunl

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373634

5 years agoFix build failure with GCC on identifier reusing.
Michael Liao [Thu, 3 Oct 2019 17:47:46 +0000 (17:47 +0000)]
Fix build failure with GCC on identifier reusing.

- GCC is different from clang and other compilers on that.
  https://godbolt.org/z/CeQE1V

llvm-svn: 373633

5 years agocompiler-rt: move all __GLIBC_PREREQ into own header file
Vitaly Buka [Thu, 3 Oct 2019 17:46:07 +0000 (17:46 +0000)]
compiler-rt: move all __GLIBC_PREREQ into own header file

Reviewers: eugenis

Subscribers: dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373632

5 years ago[libc++] Add a per-target flag to include the generated config_site
Louis Dionne [Thu, 3 Oct 2019 17:20:50 +0000 (17:20 +0000)]
[libc++] Add a per-target flag to include the generated config_site

This allows propagating the include automatically to targets that
depend on one of the libc++ targets such as the benchmarks. Note
that the GoogleBenchmark build itself still needs to manually specify
the -include, since I don't know of any way to have an external project
link against one of the libc++ targets (which would propagate the -include
automatically).

llvm-svn: 373631

5 years agoAMDGPU/SILoadStoreOptimizer: Optimize scanning for mergeable instructions
Tom Stellard [Thu, 3 Oct 2019 17:11:47 +0000 (17:11 +0000)]
AMDGPU/SILoadStoreOptimizer: Optimize scanning for mergeable instructions

Summary:
This adds a pre-pass to this optimization that scans through the basic
block and generates lists of mergeable instructions with one list per unique
address.

In the optimization phase instead of scanning through the basic block for mergeable
instructions, we now iterate over the lists generated by the pre-pass.

The decision to re-optimize a block is now made per list, so if we fail to merge any
instructions with the same address, then we do not attempt to optimize them in
future passes over the block.  This will help to reduce the time this pass
spends re-optimizing instructions.

In one pathological test case, this change reduces the time spent in the
SILoadStoreOptimizer from 0.2s to 0.03s.

This restructuring will also make it possible to implement further solutions in
this pass, because we can now add less expensive checks to the pre-pass and
filter instructions out early which will avoid the need to do the expensive
scanning during the optimization pass. For example, checking for adjacent
offsets is an inexpensive test we can move to the pre-pass.

Reviewers: arsenm, pendingchaos, rampitec, nhaehnle, vpykhtin

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373630

5 years ago[ModuloSchedule] removeBranch() *before* creating the trip count condition
James Molloy [Thu, 3 Oct 2019 17:10:32 +0000 (17:10 +0000)]
[ModuloSchedule] removeBranch() *before* creating the trip count condition

The Hexagon code assumes there's no existing terminator when inserting its
trip count condition check.

This causes swp-stages5.ll to break. The generated code looks good to me,
it is likely a permutation. I have disabled the new codegen path to keep
everything green and will investigate along with the other 3-4 tests
that have different codegen.

Fixes expensive-checks build.

llvm-svn: 373629

5 years ago[libunwind] Adjust libunwind_01.pass.cpp test for ARM EHABI
John Brawn [Thu, 3 Oct 2019 17:01:04 +0000 (17:01 +0000)]
[libunwind] Adjust libunwind_01.pass.cpp test for ARM EHABI

ARM EHABI unwinding tables only store the start address of each function, so the
last function is assumed to cover the entire address space after it. The test
picks an address on the stack assuming that it's in no function, but because of
the above it's actually resolved to the last function. Fix this by using address
0 instead.

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

llvm-svn: 373628

5 years agogn build: (manually) merge r373622
Nico Weber [Thu, 3 Oct 2019 16:59:12 +0000 (16:59 +0000)]
gn build: (manually) merge r373622

llvm-svn: 373627

5 years agoDeclBase/DeclCXX/DeclTemplate - silence static analyzer getAs<> null dereference...
Simon Pilgrim [Thu, 3 Oct 2019 16:58:01 +0000 (16:58 +0000)]
DeclBase/DeclCXX/DeclTemplate - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 373626

5 years ago[libc++] Add missing revision number in ABI changelog
Louis Dionne [Thu, 3 Oct 2019 16:50:05 +0000 (16:50 +0000)]
[libc++] Add missing revision number in ABI changelog

llvm-svn: 373625

5 years ago[OPENMP]Fix emission of the declare target variables in device mode.
Alexey Bataev [Thu, 3 Oct 2019 16:46:49 +0000 (16:46 +0000)]
[OPENMP]Fix emission of the declare target variables in device mode.

Declare target variables must be emitted in device mode, target triples
can be empty in this case.

llvm-svn: 373624

5 years ago[dsymutil] Improve consistency by removing redundant namespaces (NFC)
Jonas Devlieghere [Thu, 3 Oct 2019 16:34:44 +0000 (16:34 +0000)]
[dsymutil] Improve consistency by removing redundant namespaces (NFC)

The dsymutil implementation file has a using-directive for the llvm
namespace. This patch just removes redundant namespace qualifiers.

llvm-svn: 373623

5 years ago[dsymutil] Tablegenify option parsing
Jonas Devlieghere [Thu, 3 Oct 2019 16:34:41 +0000 (16:34 +0000)]
[dsymutil] Tablegenify option parsing

This patch reimplements command line option parsing in dsymutil with
Tablegen and libOption. The main motivation for this change is to
prevent clashes with other cl::opt options defined in llvm. Although
it's a bit more heavyweight, it has some nice advantages such as no
global static initializers and better separation between the code and
the option definitions.

I also used this opportunity to improve how dsymutil deals with
incompatible options. Instead of having checks spread across the code,
everything is now grouped together in verifyOptions. The fact that the
options are no longer global means that we need to pass them around a
bit more, but I think it's worth the trade-off.

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

llvm-svn: 373622

5 years ago[BPF] Handle offset reloc endpoint ending in the middle of chain properly
Yonghong Song [Thu, 3 Oct 2019 16:30:29 +0000 (16:30 +0000)]
[BPF] Handle offset reloc endpoint ending in the middle of chain properly

During studying support for bitfield, I found an issue for
an example like the one in test offset-reloc-middle-chain.ll.
  struct t1 { int c; };
  struct s1 { struct t1 b; };
  struct r1 { struct s1 a; };
  #define _(x) __builtin_preserve_access_index(x)
  void test1(void *p1, void *p2, void *p3);
  void test(struct r1 *arg) {
    struct s1 *ps = _(&arg->a);
    struct t1 *pt = _(&arg->a.b);
    int *pi = _(&arg->a.b.c);
    test1(ps, pt, pi);
  }

The IR looks like:
  %0 = llvm.preserve.struct.access(base, ...)
  %1 = llvm.preserve.struct.access(%0, ...)
  %2 = llvm.preserve.struct.access(%1, ...)
  using %0, %1 and %2

In this case, we need to generate three relocatiions
corresponding to chains: (%0), (%0, %1) and (%0, %1, %2).
After collecting all the chains, the current implementation
process each chain (in a map) with code generation sequentially.
For example, after (%0) is processed, the code may look like:
  %0 = base + special_global_variable
  // llvm.preserve.struct.access(base, ...) is delisted
  // from the instruction stream.
  %1 = llvm.preserve.struct.access(%0, ...)
  %2 = llvm.preserve.struct.access(%1, ...)
  using %0, %1 and %2

When processing chain (%0, %1), the current implementation
tries to visit intrinsic llvm.preserve.struct.access(base, ...)
to get some of its properties and this caused segfault.

This patch fixed the issue by remembering all necessary
information (kind, metadata, access_index, base) during
analysis phase, so in code generation phase there is
no need to examine the intrinsic call instructions.
This also simplifies the code.

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

llvm-svn: 373621

5 years ago[OPENMP]Improve diagnostics for not found declare target entries.
Alexey Bataev [Thu, 3 Oct 2019 16:20:34 +0000 (16:20 +0000)]
[OPENMP]Improve diagnostics for not found declare target entries.

We can point to the target region + emit parent functions names/real var
names if they were not found in host module during device codegen.

llvm-svn: 373620

5 years agoRevert "[Alignment][NFC] Allow constexpr Align"
Guillaume Chatelet [Thu, 3 Oct 2019 15:53:50 +0000 (15:53 +0000)]
Revert "[Alignment][NFC] Allow constexpr Align"

This reverts commit b3af236fb5fc6e50fcc1b54d868f0bff557f3fb1.

llvm-svn: 373619

5 years ago[RISCV] Add obsolete aliases of fscsr, frcsr (fssr, frsr)
Edward Jones [Thu, 3 Oct 2019 15:47:28 +0000 (15:47 +0000)]
[RISCV] Add obsolete aliases of fscsr, frcsr (fssr, frsr)

These old aliases were renamed, but are still used by some projects (eg newlib).

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

llvm-svn: 373618

5 years ago[NFC] Added missing changes for rL373614
David Bolvansky [Thu, 3 Oct 2019 15:26:26 +0000 (15:26 +0000)]
[NFC] Added missing changes for rL373614

llvm-svn: 373616

5 years ago[Diagnostics] Bitwise negation of a boolean expr always evaluates to true; warn with...
David Bolvansky [Thu, 3 Oct 2019 15:17:59 +0000 (15:17 +0000)]
[Diagnostics] Bitwise negation of a boolean expr always evaluates to true; warn with -Wbool-operation

Requested here:
http://lists.llvm.org/pipermail/cfe-dev/2019-October/063452.html

llvm-svn: 373614

5 years agoFix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 15:10:47 +0000 (15:10 +0000)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.

llvm-svn: 373613

5 years agoExprConstant - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 15:08:30 +0000 (15:08 +0000)]
ExprConstant - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 373612

5 years agoRemove duplicate P->getAs<PointerType>() call. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 15:08:20 +0000 (15:08 +0000)]
Remove duplicate P->getAs<PointerType>() call. NFCI.

llvm-svn: 373611

5 years ago[yaml2obj] - Add a Size tag support for SHT_LLVM_ADDRSIG sections.
George Rimar [Thu, 3 Oct 2019 15:02:18 +0000 (15:02 +0000)]
[yaml2obj] - Add a Size tag support for SHT_LLVM_ADDRSIG sections.

It allows using "Size" with or without "Content" in YAML descriptions of
SHT_LLVM_ADDRSIG sections.

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

llvm-svn: 373610

5 years agoTest commit.
Sumanth Gundapaneni [Thu, 3 Oct 2019 14:57:49 +0000 (14:57 +0000)]
Test commit.

llvm-svn: 373609

5 years ago[MSP430] add tests for unwanted shift codegen; NFC (PR43542)
Sanjay Patel [Thu, 3 Oct 2019 14:54:03 +0000 (14:54 +0000)]
[MSP430] add tests for unwanted shift codegen; NFC (PR43542)

llvm-svn: 373607