platform/upstream/llvm.git
6 years ago[SystemZ] NFC refactoring in SystemZHazardRecognizer.
Jonas Paulsson [Wed, 7 Mar 2018 08:45:09 +0000 (08:45 +0000)]
[SystemZ] NFC refactoring in SystemZHazardRecognizer.

Handle the not-taken branch in emitInstruction() where the TakenBranch
argument is available. This is cleaner than relying on EmitInstruction().

Review: Ulrich Weigand
llvm-svn: 326879

6 years ago[SystemZ] Improved debug dumping during post-RA scheduling.
Jonas Paulsson [Wed, 7 Mar 2018 08:39:00 +0000 (08:39 +0000)]
[SystemZ]  Improved debug dumping during post-RA scheduling.

Review: Ulrich Weigand
llvm-svn: 326878

6 years ago[X86] Add IMUL scheduling info on sandybridge, fix it on >=haswell.
Clement Courbet [Wed, 7 Mar 2018 08:14:02 +0000 (08:14 +0000)]
[X86] Add IMUL scheduling info on sandybridge, fix it on >=haswell.

Summary:
Only IMUL16rri uses an extra P0156. IMUL32* and IMUL16rr only use
P1.
This was computed using https://github.com/google/EXEgesis/blob/master/exegesis/tools/compute_itineraries.cc

This can easily be validated by running perf on the following code:

```
int main(int argc, char**argv) {
  int a = argc;
  int b = argc;
  int c = argc;
  int d = argc;

  for (int i = 0; i < LOOP_ITERATIONS; ++i) {
    asm volatile(
      R"(
        .rept 10000
        imull $0x2, %%edx, %%eax
        imull $0x2, %%ecx, %%ebx
        imull $0x2, %%eax, %%edx
        imull $0x2, %%ebx, %%ecx
        .endr
      )"
      : "+a"(a), "+b"(b), "+c"(c), "+d"(d)
      :
      :);
  }
  return a+b+c+d;
}
```
-> test.cc

perf stat -x, -e cycles --pfm-events=uops_executed_port:port_0:u,uops_executed_port:port_1:u,uops_executed_port:port_2:u,uops_executed_port:port_3:u,uops_executed_port:port_4:u,uops_executed_port:port_5:u,uops_executed_port:port_6:u,uops_executed_port:port_7:u test

Reviewers: craig.topper, RKSimon, gadi.haber

Subscribers: llvm-commits, gchatelet, chandlerc

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

llvm-svn: 326877

6 years agoAttempt to appease buildbots
George Burgess IV [Wed, 7 Mar 2018 07:36:23 +0000 (07:36 +0000)]
Attempt to appease buildbots

I can't reproduce this build error locally, but it appears
straightforward enough to fix. r326851 renamed two of the params of this
interceptor, but apparently to update their use here.

Failure:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/4569

llvm-svn: 326876

6 years ago[SymbolFilePDB] Add missing Char16 and Char32 types in a few places
Aaron Smith [Wed, 7 Mar 2018 05:43:05 +0000 (05:43 +0000)]
[SymbolFilePDB] Add missing Char16 and Char32 types in a few places

Reviewers: zturner, rnk, lldb-commits

Subscribers: clayborg, llvm-commits

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

llvm-svn: 326875

6 years agoDisable tests from r326852 on Darwin
Adam Nemet [Wed, 7 Mar 2018 05:33:37 +0000 (05:33 +0000)]
Disable tests from r326852 on Darwin

Darwin needs xlocale.h but I see no precedence in the code how non-Posix
headers like this are handled and I am not experienced with this code.  Just
disable the tests for now to recover the bots.

rdar://38208146

llvm-svn: 326874

6 years agoRemove a placeholder
George Burgess IV [Wed, 7 Mar 2018 05:02:27 +0000 (05:02 +0000)]
Remove a placeholder

...Running tests in the wrong directory will often make them seem to
pass. Oops. :)

llvm-svn: 326873

6 years agoReland r326766 (with a slightly modified test)
George Burgess IV [Wed, 7 Mar 2018 04:52:34 +0000 (04:52 +0000)]
Reland r326766 (with a slightly modified test)

The original revert was done in r326869, since reverting r326602 broke
the test added by this.

The new test should be less dependent on r326602.

llvm-svn: 326872

6 years ago[demangler] Fix a mistake in r326797.
Erik Pilkington [Wed, 7 Mar 2018 04:29:33 +0000 (04:29 +0000)]
[demangler] Fix a mistake in r326797.

Thanks to Nico Weber for pointing this out!

llvm-svn: 326871

6 years ago[SymbolFilePDB] Minor cleanup
Aaron Smith [Wed, 7 Mar 2018 03:16:50 +0000 (03:16 +0000)]
[SymbolFilePDB] Minor cleanup

Summary:
 - Remove unused code

- Adding `break` statement conditionally

- Ignore empty strings in FindTypeByName

Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 326870

6 years agoRevert 326766 too, after r326862 the test fails and I don't know how to fix.
Nico Weber [Wed, 7 Mar 2018 03:00:25 +0000 (03:00 +0000)]
Revert 326766 too, after r326862 the test fails and I don't know how to fix.

llvm-svn: 326869

6 years ago[analyzer] Fix the checker for the performance anti-pattern to accept messages
George Karpenkov [Wed, 7 Mar 2018 02:54:01 +0000 (02:54 +0000)]
[analyzer] Fix the checker for the performance anti-pattern to accept messages

send to ObjC objects.

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

llvm-svn: 326868

6 years ago[Driver] Enable SafeStack by default on Fuchsia
Petr Hosek [Wed, 7 Mar 2018 02:49:58 +0000 (02:49 +0000)]
[Driver] Enable SafeStack by default on Fuchsia

This is already used throughout the entire system, so make it a default.

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

llvm-svn: 326867

6 years ago[XRay][compiler-rt] Add APIs for processing logs in memory
Dean Michael Berris [Wed, 7 Mar 2018 02:45:14 +0000 (02:45 +0000)]
[XRay][compiler-rt] Add APIs for processing logs in memory

Summary:
This change adds APIs to allow logging implementations to provide a
function for iterating through in-memory buffers (if they hold in-memory
buffers) and a way for users to generically deal with these buffers
in-process. These APIs are:

  - __xray_log_set_buffer_iterator(...) and
    __xray_log_remove_buffer_iterator(): installs and removes an
    iterator function that takes an XRayBuffer and yields the next one.

  - __xray_log_process_buffers(...): takes a function pointer that can
    take a mode identifier (string) and an XRayBuffer to process this
    data as they see fit.

The intent is to have the FDR mode implementation's buffers be
available through this `__xray_log_process_buffers(...)` API, so that
they can be streamed from memory instead of flushed to disk (useful for
getting the data to a network, or doing in-process analysis).

Basic mode logging will not support this mechanism as it's designed to
write the data mostly to disk.

Future implementations will may depend on this API as well, to allow for
programmatically working through the XRay buffers exposed to the
users in some fashion.

Reviewers: eizan, kpw, pelikan

Subscribers: llvm-commits

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

llvm-svn: 326866

6 years ago[ASTMatcher] Extend hasAnyArgument to ObjCMessageExpr
George Karpenkov [Wed, 7 Mar 2018 02:32:44 +0000 (02:32 +0000)]
[ASTMatcher] Extend hasAnyArgument to ObjCMessageExpr

Currently hasArgument works with both ObjC messages and function calls,
but not hasAnyArgument.
This patch fixes that discrepancy, as it's often more convenient to use
hasAnyArgument.

On a more general note, it would be great to have a common superclass
for objc-call and function call, and a matcher matching that, but that's
probably a job for another commit.

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

llvm-svn: 326865

6 years agoFixup r326851: mmap64 interceptor should not be used on Darwin.
Kuba Mracek [Wed, 7 Mar 2018 02:30:55 +0000 (02:30 +0000)]
Fixup r326851: mmap64 interceptor should not be used on Darwin.

llvm-svn: 326864

6 years ago[llvm-pdbdump] Add guard for null pointers and remove unused code
Aaron Smith [Wed, 7 Mar 2018 02:23:08 +0000 (02:23 +0000)]
[llvm-pdbdump] Add guard for null pointers and remove unused code

Summary: This avoids crashing when a user tries to dump a pdb with the `-native` option.

Reviewers: zturner, llvm-commits, rnk

Reviewed By: zturner

Subscribers: mgrang

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

llvm-svn: 326863

6 years agoRevert r326602, it caused PR36620.
Nico Weber [Wed, 7 Mar 2018 02:22:41 +0000 (02:22 +0000)]
Revert r326602, it caused PR36620.

llvm-svn: 326862

6 years agoAdd early exit on reassociation of 0 expression.
Evgeny Stupachenko [Wed, 7 Mar 2018 02:17:08 +0000 (02:17 +0000)]
Add early exit on reassociation of 0 expression.

Summary:

Before the patch a try to reassociate ((v * 16) * 0) * 1 fall into infinite loop

Reviewers: pankajchawla

Differential Revision: http://reviews.llvm.org/D41467

From: Evgeny Stupachenko <evstupac@gmail.com>
                         <evgeny.v.stupachenko@intel.com>
llvm-svn: 326861

6 years ago[Driver] Automatically disable incompatible default sanitizers
Petr Hosek [Wed, 7 Mar 2018 01:27:03 +0000 (01:27 +0000)]
[Driver] Automatically disable incompatible default sanitizers

When a sanitizer incompatible with one of the default sanitizers
is explicitly enabled, automatically disable all the conflicting
default sanitizers.

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

llvm-svn: 326860

6 years ago[SymbolFilePDB] Add support for CVR pointer type qualifier
Aaron Smith [Wed, 7 Mar 2018 00:39:25 +0000 (00:39 +0000)]
[SymbolFilePDB] Add support for CVR pointer type qualifier

Summary:
- Complete element type of PDBSymbolTypeArray.

- Add a test to check types of multi-dimensional array and pointers with CVR.

Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 326859

6 years ago[SymbolFilePDB] Get line number for PDBSymbolTypeEnum
Aaron Smith [Wed, 7 Mar 2018 00:35:27 +0000 (00:35 +0000)]
[SymbolFilePDB] Get line number for PDBSymbolTypeEnum

Reviewers: zturner, lldb-commits, rnk

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 326858

6 years ago[DebugInfoPDB] Add DIA implementation for getSrcLineOnTypeDefn
Aaron Smith [Wed, 7 Mar 2018 00:33:09 +0000 (00:33 +0000)]
[DebugInfoPDB] Add DIA implementation for getSrcLineOnTypeDefn

Summary: This helps to determine the line number for a PDB type with definition

Reviewers: zturner, llvm-commits, rnk

Reviewed By: zturner

Subscribers: rengolin, JDevlieghere

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

llvm-svn: 326857

6 years ago[StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings...
Eugene Zelenko [Wed, 7 Mar 2018 00:17:48 +0000 (00:17 +0000)]
[StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 326856

6 years ago[sanitizer] Update symbolizer test
Vitaly Buka [Wed, 7 Mar 2018 00:15:10 +0000 (00:15 +0000)]
[sanitizer] Update symbolizer test

llvm-svn: 326855

6 years ago[sanitizer] Extract common code into STRXFRM_INTERCEPTOR_IMPL
Vitaly Buka [Wed, 7 Mar 2018 00:14:52 +0000 (00:14 +0000)]
[sanitizer] Extract common code into STRXFRM_INTERCEPTOR_IMPL

llvm-svn: 326854

6 years ago[sanitizer] Move strxfrm interceptors into sanitizer_common
Vitaly Buka [Wed, 7 Mar 2018 00:14:30 +0000 (00:14 +0000)]
[sanitizer] Move strxfrm interceptors into sanitizer_common

llvm-svn: 326853

6 years ago[sanitizer] Add interceptors for wcsxfrm, wcsxfrm_l
Vitaly Buka [Wed, 7 Mar 2018 00:14:12 +0000 (00:14 +0000)]
[sanitizer] Add interceptors for wcsxfrm, wcsxfrm_l

Patch by Oliver Chang

Reviewers: vitalybuka

Reviewed By: vitalybuka

Subscribers: llvm-commits

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

llvm-svn: 326852

6 years ago[sanitizer] Move mmap interceptors into sanitizer_common
Vitaly Buka [Wed, 7 Mar 2018 00:13:54 +0000 (00:13 +0000)]
[sanitizer] Move mmap interceptors into sanitizer_common

Reviewers: devnexen, krytarowski, eugenis

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 326851

6 years agoSplit long lines in a test file.
Rui Ueyama [Wed, 7 Mar 2018 00:07:26 +0000 (00:07 +0000)]
Split long lines in a test file.

llvm-svn: 326850

6 years agothe thread id is easier to read in base16.
Jason Molenda [Tue, 6 Mar 2018 23:33:02 +0000 (23:33 +0000)]
the thread id is easier to read in base16.

llvm-svn: 326849

6 years agoAdd test for lldb-mi interpreter
Adrian Prantl [Tue, 6 Mar 2018 23:25:04 +0000 (23:25 +0000)]
Add test for lldb-mi interpreter

Test that "lldb-mi --interpreter" can interpret "target list" CLI command.

Patch by Alex Polyakov!

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

llvm-svn: 326847

6 years agoFix a typo from r326844; NFC
George Burgess IV [Tue, 6 Mar 2018 23:09:01 +0000 (23:09 +0000)]
Fix a typo from r326844; NFC

llvm-svn: 326845

6 years ago[CodeGen] Don't emit lifetime.end without lifetime.start
George Burgess IV [Tue, 6 Mar 2018 23:07:00 +0000 (23:07 +0000)]
[CodeGen] Don't emit lifetime.end without lifetime.start

EmitLifetimeStart returns a non-null `size` pointer if it actually
emits a lifetime.start. Later in this function, we use `tempSize`'s
nullness to determine whether or not we should emit a lifetime.end.

llvm-svn: 326844

6 years ago[Transforms] Add missing header for InstructionCombining.cpp, in order to export...
Eugene Zelenko [Tue, 6 Mar 2018 23:06:13 +0000 (23:06 +0000)]
[Transforms] Add missing header for InstructionCombining.cpp, in order to export LLVMInitializeInstCombine as extern "C". Fixes PR35947.

Patch by Brenton Bostick.

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

llvm-svn: 326843

6 years ago[XRay][compiler-rt] Make unit tests depend on implementation files
Dean Michael Berris [Tue, 6 Mar 2018 23:06:09 +0000 (23:06 +0000)]
[XRay][compiler-rt] Make unit tests depend on implementation files

Summary:
This change makes changes to XRay implementation files trigger re-builds
of the unit tests. Prior to this change, the unit tests were not built
and run properly if the implementation files were changed during the
development process. This change forces the dependency on all files in
the XRay include and lib hosted files in compiler-rt.

Caveat is, that new files added to the director(ies) will need a re-run
of CMake to re-generate the fileset.

We think this is an OK compromise, since adding new files may
necessitate editing (or adding) new unit tests. It's also less likely
that we're adding new files without updating the CMake configuration to
include the functionality in the XRay runtime implementation anyway.

Reviewers: pelikan, kpw, nglevin

Subscribers: mgorny, llvm-commits

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

llvm-svn: 326842

6 years agoDo not create temporary strings just to print out spaces. NFC.
Rui Ueyama [Tue, 6 Mar 2018 22:48:46 +0000 (22:48 +0000)]
Do not create temporary strings just to print out spaces. NFC.

llvm-svn: 326841

6 years ago[X86] Fix a typo in Host.cpp that causes us to misidentify KNL, Silvermont, Goldmont...
Craig Topper [Tue, 6 Mar 2018 22:45:31 +0000 (22:45 +0000)]
[X86] Fix a typo in Host.cpp that causes us to misidentify KNL, Silvermont, Goldmont and probably other CPUs for -march=native

I think most of the Intel Core CPUs and recent AMD CPUs are unaffected. All the CPUs that have a "subtype" should work. The ones that were broken are the ones that are a "type" with no subtypes.

Fixes PR36619.

llvm-svn: 326840

6 years agoReapply "[DWARFv5] Emit file 0 to the line table."
Paul Robinson [Tue, 6 Mar 2018 22:37:45 +0000 (22:37 +0000)]
Reapply "[DWARFv5] Emit file 0 to the line table."

Fixes the bug found by asan. Also XFAIL the new test for Darwin,
which is stuck on DWARF v2, and fix up other tests so they stop
failing on Windows.

llvm-svn: 326839

6 years ago[TargetLowering] Add vector BITCAST support to SimplifyDemandedVectorElts
Simon Pilgrim [Tue, 6 Mar 2018 22:32:01 +0000 (22:32 +0000)]
[TargetLowering] Add vector BITCAST support to SimplifyDemandedVectorElts

Notably helps cleanup after legalization of vector types

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

llvm-svn: 326838

6 years agoDA: remove uses of GEP, only ask SCEV
Sebastian Pop [Tue, 6 Mar 2018 21:55:59 +0000 (21:55 +0000)]
DA: remove uses of GEP, only ask SCEV

It's been quite some time the Dependence Analysis (DA) is broken,
as it uses the GEP representation to "identify" multi-dimensional arrays.
It even wrongly detects multi-dimensional arrays in single nested loops:

from test/Analysis/DependenceAnalysis/Coupled.ll, example @couple6
;; for (long int i = 0; i < 50; i++) {
;; A[i][3*i - 6] = i;
;; *B++ = A[i][i];

DA used to detect two subscripts, which makes no sense in the LLVM IR
or in C/C++ semantics, as there are no guarantees as in Fortran of
subscripts not overlapping into a next array dimension:

maximum nesting levels = 1
SrcPtrSCEV = %A
DstPtrSCEV = %A
using GEPs
subscript 0
    src = {0,+,1}<nuw><nsw><%for.body>
    dst = {0,+,1}<nuw><nsw><%for.body>
    class = 1
    loops = {1}
subscript 1
    src = {-6,+,3}<nsw><%for.body>
    dst = {0,+,1}<nuw><nsw><%for.body>
    class = 1
    loops = {1}
Separable = {}
Coupled = {1}

With the current patch, DA will correctly work on only one dimension:

maximum nesting levels = 1
SrcSCEV = {(-2424 + %A)<nsw>,+,1212}<%for.body>
DstSCEV = {%A,+,404}<%for.body>
subscript 0
    src = {(-2424 + %A)<nsw>,+,1212}<%for.body>
    dst = {%A,+,404}<%for.body>
    class = 1
    loops = {1}
Separable = {0}
Coupled = {}

This change removes all uses of GEP from DA, and we now only rely
on the SCEV representation.

The patch does not turn on -da-delinearize by default, and so the DA analysis
will be more conservative in the case of multi-dimensional memory accesses in
nested loops.

I disabled some interchange tests, as the DA is not able to disambiguate
the dependence anymore. To make DA stronger, we may need to
compute a bound on the number of iterations based on the access functions
and array dimensions.

The patch cleans up all the CHECKs in test/Transforms/LoopInterchange/*.ll to
avoid checking for snippets of LLVM IR: this form of checking is very hard to
maintain. Instead, we now check for output of the pass that are more meaningful
than dozens of lines of LLVM IR. Some tests now require -debug messages and thus
only enabled with asserts.

Patch written by Sebastian Pop and Aditya Kumar.

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

llvm-svn: 326837

6 years ago[FrontEnd] Allow overriding the default C/C++ -std via CMake vars
Michal Gorny [Tue, 6 Mar 2018 21:26:28 +0000 (21:26 +0000)]
[FrontEnd] Allow overriding the default C/C++ -std via CMake vars

Provide two new CMake cache variables -- CLANG_DEFAULT_STD_C
and CLANG_DEFAULT_STD_CXX -- that can be used to override the default
C/ObjC and C++/ObjC++ standards appropriately. They can be set to one of
the identifiers from LangStandards.def, or left unset (the default) to
respect the current platform default.

This option is mostly intended for compiler vendors that may wish
to adjust the defaults their compilers are using. For example, Gentoo
planned to use it to set clang and gcc to matching standards, so that
we could maintain as much compatibility between different compilers
as possible.

The code relies on explicit identifiers rather than the string aliases
for simplicity. This saves us from the necessity of parsing aliases at
build-time or adding additional processing at runtime. For the latter
case, it also adds trivial value check -- if incorrect value is passed,
the code simply fails to compile through referencing an undefined
constant.

If the variable is used to redefine the default standard, the explicit
value overrides the special case for PS4. It is done this way mostly
following other kinds of variables where 'platform defaults' are
redefined.

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

llvm-svn: 326836

6 years agoImplement --just-symbols.
Rui Ueyama [Tue, 6 Mar 2018 21:25:37 +0000 (21:25 +0000)]
Implement --just-symbols.

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

llvm-svn: 326835

6 years agoPrintStatistics() and PrintStatisticsJSON() should take StatLock
Daniel Sanders [Tue, 6 Mar 2018 21:16:42 +0000 (21:16 +0000)]
PrintStatistics() and PrintStatisticsJSON() should take StatLock

These two functions iterate over the list of statistics but don't take the lock
that protects the iterators from being invalidated by
StatisticInfo::addStatistic().

So far, this hasn't been an issue since (in-tree at least) these functions are
called by the StatisticInfo destructor so addStatistic() shouldn't be called
anymore. However, we do expose them in the public API.

Note that this only protects against iterator invalidation and does not protect
against ordering issues caused by statistic updates that race with
PrintStatistics()/PrintStatisticsJSON().

Thanks to Roman Tereshin for spotting it

llvm-svn: 326834

6 years ago[scudo] Use gc-sections by default
Kostya Kortchinsky [Tue, 6 Mar 2018 20:13:37 +0000 (20:13 +0000)]
[scudo] Use gc-sections by default

Summary:
If not using `-Wl,--gc-sections`, a whole lot of unused `sanitizer_common` code
and related static variables are pulled into the shared library.
Keep the binary size smaller, and its memory footprint smaller as well, by
using the compiler flags `-ffunction-section` & `-fdata-sections` by default,
as well as the linker flags `-Wl,--gc-sections`.

Current experiments show a large discrepency between binary sizes generated
by gcc (big) and clang (small). I am not sure yet how I can make a test that
would encompass both, so it's an outstanding work item.

Reviewers: alekseyshl, flowerhack

Reviewed By: alekseyshl

Subscribers: mgorny, delcypher, llvm-commits, #sanitizers

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

llvm-svn: 326833

6 years ago[TargetLowering] Rename DAGCombinerInfo::isAfterLegalizeVectorOps to DAGCombiner...
Craig Topper [Tue, 6 Mar 2018 19:44:52 +0000 (19:44 +0000)]
[TargetLowering] Rename DAGCombinerInfo::isAfterLegalizeVectorOps to DAGCombiner::isAfterLegalizeDAG since that's what it checks. NFC

The code checks Level == AfterLegalizeDAG which is the fourth and last of the possible DAG combine stages that we have.

There is a Level called AfterLegalVectorOps, but that's the third DAG combine and it doesn't always run.

A function called isAfterLegalVectorOps should imply it returns true in either of the DAG combines that runs after the legalize vector ops stage, but that's not what this function does.

llvm-svn: 326832

6 years ago[SymboleFilePDB] Put the test input back that my previous commit clobbered
Aaron Smith [Tue, 6 Mar 2018 19:36:17 +0000 (19:36 +0000)]
[SymboleFilePDB] Put the test input back that my previous commit clobbered

llvm-svn: 326831

6 years ago[Hexagon] Update more testcases
Krzysztof Parzyszek [Tue, 6 Mar 2018 19:15:58 +0000 (19:15 +0000)]
[Hexagon] Update more testcases

llvm-svn: 326830

6 years ago[Hexagon] Remove {{ *}} from testcases
Krzysztof Parzyszek [Tue, 6 Mar 2018 19:07:21 +0000 (19:07 +0000)]
[Hexagon] Remove {{ *}} from testcases

The spaces in the instructions are now consistent.

llvm-svn: 326829

6 years ago[InstCombine] simplify min/max canonicalization; NFCI
Sanjay Patel [Tue, 6 Mar 2018 19:01:18 +0000 (19:01 +0000)]
[InstCombine] simplify min/max canonicalization; NFCI

llvm-svn: 326828

6 years ago[OPENMP] Fix generation of the unique names for task reduction
Alexey Bataev [Tue, 6 Mar 2018 18:59:43 +0000 (18:59 +0000)]
[OPENMP] Fix generation of the unique names for task reduction
variables.

If the task has reduction construct and this construct for some variable
requires unique threadprivate storage, we may generate different names
for variables used in taskgroup task_reduction clause and in task
  in_reduction clause. Patch fixes this problem.

llvm-svn: 326827

6 years ago[X86] Reject registers that require a REX prefix in inline asm constraints in 32...
Craig Topper [Tue, 6 Mar 2018 18:56:33 +0000 (18:56 +0000)]
[X86] Reject registers that require a REX prefix in inline asm constraints in 32-bit mode

We don't currently reject r8-r15 or xmm8-32 or bpl/spl/sil/dil in 32-bit mode.

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

llvm-svn: 326826

6 years ago[AMDGPU] Add default ISA version targets
Stanislav Mekhanoshin [Tue, 6 Mar 2018 18:33:55 +0000 (18:33 +0000)]
[AMDGPU] Add default ISA version targets

In case if -mattr used to modify feature set bits in llvm-mc call
getIsaVersion can fail to identify specific ISA due to test mismatch.
Adding default fallback tests which will always correctly report at
least major version.

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

llvm-svn: 326825

6 years ago[CodeView] Emit UdtSourceLine information for enums
Aaron Smith [Tue, 6 Mar 2018 18:20:22 +0000 (18:20 +0000)]
[CodeView] Emit UdtSourceLine information for enums

Summary:
- Emit UdtSourceLine information for enums to match MSVC

- Add a method to add UDTSrcLine and call it for all Class/Struct/Union/Enum

- Update test cases to verify the changes

Reviewers: zturner, llvm-commits, rnk

Reviewed By: rnk

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

llvm-svn: 326824

6 years ago[PatternMatch] define m_Not using m_Xor and cst_pred_ty
Sanjay Patel [Tue, 6 Mar 2018 18:19:42 +0000 (18:19 +0000)]
[PatternMatch] define m_Not using m_Xor and cst_pred_ty

Using cst_pred_ty in the definition allows us to match vectors with undef elements.

This is a continuation of an effort to make all pattern matchers allow undef elements in vectors:
rL325437
rL325466
D43792

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

llvm-svn: 326823

6 years agoTableGen: Give up on exact fixits for diagnostic groups
Nicolai Haehnle [Tue, 6 Mar 2018 17:55:00 +0000 (17:55 +0000)]
TableGen: Give up on exact fixits for diagnostic groups

With recent changes in the TableGen frontend, we no longer have usable
location information for anonymous defs.

Fixes test breakage caused by r326788.

The normal, non-error TableGen output is not affected by this change.

llvm-svn: 326822

6 years agolgamma_r: Move code from .inc to .cl file
Jan Vesely [Tue, 6 Mar 2018 17:48:47 +0000 (17:48 +0000)]
lgamma_r: Move code from .inc to .cl file

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326821

6 years agofrexp: Reuse types provided by gentype.inc
Jan Vesely [Tue, 6 Mar 2018 17:48:45 +0000 (17:48 +0000)]
frexp: Reuse types provided by gentype.inc

v2: Use select instead of bitselect to consolidate scalar and vector
versions

Passes CTS on Carrizo

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326820

6 years agoselect: Add vector implementation
Jan Vesely [Tue, 6 Mar 2018 17:48:43 +0000 (17:48 +0000)]
select: Add vector implementation

Passes CTS on Carrizo

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326819

6 years agominmag: Condition variable needs to be the same bitwidth as operands
Jan Vesely [Tue, 6 Mar 2018 17:48:40 +0000 (17:48 +0000)]
minmag: Condition variable needs to be the same bitwidth as operands

No changes wrt CTS

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326818

6 years agomaxmag: Condition variable needs to be the same bitwidth as operands
Jan Vesely [Tue, 6 Mar 2018 17:48:38 +0000 (17:48 +0000)]
maxmag: Condition variable needs to be the same bitwidth as operands

No changes wrt CTS

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326817

6 years agoMove cl_khr_fp64 exntension enablement to gentype include lists
Jan Vesely [Tue, 6 Mar 2018 17:48:35 +0000 (17:48 +0000)]
Move cl_khr_fp64 exntension enablement to gentype include lists

This will make adding cl_khr_fp16 support easier

Reviewed-by: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 326816

6 years ago[clang-format] Improve detection of ObjC for-in statements
Ben Hamilton [Tue, 6 Mar 2018 17:21:42 +0000 (17:21 +0000)]
[clang-format] Improve detection of ObjC for-in statements

Summary:
Previously, clang-format would detect the following as an
Objective-C for-in statement:

  for (int x = in.value(); ...) {}

because the logic only decided a for-loop was definitely *not*
an Objective-C for-in loop after it saw a semicolon or a colon.

To fix this, I delayed the decision of whether this was a for-in
statement until after we found the matching right-paren, at which
point we know if we've seen a semicolon or not.

Test Plan: New tests added. Ran tests with:
  make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: krasimir, jolesiak

Reviewed By: jolesiak

Subscribers: djasper, cfe-commits, klimek

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

llvm-svn: 326815

6 years agoRefactor check for dllimport in the Verifier.
Rafael Espindola [Tue, 6 Mar 2018 17:19:23 +0000 (17:19 +0000)]
Refactor check for dllimport in the Verifier.

This avoids duplicated code and now also rejects dllimport aliases.

llvm-svn: 326814

6 years agoImprove duplicated version handling.
Rafael Espindola [Tue, 6 Mar 2018 17:05:12 +0000 (17:05 +0000)]
Improve duplicated version handling.

It looks like the problem that caused us to originally warn instead of
error was that of a symbol being assigned to the same version twice.

Now we don't warn if a symbol is assigned to the same version twice,
but error if it is assigned to multiple.

This fixes pr28342.

llvm-svn: 326813

6 years ago[ValueTracking] move helpers for SelectPatterns from InstCombine to ValueTracking
Sanjay Patel [Tue, 6 Mar 2018 16:57:55 +0000 (16:57 +0000)]
[ValueTracking] move helpers for SelectPatterns from InstCombine to ValueTracking

Most of the folds based on SelectPatternResult belong in InstSimplify rather than
InstCombine, so the helper code should be available to other passes/analysis.

llvm-svn: 326812

6 years ago[AArch64] define isExtractSubvectorCheap
Sebastian Pop [Tue, 6 Mar 2018 16:54:55 +0000 (16:54 +0000)]
[AArch64] define isExtractSubvectorCheap

Following the ARM-neon backend, define isExtractSubvectorCheap to return true
when extracting low and high part of a neon register.

The patch disables a test in llvm/test/CodeGen/AArch64/arm64-ext.ll This
testcase is fragile in the sense that it requires a BUILD_VECTOR to "survive"
all DAG transforms until ISelLowering. The testcase is supposed to check that
AArch64TargetLowering::ReconstructShuffle() works, and for that we need a
BUILD_VECTOR in ISelLowering. As we now transform the BUILD_VECTOR earlier into
an VEXT + vector_shuffle, we don't have the BUILD_VECTOR pattern when we get to
ISelLowering. As there is no way to disable the combiner to only exercise the
code in ISelLowering, the patch disables the testcase.

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

llvm-svn: 326811

6 years ago[Asm] Fix another layering violation in assmebly macro dumping
Oliver Stannard [Tue, 6 Mar 2018 16:51:17 +0000 (16:51 +0000)]
[Asm] Fix another layering violation in assmebly macro dumping

AsmToken is in the MCParser library, so we can't use its dump function from
MCAsmMacro in the MC library. Instead, just print the string, which we don't
need the MCParser library for.

llvm-svn: 326810

6 years ago[clangd] Don't end completion item labels with '::'
Ilya Biryukov [Tue, 6 Mar 2018 16:45:21 +0000 (16:45 +0000)]
[clangd] Don't end completion item labels with '::'

llvm-svn: 326809

6 years ago[Pipeliner] Test commit: fixed spelling mistake in comments
Roorda, Jan-Willem [Tue, 6 Mar 2018 16:26:01 +0000 (16:26 +0000)]
[Pipeliner] Test commit: fixed spelling mistake in comments

Reviewers: bcahoon

Subscribers: llvm-commits

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

llvm-svn: 326808

6 years ago[X86] Fix typo in cpuid.h, bit_AVX51SER->bit_AVX512ER.
Craig Topper [Tue, 6 Mar 2018 16:06:44 +0000 (16:06 +0000)]
[X86] Fix typo in cpuid.h, bit_AVX51SER->bit_AVX512ER.

llvm-svn: 326807

6 years ago[AMDGPU] Fix lowering OpenCL enqueue_kernel
Yaxun Liu [Tue, 6 Mar 2018 16:04:39 +0000 (16:04 +0000)]
[AMDGPU] Fix lowering OpenCL enqueue_kernel

One addrspacecast disappeared in clang emitted IR for
block invoke function due to adoption of the new
addr space mapping.

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

llvm-svn: 326806

6 years agoRewrite TestTargetSymbolsBuildidCase to be more focused
Pavel Labath [Tue, 6 Mar 2018 15:56:20 +0000 (15:56 +0000)]
Rewrite TestTargetSymbolsBuildidCase to be more focused

Summary:
The test was failing in remote debugging scenario with windows as a host
as cmd.exe is not able to parse the complicated shell commands in the
Makefile.

The test seemed like a perfect candidate for a more focused testing
approach, so I have rewritten in on top of lldb-test's module-sections
functionality. The slight gotcha there was that the
Module::GetSectionList does not include the sections from the symbol
file until someone manually calls Module::GetSymbolVendor. Normally,
this is not an issue, because someone will have initialized the symbol
vendor by the time anyone starts looking at the sections. However, when
all one this is dump the section list, we run into this problem.

I've tried making this behavior more automatic, but it turns out it's
not that easy, so for now, I just manually initialize the Symbol Vendor
before dumping out the sections in lldb-test.

Reviewers: jankratochvil

Subscribers: lldb-commits

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

llvm-svn: 326805

6 years ago[ARM][Asm] Fix layering violation introduced by r326795
Oliver Stannard [Tue, 6 Mar 2018 15:32:34 +0000 (15:32 +0000)]
[ARM][Asm] Fix layering violation introduced by r326795

The MCAsmMacro::dump function is in the MCParser library, so can't be called
from the MC library.

llvm-svn: 326804

6 years ago[ARM]Decoding MSR with unpredictable destination register causes an assert
Simi Pallipurath [Tue, 6 Mar 2018 15:21:19 +0000 (15:21 +0000)]
[ARM]Decoding MSR with unpredictable destination register causes an assert

This patch handling:

    Enable parsing of raw encodings of system registers .
    Allows UNPREDICTABLE sysregs to be decoded to a raw number in the same way that disasslib does, rather than llvm crashing.
    Disassemble msr/mrs with unpredictable sysregs as SoftFail.
    Fix regression due to SoftFailing some encodings.

Patch by Chris Ryder

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

llvm-svn: 326803

6 years agoOne more test for P0767:
Marshall Clow [Tue, 6 Mar 2018 15:01:55 +0000 (15:01 +0000)]
One more test for P0767:

llvm-svn: 326802

6 years agoImplement P0767R1 - Deprecate POD
Marshall Clow [Tue, 6 Mar 2018 15:01:19 +0000 (15:01 +0000)]
Implement P0767R1 - Deprecate POD

llvm-svn: 326801

6 years agotest commit: fix typo in comment
Simi Pallipurath [Tue, 6 Mar 2018 14:35:23 +0000 (14:35 +0000)]
test commit: fix typo in comment

This is  a simple change to do the test commit and verify commit access.

llvm-svn: 326800

6 years ago[clang-tidy] Fix one corner case in make-unique check.
Haojian Wu [Tue, 6 Mar 2018 14:34:35 +0000 (14:34 +0000)]
[clang-tidy] Fix one corner case in make-unique check.

Summary:
Previously, we tried to cover all "std::initializer_list" implicit conversion
cases in the code, but there are some corner cases that not covered (see
newly-added test in the patch).

Sipping all implicit AST nodes is a better way to filter out all these cases.

Reviewers: ilya-biryukov

Subscribers: klimek, xazax.hun, cfe-commits

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

llvm-svn: 326799

6 years ago[clangd] Address missed comments from D44003
Sam McCall [Tue, 6 Mar 2018 14:30:07 +0000 (14:30 +0000)]
[clangd] Address missed comments from D44003

llvm-svn: 326798

6 years ago[demangler] Modernize the rest of the demangler.
Erik Pilkington [Tue, 6 Mar 2018 14:21:10 +0000 (14:21 +0000)]
[demangler] Modernize the rest of the demangler.

llvm-svn: 326797

6 years ago[demangler] Modernize parse_unresolved_name.
Erik Pilkington [Tue, 6 Mar 2018 14:21:08 +0000 (14:21 +0000)]
[demangler] Modernize parse_unresolved_name.

llvm-svn: 326796

6 years ago[Asm] Add debug printing for assembler macros
Oliver Stannard [Tue, 6 Mar 2018 14:07:01 +0000 (14:07 +0000)]
[Asm] Add debug printing for assembler macros

This adds some debug printing (gated behind the "asm-macros" debug flag) which
can help tracing complicated assembly macros.

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

llvm-svn: 326795

6 years ago[Asm] Refactor debug printing of AsmToken
Oliver Stannard [Tue, 6 Mar 2018 14:02:14 +0000 (14:02 +0000)]
[Asm] Refactor debug printing of AsmToken

* Move printing from llvm-mc to the AsmToken class, so that it can be used elsewhere.
* Add 5 cases which were missed: BigNum, Comment, HashDirective, Space and
  BackSlash, and remove the default case so that -Wswitch will catch this error
  in future.

This is almost NFC, except for the fact that llvm-mc can now print those 5
tokens in -as-lex mode.

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

llvm-svn: 326794

6 years ago[CallSiteSplitting] Do not crash when BB's terminator changes.
Florian Hahn [Tue, 6 Mar 2018 14:00:58 +0000 (14:00 +0000)]
[CallSiteSplitting] Do not crash when BB's terminator changes.

Change doCallSiteSplitting to iterate until we reach the terminator instruction.
tryToSplitCallSite can replace BB's terminator in case BB is a successor of
itself. Then IE will be invalidated and we also have to check the current
terminator.

Reviewers: junbuml, davidxl, davide, fhahn

Reviewed By: fhahn, junbuml

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

llvm-svn: 326793

6 years ago[clang-format] fix handling of consecutive unary operators
Krasimir Georgiev [Tue, 6 Mar 2018 13:56:28 +0000 (13:56 +0000)]
[clang-format] fix handling of consecutive unary operators

Summary:
Code that used to be formatted as `if (! + object) {` is now formatted as `if (!+object) {`
(we have a particular object in our codebase where unary `operator+` is overloaded to return the underlying value, which in this case is a `bool`)

We still preserve the TypeScript behavior where `!` is a trailing non-null operator. (This is already tested by an existing unit test in `FormatTestJS.cpp`)

It doesn't appear like handling of consecutive unary operators are tested in general, so I added another test for completeness

Patch contributed by @kevinl!

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 326792

6 years agoObjectFileMachO: split CreateSections mega-function into more manageable chunks
Pavel Labath [Tue, 6 Mar 2018 13:53:26 +0000 (13:53 +0000)]
ObjectFileMachO: split CreateSections mega-function into more manageable chunks

Summary:
In an effort to understand the function's operation, I've split it into logical
pieces. Parsing of a single segment is moved to a separate function (and the
parsing state that is carried from one segment to another is explicitly
captured in the SegmentParsingContext object). I've also extracted some pieces
of code which were already standalone (validation of the segment load command,
determining the section type, determining segment permissions) into
separate functions.

Parsing of a single section within the segment should probably also be a
separate function, but I've left that for a separate patch.

This patch is intended to be NFC.

Reviewers: clayborg, davide

Subscribers: lldb-commits

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

llvm-svn: 326791

6 years agoTableGen: Add !foldl operation
Nicolai Haehnle [Tue, 6 Mar 2018 13:49:16 +0000 (13:49 +0000)]
TableGen: Add !foldl operation

Change-Id: I63d67bf6e0b315e2d3360e47e3b62c9517f38987
llvm-svn: 326790

6 years agoTableGen: Remove the ResolveFirst mechanism
Nicolai Haehnle [Tue, 6 Mar 2018 13:49:06 +0000 (13:49 +0000)]
TableGen: Remove the ResolveFirst mechanism

Summary:
It is no longer used.

Change-Id: I1e47267d1975d43ad43acd6347f54e958e3b6c86

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326789

6 years agoTableGen: Delay instantiating inline anonymous records
Nicolai Haehnle [Tue, 6 Mar 2018 13:49:01 +0000 (13:49 +0000)]
TableGen: Delay instantiating inline anonymous records

Summary:
Only instantiate anonymous records once all variable references in template
arguments have been resolved. This allows patterns like the new test case,
which in practice can appear in expressions like:

  class IntrinsicTypeProfile<list<LLVMType> ty, int shift> {
    list<LLVMType> types =
      !listconcat(ty, [llvm_any_ty, LLVMMatchType<shift>]);
  }

  class FooIntrinsic<IntrinsicTypeProfile P, ...>
    : Intrinsic<..., P.types, ...>;

Without this change, the anonymous LLVMMatchType instantiation would
never get resolved.

Another consequence of this change is that anonymous inline
instantiations are uniqued via the folding set of the newly introduced
VarDefInit.

Change-Id: I7a7041a20e297cf98c9109b28d85e64e176c932a

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326788

6 years agoTableGen: Move getNewAnonymousName into RecordKeeper
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:54 +0000 (13:48 +0000)]
TableGen: Move getNewAnonymousName into RecordKeeper

Summary:
So that we will be able to generate new anonymous names more easily
outside the parser as well.

Change-Id: I28f396a7bdbc3ff0c665d466abbd3d31376e21b4

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326787

6 years agoTableGen: Explicitly check whether a record has been resolved
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:47 +0000 (13:48 +0000)]
TableGen: Explicitly check whether a record has been resolved

Summary:
There are various places where resolving and constant folds can
get stuck, especially around casts. We don't always signal an
error for those, because in many cases they can legitimately
occur without being an error in the "untaken branch" of an !if.

Change-Id: I3befc0e4234c8e6cc61190504702918c9f29ce5c

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326786

6 years agoTableGen: Allow !cast of records, cleanup conversion machinery
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:39 +0000 (13:48 +0000)]
TableGen: Allow !cast of records, cleanup conversion machinery

Summary:
Distinguish two relationships between types: is-a and convertible-to.
For example, a bit is not an int or vice versa, but they can be
converted into each other (with range checks that you can think of
as "dynamic": unlike other type checks, those range checks do not
happen during parsing, but only once the final values have been
established).

Actually converting initializers between types is subtle: even
when values of type A can be converted to type B (e.g. int into
string), it may not be possible to do so with a concrete initializer
(e.g., a VarInit that refers to a variable of type int cannot
be immediately converted to a string).

For this reason, distinguish between getCastTo and convertInitializerTo:
the latter implements the actual conversion when appropriate, while
the former will first try to do the actual conversion and fall back
to introducing a !cast operation so that the conversion will be
delayed until variable references have been resolved.

To make the approach of adding !cast operations to work, !cast needs
to fallback to convertInitializerTo when the special string <-> record
logic does not apply.

This enables casting records to a subclass, although that new
functionality is only truly useful together with !isa, which will be
added in a later change.

The test is removed because it uses !srl on a bit sequence,
which cannot really be supported consistently, but luckily
isn't used anywhere either.

Change-Id: I98168bf52649176654ed2ec61a29bdb29970cfe7

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326785

6 years agoTableGen: Simplify BitsInit::resolveReferences
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:30 +0000 (13:48 +0000)]
TableGen: Simplify BitsInit::resolveReferences

Summary:
No functional change intended. The removed code has a loop for
recursive resolving, which is superseded by the recursive
resolving done by the Resolver implementations.

Add a test case which was broken by an earlier version of this
change.

Change-Id: Ib208d037b77a8bbb725977f1388601fc984723d8

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326784

6 years agoTableGen: Generalize record types to fix typeIsConvertibleTo et al.
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:20 +0000 (13:48 +0000)]
TableGen: Generalize record types to fix typeIsConvertibleTo et al.

Summary:
Allow RecordRecTy to represent the type "subclass of N superclasses",
where N may be zero. Furthermore, generate RecordRecTy instances only
with actual classes in the list.

Keeping track of multiple superclasses is required to resolve the type
of a list correctly in some cases. The old code relied on the incorrect
behavior of typeIsConvertibleTo, and an earlier version of this change
relied on a modified ordering of superclasses (it was committed in
r325884 and then reverted because unfortunately some of clang-tblgen's
backends depend on the ordering).

Previously, the DefInit for each Record would have a RecordRecTy of
that Record as its type. Now, all defs with the same superclasses will
share the same type.

This allows us to be more consistent about type checks involving records:

- typeIsConvertibleTo actually requires the LHS to be a subtype of the
  RHS

- resolveTypes will return the least supertype of given record types in
  all cases

- different record types in the two branches of an !if are handled
  correctly

Add a test that used to be accepted without flagging the obvious type
error.

Change-Id: Ib366db1a4e6a079f1a0851e469b402cddae76714

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326783

6 years ago[analyzer] CStringChecker.cpp: Remove the duplicated check about null dereference...
Henry Wong [Tue, 6 Mar 2018 13:38:42 +0000 (13:38 +0000)]
[analyzer] CStringChecker.cpp: Remove the duplicated check about null dereference on dest-buffer or src-buffer.

Summary: `CheckBufferAccess()` calls `CheckNonNull()`, so there are some calls to `CheckNonNull()` that are useless.

Reviewers: dcoughlin, NoQ, xazax.hun, cfe-commits, george.karpenkov

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, MTC, a.sidorin

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

llvm-svn: 326782

6 years ago[clang-format] Fix documentation for SpaceAfterCStyleCast option
Krasimir Georgiev [Tue, 6 Mar 2018 13:24:01 +0000 (13:24 +0000)]
[clang-format] Fix documentation for SpaceAfterCStyleCast option

Patch contributed by @EricMarti!

Summary: I noticed that the example for SpaceAfterCStyleCast does not match its description. I fixed the example after testing it out.

Reviewers: rsmith, krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 326781

6 years agoFixup for rL326769 (RegState::Debug is being truncated to a bool)
Bjorn Pettersson [Tue, 6 Mar 2018 13:23:28 +0000 (13:23 +0000)]
Fixup for rL326769 (RegState::Debug is being truncated to a bool)

I obviously messed up arguments to MachineOperand::CreateReg
in rL326769. This should make it work as intended.

Thanks to RKSimon for spotting this.

llvm-svn: 326780

6 years ago[CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.
Florian Hahn [Tue, 6 Mar 2018 13:12:32 +0000 (13:12 +0000)]
[CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.

In case PredBB == BB and StopAt == BB's terminator, StopAt != &*BI will
fail, because BB's terminator instruction gets replaced.

By using BB.getTerminator() we get the current terminator which we can use
to compare.

Reviewers: sanjoy, anna, reames

Reviewed By: anna

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

llvm-svn: 326779

6 years ago[clangd] Fix -Wpedantic warning, NFC.
Haojian Wu [Tue, 6 Mar 2018 12:56:18 +0000 (12:56 +0000)]
[clangd] Fix -Wpedantic warning, NFC.

llvm-svn: 326778