platform/upstream/llvm.git
7 years ago[LLD] Fix typo. NFC
Shoaib Meenai [Fri, 13 Oct 2017 06:11:20 +0000 (06:11 +0000)]
[LLD] Fix typo. NFC

llvm-svn: 315675

7 years ago[X86] Remove patterns that select unmasked vbroadcastf2x32/vbroadcasti2x32. Prefer...
Craig Topper [Fri, 13 Oct 2017 06:07:10 +0000 (06:07 +0000)]
[X86] Remove patterns that select unmasked vbroadcastf2x32/vbroadcasti2x32. Prefer vbroadcastsd/vpbroadcastq instead.

There's no advantage to using these instructions when they aren't masked. This enables some additional execution domain switching without needing to update the table.

llvm-svn: 315674

7 years agoMake it explicit that we are writing addends to target sections if REL.
Rui Ueyama [Fri, 13 Oct 2017 05:58:54 +0000 (05:58 +0000)]
Make it explicit that we are writing addends to target sections if REL.

Relocations.cpp is still head-scratching. Even though relocations are
processed by multiple functions, the functions are effectively one
gigantic function with lots of local and global shared states, because
they are really tightly coupled. It is really hard to predict whether
a change to a function will or will not affect other functions behaviors.

What I'm trying to do is to rewrite the code without breaking the
existing tests so that the code can tolerate a more aggressive
refactoring (i.e. splitting it to logically separated steps).

llvm-svn: 315673

7 years ago[SCEV] Maintain loop use lists, and use them in forgetLoop
Sanjoy Das [Fri, 13 Oct 2017 05:50:52 +0000 (05:50 +0000)]
[SCEV] Maintain loop use lists, and use them in forgetLoop

Summary:
Currently we do not correctly invalidate memoized results for add recurrences
that were created directly (i.e. they were not created from a `Value`).  This
change fixes this by keeping loop use lists and using the loop use lists to
determine which SCEV expressions to invalidate.

Here are some statistics on the number of uses of in the use lists of all loops
on a clang bootstrap (config: release, no asserts):

     Count: 731310
       Min: 1
      Mean: 8.555150
50th %time: 4
95th %tile: 25
99th %tile: 53
       Max: 433

Reviewers: atrick, sunfish, mkazantsev

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 315672

7 years ago[SelectionDAG] Cleanup the SIGN_EXTEND_INREG handling in computeKnownBits. NFCI
Craig Topper [Fri, 13 Oct 2017 05:35:35 +0000 (05:35 +0000)]
[SelectionDAG] Cleanup the SIGN_EXTEND_INREG handling in computeKnownBits. NFCI

Use less temporary APInts. Use bit counting more. Don't call getScalarSizeInBits so many places, just capture it once.

llvm-svn: 315671

7 years ago[SelectionDAG] Fix typo in comment. NFC
Craig Topper [Fri, 13 Oct 2017 05:35:34 +0000 (05:35 +0000)]
[SelectionDAG] Fix typo in comment. NFC

llvm-svn: 315670

7 years agoDestructure a boolean expression and add comment.
Rui Ueyama [Fri, 13 Oct 2017 04:04:10 +0000 (04:04 +0000)]
Destructure a boolean expression and add comment.

"IsWrite" variable didn't make sense and was misleading because
it became true even if a section is not writable.

llvm-svn: 315669

7 years ago[OpenCL] Add LangAS::opencl_private to represent private address space in AST
Yaxun Liu [Fri, 13 Oct 2017 03:37:48 +0000 (03:37 +0000)]
[OpenCL] Add LangAS::opencl_private to represent private address space in AST

Currently Clang uses default address space (0) to represent private address space for OpenCL
in AST. There are two issues with this:

Multiple address spaces including private address space cannot be diagnosed.
There is no mangling for default address space. For example, if private int* is emitted as
i32 addrspace(5)* in IR. It is supposed to be mangled as PUAS5i but it is mangled as
Pi instead.

This patch attempts to represent OpenCL private address space explicitly in AST. It adds
a new enum LangAS::opencl_private and adds it to the variable types which are implicitly
private:

automatic variables without address space qualifier

function parameter

pointee type without address space qualifier (OpenCL 1.2 and below)

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

llvm-svn: 315668

7 years agoHide SymbolBody::IsLocal.
Rui Ueyama [Fri, 13 Oct 2017 03:37:26 +0000 (03:37 +0000)]
Hide SymbolBody::IsLocal.

IsLocal member is initialized by the constructor and will never change.
So we don't want to make it directly accessible.

llvm-svn: 315667

7 years agoMake a condition more explicit. NFC.
Rui Ueyama [Fri, 13 Oct 2017 03:37:11 +0000 (03:37 +0000)]
Make a condition more explicit. NFC.

llvm-svn: 315666

7 years ago[clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA
Alexander Shaposhnikov [Fri, 13 Oct 2017 03:21:39 +0000 (03:21 +0000)]
[clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA

At the moment if LLVM_BUILD_INSTRUMENTED is set to True
one has to set LLVM_PROFTDATA even if it's not really used
(because of message(FATAL_ERROR ...)).
Building the instrumented version of Clang can be useful even if
one doesn't plan to build the target generate-profdata
(currently that target would only compile utils/perf-training/cxx/hello_world.cpp).
For example, one can run the instrumented version of Clang
via a separate build system against a different codebase,
collect/analyze the profiles and merge them by llvm-profdata later.

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

llvm-svn: 315665

7 years agoAdd comment.
Rui Ueyama [Fri, 13 Oct 2017 02:57:59 +0000 (02:57 +0000)]
Add comment.

llvm-svn: 315664

7 years agoSupport for destroying operator delete, per C++2a proposal P0722.
Richard Smith [Fri, 13 Oct 2017 01:55:36 +0000 (01:55 +0000)]
Support for destroying operator delete, per C++2a proposal P0722.

This feature is not (yet) approved by the C++ committee, so this is liable to
be reverted or significantly modified based on committee feedback.

No functionality change intended for existing code (a new type must be defined
in namespace std to take advantage of this feature).

llvm-svn: 315662

7 years agoRecommit r315087 "[refactor] add support for refactoring options"
Alex Lorenz [Fri, 13 Oct 2017 01:53:13 +0000 (01:53 +0000)]
Recommit r315087 "[refactor] add support for refactoring options"

The recommit fixes a UB bug that occurred only on a small number of bots.

Original message:

This commit adds initial support for refactoring options. One can now use
optional and required std::string options.

This commit also adds a NewNameOption for the local-rename refactoring action to
allow rename to work with custom names.

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

llvm-svn: 315661

7 years agoSimplify. NFCI.
Rui Ueyama [Fri, 13 Oct 2017 01:42:27 +0000 (01:42 +0000)]
Simplify. NFCI.

llvm-svn: 315659

7 years agoSlightly simplify code and add comment.
Rui Ueyama [Fri, 13 Oct 2017 01:19:10 +0000 (01:19 +0000)]
Slightly simplify code and add comment.

This is not a mechanical transformation. Even though I believe this
patch is correct, I'm not 100% sure if lld with this patch behaves
exactly the same way as before on all edge cases. At least all tests
still pass.

I'm submitting this patch because it took almost a day to understand
this function, and I don't want to lose it.

llvm-svn: 315658

7 years ago[libFuzzer] tweam use_feature_frequency to be less aggressive; run a dummy input...
Kostya Serebryany [Fri, 13 Oct 2017 01:12:23 +0000 (01:12 +0000)]
[libFuzzer] tweam use_feature_frequency to be less aggressive; run a dummy input before the seed corpus

llvm-svn: 315657

7 years ago[MS] Don't bail on replacing dllimport vbase dtors with base dtors
Reid Kleckner [Fri, 13 Oct 2017 00:53:02 +0000 (00:53 +0000)]
[MS] Don't bail on replacing dllimport vbase dtors with base dtors

Fix PR32990 by effectively reverting r283063 and solving it a different
way.

We want to limit the hack to not replace equivalent available_externally
dtors specifically to libc++, which uses always_inline. It seems certain
versions of libc++ do not provide all the symbols that an explicit
template instantiation is expected to provide.

If we get to the code that forms a real alias, only *then* check if this
is available_externally, and do that by asking a better question, which
is "is this a declaration for the linker?", because *that's* what means
we can't form an alias to it.

As a follow-on simplification, remove the InEveryTU parameter. Its last
use guarded this code for forming aliases, but we should never form
aliases to declarations, regardless of what we know about every TU.

llvm-svn: 315656

7 years ago[Analyzer] Assume that CFBooleanRef const globals are non-null
George Karpenkov [Fri, 13 Oct 2017 00:51:41 +0000 (00:51 +0000)]
[Analyzer] Assume that CFBooleanRef const globals are non-null

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

llvm-svn: 315655

7 years agoUse existing helper. NFC.
Rafael Espindola [Fri, 13 Oct 2017 00:44:33 +0000 (00:44 +0000)]
Use existing helper. NFC.

llvm-svn: 315654

7 years agoSimplify a boolean expression by the De Morgan's laws.
Rui Ueyama [Fri, 13 Oct 2017 00:35:44 +0000 (00:35 +0000)]
Simplify a boolean expression by the De Morgan's laws.

I don't really understand what exactly this expression means,
but at least I can mechanically transform it.

llvm-svn: 315653

7 years agoTypos in tutorial
Jan Korous [Fri, 13 Oct 2017 00:31:07 +0000 (00:31 +0000)]
Typos in tutorial

llvm-svn: 315652

7 years agodocs: Improve the docs about llvm-isel-fuzzer on OSS Fuzz
Justin Bogner [Fri, 13 Oct 2017 00:27:35 +0000 (00:27 +0000)]
docs: Improve the docs about llvm-isel-fuzzer on OSS Fuzz

llvm-svn: 315651

7 years agoConvert a few cases of isUndefined to isInCurrentDSO.
Rafael Espindola [Fri, 13 Oct 2017 00:23:35 +0000 (00:23 +0000)]
Convert a few cases of isUndefined to isInCurrentDSO.

I don't think there is an observable difference. We now just avoid
doing silly things like setting versions in lazy symbols.

llvm-svn: 315650

7 years ago[X86] Add the test case for r315613 that I forgot to 'git add'.
Craig Topper [Fri, 13 Oct 2017 00:20:47 +0000 (00:20 +0000)]
[X86] Add the test case for r315613 that I forgot to 'git add'.

llvm-svn: 315649

7 years ago[SelectionDAG] Correct the early out in SelectionDAG::getZeroExtendInReg to work...
Craig Topper [Fri, 13 Oct 2017 00:18:58 +0000 (00:18 +0000)]
[SelectionDAG] Correct the early out in SelectionDAG::getZeroExtendInReg to work properly for vector types.

I don't know if we ever hit this case or not. Turning it into an assert only fired on expanding some atomic operation in a SystemZ lit test.

llvm-svn: 315648

7 years ago[llvm-isel-fuzzer] Use "--" as separator rather than '='.
Matt Morehouse [Fri, 13 Oct 2017 00:18:32 +0000 (00:18 +0000)]
[llvm-isel-fuzzer] Use "--" as separator rather than '='.

Summary: OSS-Fuzz doesn't support '=' in filenames.

Reviewers: bogner, kcc

Reviewed By: kcc

Subscribers: javed.absar, hiraditya, llvm-commits

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

llvm-svn: 315647

7 years agollvm-isel-fuzzer: Use the right REQUIRES line for r315599
Justin Bogner [Fri, 13 Oct 2017 00:17:54 +0000 (00:17 +0000)]
llvm-isel-fuzzer: Use the right REQUIRES line for r315599

I'd mixed up ENABLE_SHARED and BUILD_SHARED_LIBS before, so these
tests were being disabled in too many places.

llvm-svn: 315646

7 years agoCorrectly handle shared and lazy symbols.
Rafael Espindola [Fri, 13 Oct 2017 00:06:38 +0000 (00:06 +0000)]
Correctly handle shared and lazy symbols.

I will try to make this API a bit less error prone, but for now just
get another test passing.

llvm-svn: 315645

7 years agoRemoving default case statement from covered switch.
Keith Wyss [Fri, 13 Oct 2017 00:06:35 +0000 (00:06 +0000)]
Removing default case statement from covered switch.

Previous patch did not count on the llvm command line parser to restrict the
inputs, but it is safe to do so.

Fix forward for patch with details:
-- https://reviews.llvm.org/D38650 and
-- https://llvm.org/svn/llvm-project/llvm/trunk@315635 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-svn: 315644

7 years agoHandle/assert on DK_Remark
Adam Nemet [Thu, 12 Oct 2017 23:56:54 +0000 (23:56 +0000)]
Handle/assert on DK_Remark

We don't generate remarks during inline assembly parsing so no need to handle
these for now.

llvm-svn: 315643

7 years agoAdd DK_Remark to SMDiagnostic
Adam Nemet [Thu, 12 Oct 2017 23:56:02 +0000 (23:56 +0000)]
Add DK_Remark to SMDiagnostic

Swift uses SMDiagnostic for diagnostic messages. For
https://github.com/apple/swift/pull/12294, we need remark support.

I picked the color that clang uses to display them.

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

llvm-svn: 315642

7 years ago[SelectionDAG] Const-correct the DemandedMask argument to one of the overloads of...
Craig Topper [Thu, 12 Oct 2017 23:46:05 +0000 (23:46 +0000)]
[SelectionDAG] Const-correct the DemandedMask argument to one of the overloads of SimplifyDemandedBits. NFC

llvm-svn: 315641

7 years ago[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Thu, 12 Oct 2017 23:30:03 +0000 (23:30 +0000)]
[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 315640

7 years ago[Sema][ObjC] Complete merging ObjC methods before checking their
Akira Hatanaka [Thu, 12 Oct 2017 23:24:38 +0000 (23:24 +0000)]
[Sema][ObjC] Complete merging ObjC methods before checking their
overriding methods.

This should fix test case Analysis/retain-release.m that was failing on
the reverse iteration bot:

http://lab.llvm.org:8011/builders/reverse-iteration

The test used to fail because the loop in CheckObjCMethodOverrides would
merge attribute ns_returns_retained on methods while checking whether
the overriding methods were compatible. Since OverrideSearch::Overridden
is a SmallPtrSet and the order in which the elements of the set are
visited is non-deterministic, the test would fail when method 'clone' of
the protocol 'F18P' was visited before F18(Cat)'s method 'clone' was
visited.

llvm-svn: 315639

7 years ago[Sema][Crash] Correctly handle an non-dependent noexcept expr in function template
Erich Keane [Thu, 12 Oct 2017 23:01:53 +0000 (23:01 +0000)]
[Sema][Crash] Correctly handle an non-dependent noexcept expr in function template

It seems that all of the other templated cases are handled correctly,
however the function template case was not correctly handled. This
patch recovers from this condition by setting the function to noexcept
after diagnosing. Previously it simply set NoexceptExpr to null,
which caused an Assert when this was evaluated during substitution.

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

llvm-svn: 315638

7 years agoRevert "TargetMachine: Merge TargetMachine and LLVMTargetMachine"
Matthias Braun [Thu, 12 Oct 2017 22:57:28 +0000 (22:57 +0000)]
Revert "TargetMachine: Merge TargetMachine and LLVMTargetMachine"

Reverting to investigate layering effects of MCJIT not linking
libCodeGen but using TargetMachine::getNameWithPrefix() breaking the
lldb bots.

This reverts commit r315633.

llvm-svn: 315637

7 years agoDeprecate DwarfUnit::addBlockByrefAddress().
Adrian Prantl [Thu, 12 Oct 2017 22:54:36 +0000 (22:54 +0000)]
Deprecate DwarfUnit::addBlockByrefAddress().

The clang frontend already creates a DIExpression that replicates the
logic in addBlockByrefAddress() exactly, thus making this function
effectively unreachable. To guard against human error I'm hereby
marking the function with an assertion and let it hit the bots before
eventually removing it.

rdar://problem/31629055

llvm-svn: 315636

7 years ago[XRay][tools] Updated stacks tool with flamegraph output.
Keith Wyss [Thu, 12 Oct 2017 22:47:42 +0000 (22:47 +0000)]
[XRay][tools] Updated stacks tool with flamegraph output.

Summary:
As the first step to allow analysis and visualization of xray collected data,
allow using the llvm-xray stacks tool to emit a complete listing of stacks in
the format consumable by a flamegraph tool.

Possible follow up formats include chrome trace viewer format and sql load
files.

As a POC, I'm able to generate flamegraphs of an xray instrumented llc compiling
hello world.

Reviewers: dberris, pelikan

Subscribers: llvm-commits

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

llvm-svn: 315635

7 years ago[CVP] Process binary operations even when def is local
Anna Thomas [Thu, 12 Oct 2017 22:39:52 +0000 (22:39 +0000)]
[CVP] Process binary operations even when def is local

Summary:
This patch adds processing of binary operations when the def of operands are in
the same block (i.e. local processing).

Earlier we bailed out in such cases (the bail out was introduced in rL252032)
because LVI at that time was more precise about context at the end of basic
blocks, which implied local def and use analysis didn't benefit CVP.

Since then we've added support for LVI in presence of assumes and guards. The
test cases added show how local def processing in CVP helps adding more
information to the ashr, sdiv, srem and add operators.

Note: processCmp which suffers from the same problem will
be handled in a later patch.

Reviewers: philip, apilipenko, SjoerdMeijer, hfinkel

Subscribers: llvm-commits

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

llvm-svn: 315634

7 years agoTargetMachine: Merge TargetMachine and LLVMTargetMachine
Matthias Braun [Thu, 12 Oct 2017 22:28:54 +0000 (22:28 +0000)]
TargetMachine: Merge TargetMachine and LLVMTargetMachine

Merge LLVMTargetMachine into TargetMachine.

- There is no in-tree target anymore that just implements TargetMachine
  but not LLVMTargetMachine.
- It should still be possible to stub out all the various functions in
  case a target does not want to use lib/CodeGen
- This simplifies the code and avoids methods ending up in the wrong
  interface.

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

llvm-svn: 315633

7 years ago[sanitizer] Workaround a Linux kernel bug in hard_rss_limit_mb_test.
Evgeniy Stepanov [Thu, 12 Oct 2017 22:24:58 +0000 (22:24 +0000)]
[sanitizer] Workaround a Linux kernel bug in hard_rss_limit_mb_test.

llvm-svn: 315632

7 years agoRevert "[Sema] Diagnose tautological comparison with type's min/max values"
Roman Lebedev [Thu, 12 Oct 2017 22:03:20 +0000 (22:03 +0000)]
Revert "[Sema] Diagnose tautological comparison with type's min/max values"

This reverts r315614,r315615,r315621,r315622
Breaks http://bb9.pgr.jp/#/builders/20/builds/59

/home/bb9/bootstrap-clang-libcxx-lld-i686-linux/llvm-project/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp:95:17: error: comparison 'long long' > 9223372036854775807 is always false [-Werror,-Wtautological-constant-compare]
    if (max_sec > Lim::max()) return false;
        ~~~~~~~ ^ ~~~~~~~~~~
/home/bb9/bootstrap-clang-libcxx-lld-i686-linux/llvm-project/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp:124:13: error: comparison 'long long' < -9223372036854775808 is always false [-Werror,-Wtautological-constant-compare]
    if (sec < Lim::min() || sec > Lim::max())   return false;
        ~~~ ^ ~~~~~~~~~~
/home/bb9/bootstrap-clang-libcxx-lld-i686-linux/llvm-project/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp:124:33: error: comparison 'long long' > 9223372036854775807 is always false [-Werror,-Wtautological-constant-compare]
    if (sec < Lim::min() || sec > Lim::max())   return false;
                            ~~~ ^ ~~~~~~~~~~
3 errors generated.
--

I'm not yet sure what is the proper fix.

llvm-svn: 315631

7 years ago[cmake] Rename LIB_FUZZING_ENGINE to LLVM_LIB_FUZZING_ENGINE.
Matt Morehouse [Thu, 12 Oct 2017 22:00:09 +0000 (22:00 +0000)]
[cmake] Rename LIB_FUZZING_ENGINE to LLVM_LIB_FUZZING_ENGINE.

llvm-svn: 315630

7 years ago[cmake] Allow building fuzzers with OSS-Fuzz flags.
Matt Morehouse [Thu, 12 Oct 2017 21:58:41 +0000 (21:58 +0000)]
[cmake] Allow building fuzzers with OSS-Fuzz flags.

Reviewers: kcc, bogner

Reviewed By: bogner

Subscribers: mgorny, llvm-commits

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

llvm-svn: 315629

7 years ago[SelectionDAG] Simplify the ISD::SIGN_EXTEND/ZERO_EXTEND handling to use less tempora...
Craig Topper [Thu, 12 Oct 2017 21:58:25 +0000 (21:58 +0000)]
[SelectionDAG] Simplify the ISD::SIGN_EXTEND/ZERO_EXTEND handling to use less temporary APInts by counting bits instead. NFCI

llvm-svn: 315628

7 years ago[lit] Raise the logic for enabling clang & lld substitutions to llvm.
Zachary Turner [Thu, 12 Oct 2017 21:56:05 +0000 (21:56 +0000)]
[lit] Raise the logic for enabling clang & lld substitutions to llvm.

This paves the way for other projects which might /use/ clang or
lld but not necessarily need to the full set of functionality
available to clang and lld tests to be able to have a basic set
of substitutions that allow a project to run the clang or lld
executables.

llvm-svn: 315627

7 years ago[lld] Fix typo. NFC
Shoaib Meenai [Thu, 12 Oct 2017 21:52:14 +0000 (21:52 +0000)]
[lld] Fix typo. NFC

llvm-svn: 315626

7 years agoAdd comment.
Rui Ueyama [Thu, 12 Oct 2017 21:45:53 +0000 (21:45 +0000)]
Add comment.

llvm-svn: 315625

7 years ago[CUDA] Added __hmma_m16n16k16_* builtins to support mma instructions on sm_70
Artem Belevich [Thu, 12 Oct 2017 21:32:19 +0000 (21:32 +0000)]
[CUDA] Added __hmma_m16n16k16_* builtins to support mma instructions on sm_70

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

llvm-svn: 315624

7 years ago[LoopPredication] Check whether the loop is already guarded by the first iteration...
Artur Pilipenko [Thu, 12 Oct 2017 21:21:17 +0000 (21:21 +0000)]
[LoopPredication] Check whether the loop is already guarded by the first iteration check condition

llvm-svn: 315623

7 years ago[Analysis] Un-silence -Wtautological-unsigned-zero-compare in null-deref-ps.c
Roman Lebedev [Thu, 12 Oct 2017 21:15:26 +0000 (21:15 +0000)]
[Analysis] Un-silence -Wtautological-unsigned-zero-compare in null-deref-ps.c

Stage-2 builds failed:

error: 'warning' diagnostics expected but not seen:
  File /home/buildbot/modules-slave-2/clang-x86_64-linux-selfhost-modules-2/llvm.src/tools/clang/test/Analysis/null-deref-ps.c Line 238: always true
llvm-svn: 315622

7 years ago[SemaChecking] Suppress a GCC warning. NFCI.
Davide Italiano [Thu, 12 Oct 2017 21:08:29 +0000 (21:08 +0000)]
[SemaChecking] Suppress a GCC warning. NFCI.

llvm-svn: 315621

7 years ago[cmake] [asan] Remove unnecessary gtest dep from dynamic tests
Michal Gorny [Thu, 12 Oct 2017 21:07:43 +0000 (21:07 +0000)]
[cmake] [asan] Remove unnecessary gtest dep from dynamic tests

Remove the redundant dependency on 'gtest' target from the dynamic tests
in non-MSVC environment. The tests reuse compiled objects
from ASAN_INST_TEST_OBJECTS, and therefore they have been built against
gtest already.

This both fixes the spurious dependency on 'gtest' target that breaks
stand-alone builds, and brings the dynamic tests more in line with
regular tests which do not pass this dependency
to add_compiler_rt_test() through generate_compiler_rt_tests().

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

llvm-svn: 315620

7 years ago[DWARF] Fix bad comparator in sortGlobalExprs.
Eli Friedman [Thu, 12 Oct 2017 20:54:08 +0000 (20:54 +0000)]
[DWARF] Fix bad comparator in sortGlobalExprs.

The comparator passed to std::sort must provide a strict weak ordering;
otherwise, the behavior is undefined.

Fixes an assertion failure generating debug info for globals
split by GlobalOpt. I have a testcase, but not sure how to reduce it,
so not included here.  (Someone else came up with a testcase, but I
can't reproduce the crash with it, presumably because my version of LLVM
ends up sorting the array differently.)

This isn't really a complete fix (see the FIXME in the patch), but at
least it doesn't have undefined behavior.

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

llvm-svn: 315619

7 years agoRevert "Reintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP.""
Bruno Cardoso Lopes [Thu, 12 Oct 2017 20:52:34 +0000 (20:52 +0000)]
Revert "Reintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP.""

This reverts commit r315593: still affect two bots:

http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/5308
http://green.lab.llvm.org/green/job/clang-stage2-configure-Rlto/21751/

llvm-svn: 315618

7 years agoHandle MIPS-specific addend rules in computeAddend().
Rui Ueyama [Thu, 12 Oct 2017 20:42:15 +0000 (20:42 +0000)]
Handle MIPS-specific addend rules in computeAddend().

This patch merges computeAddend and computeMipsAddend.

Getting an addend for a relocation is usually pretty easy:
it is either in the r_addend field (if RELA) or in a target
section (if REL).

However, MIPS has many special rules that are different from
other ELF ABIs. I don't think there were technical reasons to
be different, but the reality is that they are different.
It is unfortunate that we had to pass many parameters to
computeAddend, but it seems unavoidable because of MIPS.

llvm-svn: 315617

7 years ago[LoopPredication] Support ule, sle latch predicates
Artur Pilipenko [Thu, 12 Oct 2017 20:40:27 +0000 (20:40 +0000)]
[LoopPredication] Support ule, sle latch predicates

This is a follow up for the loop predication change 313981 to support ule, sle latch predicates.

Reviewed By: mkazantsev

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

llvm-svn: 315616

7 years ago[Analysis] Silence -Wtautological-constant-compare in two tests
Roman Lebedev [Thu, 12 Oct 2017 20:27:41 +0000 (20:27 +0000)]
[Analysis] Silence -Wtautological-constant-compare in two tests

Yes, did not check that. Need to do better :(
I do not believe it makes sense to do expect that warning here.

llvm-svn: 315615

7 years ago[Sema] Diagnose tautological comparison with type's min/max values
Roman Lebedev [Thu, 12 Oct 2017 20:16:51 +0000 (20:16 +0000)]
[Sema] Diagnose tautological comparison with type's min/max values

Summary:
Currently, clang only diagnoses completely out-of-range comparisons (e.g. `char` and constant `300`),
and comparisons of unsigned and `0`. But gcc also does diagnose the comparisons with the
`std::numeric_limits<>::max()` / `std::numeric_limits<>::min()` so to speak

Finally Fixes https://bugs.llvm.org/show_bug.cgi?id=34147
Continuation of https://reviews.llvm.org/D37565

Reviewers: rjmccall, rsmith, aaron.ballman

Reviewed By: rsmith

Subscribers: rtrieu, jroelofs, cfe-commits

Tags: #clang

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

llvm-svn: 315614

7 years ago[X86] Add CLWB intrinsic. llvm part
Craig Topper [Thu, 12 Oct 2017 20:08:31 +0000 (20:08 +0000)]
[X86] Add CLWB intrinsic. llvm part

llvm-svn: 315613

7 years agoEarly-continue for a MIPS-specific rule.
Rui Ueyama [Thu, 12 Oct 2017 20:03:57 +0000 (20:03 +0000)]
Early-continue for a MIPS-specific rule.

This is an attempt to make lld's relocation handler code understandable.
Since I don't fully understand what exactly this function does for all
possible cases (I believe no one can), I'm not really sure if this patch
is NFC, but at least no functionality change intended. All tests still pass.

llvm-svn: 315612

7 years ago[OPENMP] Fix PR34927: Emit initializer for reduction array with declare
Alexey Bataev [Thu, 12 Oct 2017 20:03:39 +0000 (20:03 +0000)]
[OPENMP] Fix PR34927: Emit initializer for reduction array with declare
reduction.

If the reduction is an array or an array section and reduction operation
is declare reduction without initializer, it may lead to crash.

llvm-svn: 315611

7 years agoImplement custom lowering for ISD::CTTZ_ZERO_UNDEF and ISD::CTTZ.
Wei Ding [Thu, 12 Oct 2017 19:37:14 +0000 (19:37 +0000)]
Implement custom lowering for ISD::CTTZ_ZERO_UNDEF and ISD::CTTZ.

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

llvm-svn: 315610

7 years agoRemove Symbol::isPreemptible().
Rui Ueyama [Thu, 12 Oct 2017 19:10:41 +0000 (19:10 +0000)]
Remove Symbol::isPreemptible().

Because it was a redundant accessor to Symbol's public member.

llvm-svn: 315609

7 years agoAMDGPU/NFC: Move AMDGPU specific note types to ELF.h
Konstantin Zhuravlyov [Thu, 12 Oct 2017 18:59:54 +0000 (18:59 +0000)]
AMDGPU/NFC: Move AMDGPU specific note types to ELF.h

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

llvm-svn: 315608

7 years ago[X86] Add CLWB intrinsic. clang part
Craig Topper [Thu, 12 Oct 2017 18:57:15 +0000 (18:57 +0000)]
[X86] Add CLWB intrinsic. clang part

Reviewers: RKSimon, zvi, igorb

Reviewed By: RKSimon

Subscribers: cfe-commits

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

llvm-svn: 315607

7 years ago[X86] Add a bunch of -mcpu strings to the cpus.ll test.
Craig Topper [Thu, 12 Oct 2017 18:55:57 +0000 (18:55 +0000)]
[X86] Add a bunch of -mcpu strings to the cpus.ll test.

We were missing most of the "core" aliases as well as skylake, cannonlake, and knights landing.

llvm-svn: 315606

7 years ago[cmake] [interception] Remove duplicate gtest from test COMPILE_DEPS
Michal Gorny [Thu, 12 Oct 2017 18:51:41 +0000 (18:51 +0000)]
[cmake] [interception] Remove duplicate gtest from test COMPILE_DEPS

Fix the gtest dependency to be included in DEPS only, rather than
in COMPILE_DEPS + DEPS. The former variable is apparently used to
provide unconditional dependencies, while the latter are only used
for non-standalone builds. Since they are concatenated, specifying gtest
in both is redundant. Furthermore, including it in COMPILE_DEPS causes
build failure for standalone builds where 'gtest' target is not present.

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

llvm-svn: 315605

7 years ago[cmake] Fix skipping DEPS (typo) in sanitizer_test_compile()
Michal Gorny [Thu, 12 Oct 2017 18:51:37 +0000 (18:51 +0000)]
[cmake] Fix skipping DEPS (typo) in sanitizer_test_compile()

Fix typo in variable assignment inside sanitizer_test_compile() that
resulted in TEST_DEPS parameter not being included in the clang_compile()
call. Spotted by George Karpenkov in D38444.

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

llvm-svn: 315604

7 years ago[clang-format] Allow building fuzzer with OSS-Fuzz flags.
Matt Morehouse [Thu, 12 Oct 2017 18:39:10 +0000 (18:39 +0000)]
[clang-format] Allow building fuzzer with OSS-Fuzz flags.

Reviewers: kcc, bogner

Reviewed By: kcc

Subscribers: cfe-commits, mgorny

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

llvm-svn: 315603

7 years ago[asan] Disable a flaky test on android.
Evgeniy Stepanov [Thu, 12 Oct 2017 18:34:20 +0000 (18:34 +0000)]
[asan] Disable a flaky test on android.

llvm-svn: 315602

7 years ago[NVPTX] Implemented wmma intrinsics and instructions.
Artem Belevich [Thu, 12 Oct 2017 18:27:55 +0000 (18:27 +0000)]
[NVPTX] Implemented wmma intrinsics and instructions.

WMMA = "Warp Level Matrix Multiply-Accumulate".
These are the new instructions introduced in PTX6.0 and available
on sm_70 GPUs.

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

llvm-svn: 315601

7 years ago[codeview] Don't emit FPO data in funclet prologues
Reid Kleckner [Thu, 12 Oct 2017 18:20:35 +0000 (18:20 +0000)]
[codeview] Don't emit FPO data in funclet prologues

Attempt 3 to work around bugs in FPO data with funclets.

llvm-svn: 315600

7 years agollvm-isel-fuzzer: Work around BUILD_SHARED_LIBS testing issues
Justin Bogner [Thu, 12 Oct 2017 18:10:22 +0000 (18:10 +0000)]
llvm-isel-fuzzer: Work around BUILD_SHARED_LIBS testing issues

Building with BUILD_SHARED_LIBS makes it tricky to copy around
executables at will, since they won't be able to find the LLVM
libraries any more. This makes testing a feature that's based on the
executable name problematic, so we'll just disable these two tests in
that configuration.

We could potentially fix this by symlinking the lib directory into the
test directory, but that wouldn't work on windows, and losing testing
on windows would be far worse than losing testing on a configuration
that's barely even supported.

llvm-svn: 315599

7 years ago[TableGen] Allow intrinsics to have up to 8 return values.
Artem Belevich [Thu, 12 Oct 2017 17:40:00 +0000 (17:40 +0000)]
[TableGen] Allow intrinsics to have up to 8 return values.

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

llvm-svn: 315598

7 years agoWork around lack of Wine support for SetFileInformationByHandle harder
Hans Wennborg [Thu, 12 Oct 2017 17:38:22 +0000 (17:38 +0000)]
Work around lack of Wine support for SetFileInformationByHandle harder

In r315079 I added a check for the ERROR_CALL_NOT_IMPLEMENTED error
code, but it turns out earlier versions of Wine just returned false
without setting any error code.

This patch handles the unset error code case.

llvm-svn: 315597

7 years agoAMDGPU: Fix warnings introduced in r315526
Konstantin Zhuravlyov [Thu, 12 Oct 2017 17:34:05 +0000 (17:34 +0000)]
AMDGPU: Fix warnings introduced in r315526

llvm-svn: 315596

7 years ago[ValueTracking] return zero when there's conflict in known bits of a shift (PR34838)
Sanjay Patel [Thu, 12 Oct 2017 17:31:46 +0000 (17:31 +0000)]
[ValueTracking] return zero when there's conflict in known bits of a shift (PR34838)

Poison allows us to return a better result than undef.

llvm-svn: 315595

7 years ago[X86] Use -ffreestanding instead of using the mm_malloc.h include guard hack on more...
Craig Topper [Thu, 12 Oct 2017 17:21:01 +0000 (17:21 +0000)]
[X86] Use -ffreestanding instead of using the mm_malloc.h include guard hack on more of the builtin tests.

llvm-svn: 315594

7 years agoReintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP."
Bruno Cardoso Lopes [Thu, 12 Oct 2017 16:54:11 +0000 (16:54 +0000)]
Reintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP."

This is r315288 & r315294, which were reverted due to stage2 bot
failures.

Summary:
This updates the SCCP solver to use of the ValueElement lattice for
parameters, which provides integer range information. The range
information is used to remove unneeded icmp instructions.

For the following function, f() can be optimized to `ret i32 2` with
this change

  source_filename = "sccp.c"
  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64-unknown-linux-gnu"

  ; Function Attrs: norecurse nounwind readnone uwtable
  define i32 @main() local_unnamed_addr #0 {
  entry:
    %call = tail call fastcc i32 @f(i32 1)
    %call1 = tail call fastcc i32 @f(i32 47)
    %add3 = add nsw i32 %call, %call1
    ret i32 %add3
  }

  ; Function Attrs: noinline norecurse nounwind readnone uwtable
  define internal fastcc i32 @f(i32 %x) unnamed_addr #1 {
  entry:
    %c1 = icmp sle i32 %x, 100

    %cmp = icmp sgt i32 %x, 300
    %. = select i1 %cmp, i32 1, i32 2
    ret i32 %.
  }

  attributes #1 = { noinline }

Reviewers: davide, sanjoy, efriedma, dberlin

Reviewed By: davide, dberlin

Subscribers: mcrosier, gberry, mssimpso, dberlin, llvm-commits

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

llvm-svn: 315593

7 years ago[PowerPC] Add profitablilty check for conversion to mtctr loops
Lei Huang [Thu, 12 Oct 2017 16:43:33 +0000 (16:43 +0000)]
[PowerPC] Add profitablilty check for conversion to mtctr loops

Add profitability checks for modifying counted loops to use the mtctr instruction.

The latency of mtctr is only justified if there are more than 4 comparisons that
will be removed as a result.  Usually counted loops are formed relatively early
and before unrolling, so most low trip count loops often don't survive.  However
we want to ensure that if they do, we do not mistakenly update them to mtctr loops.

Use CodeMetrics to ensure we are only doing this for small loops with small trip counts.

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

llvm-svn: 315592

7 years ago[AMDGPU] For amdpal, widen interpolation mode workaround
Tim Renouf [Thu, 12 Oct 2017 16:16:41 +0000 (16:16 +0000)]
[AMDGPU] For amdpal, widen interpolation mode workaround

Summary:
The interpolation mode workaround ensures that at least one
interpolation mode is enabled in PSInputAddr. It does not also check
PSInputEna on the basis that the user might enable bits in that
depending on run-time state.

However, for amdpal os type, the user does not enable some bits after
compilation based on run-time states; the register values being
generated here are the final ones set in the hardware. Therefore, apply
the workaround to PSInputAddr and PSInputEnable together. (The case
where a bit is set in PSInputAddr but not in PSInputEnable is where the
frontend set up an input arg for a particular interpolation mode, but
nothing uses that input arg. Really we should have an earlier pass that
removes such an arg.)

Reviewers: arsenm, nhaehnle, dstuttard

Subscribers: kzhuravl, wdng, yaxunl, t-tye, llvm-commits

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

llvm-svn: 315591

7 years ago[dump] Remove NDEBUG from test to enable dump methods [NFC]
Don Hinton [Thu, 12 Oct 2017 16:16:06 +0000 (16:16 +0000)]
[dump] Remove NDEBUG from test to enable dump methods [NFC]

Summary:
Add LLVM_FORCE_ENABLE_DUMP cmake option, and use it along with
LLVM_ENABLE_ASSERTIONS to set LLVM_ENABLE_DUMP.

Remove NDEBUG and only use LLVM_ENABLE_DUMP to enable dump methods.

Move definition of LLVM_ENABLE_DUMP from config.h to llvm-config.h so
it'll be picked up by public headers.

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

llvm-svn: 315590

7 years ago[x86] replace isEqualTo with == for efficiency
Sanjay Patel [Thu, 12 Oct 2017 16:15:38 +0000 (16:15 +0000)]
[x86] replace isEqualTo with == for efficiency

This is a follow-up suggested in D37534.
Patch by Yulia Koval.

llvm-svn: 315589

7 years agoUpdate comment.
Rafael Espindola [Thu, 12 Oct 2017 15:54:14 +0000 (15:54 +0000)]
Update comment.

The number 131076 didn't show up anywhere in the test.

llvm-svn: 315588

7 years ago[X86][SSE] Pull out repeated INSERT_VECTOR_ELT code from LowerBUILD_VECTOR v16i8...
Simon Pilgrim [Thu, 12 Oct 2017 15:52:01 +0000 (15:52 +0000)]
[X86][SSE] Pull out repeated INSERT_VECTOR_ELT code from LowerBUILD_VECTOR v16i8/v8i16 insertion. NFCI.

llvm-svn: 315587

7 years ago[OPENMP] Fix PR34926: Fix handling of the array sections passed as
Alexey Bataev [Thu, 12 Oct 2017 15:18:41 +0000 (15:18 +0000)]
[OPENMP] Fix PR34926: Fix handling of the array sections passed as
function params.

Codegen could crash if the array section base expression is the
function parameter.

llvm-svn: 315586

7 years agoRelax test.
Rafael Espindola [Thu, 12 Oct 2017 15:12:55 +0000 (15:12 +0000)]
Relax test.

The address of the .got section is not relevant for the test.

llvm-svn: 315585

7 years agoUse 0 as sh_link when we don't have a dynamic symbol table.
Rafael Espindola [Thu, 12 Oct 2017 15:05:04 +0000 (15:05 +0000)]
Use 0 as sh_link when we don't have a dynamic symbol table.

It doesn't make sense to link from an alloc section to a non alloc
one as we were doing.

This matches the behavior of both gold and bfd.

llvm-svn: 315584

7 years ago[scudo] Allow for non-Android Shared TSD platforms, part 1
Kostya Kortchinsky [Thu, 12 Oct 2017 15:01:09 +0000 (15:01 +0000)]
[scudo] Allow for non-Android Shared TSD platforms, part 1

Summary:
This first part just prepares the grounds for part 2 and doesn't add any new
functionality. It mostly consists of small refactors:
- move the `pthread.h` include higher as it will be used in the headers;
- use `errno.h` in `scudo_allocator.cpp` instead of the sanitizer one, update
  the `errno` assignments accordingly (otherwise it creates conflicts on some
  platforms due to `pthread.h` including `errno.h`);
- introduce and use `getCurrentTSD` and `setCurrentTSD` for the shared TSD
  model code;

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits, srhines

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

llvm-svn: 315583

7 years agoMore fuzzing infastructre - regex
Marshall Clow [Thu, 12 Oct 2017 14:48:09 +0000 (14:48 +0000)]
More fuzzing infastructre - regex

llvm-svn: 315582

7 years ago[cfi-verify] Fix typo, actually check X86 target
Vlad Tsyrklevich [Thu, 12 Oct 2017 14:42:26 +0000 (14:42 +0000)]
[cfi-verify] Fix typo, actually check X86 target

The typo in r315556 disabled the cfi-verify unit tests from building
unconditionally, have it correctly check for the X86 target.

llvm-svn: 315581

7 years agoRevert "Fix nested namespaces in google-readability-nested-namespace-comments."
Alexander Kornienko [Thu, 12 Oct 2017 14:25:16 +0000 (14:25 +0000)]
Revert "Fix nested namespaces in google-readability-nested-namespace-comments."

This reverts r315057. The revision introduces assertion failures:
assertion failed at llvm/tools/clang/include/clang/Basic/SourceManager.h:428 in
const clang::SrcMgr::ExpansionInfo &clang::SrcMgr::SLocEntry::getExpansion()
const: isExpansion() && "Not a macro expansion SLocEntry!"
Stack trace:
    __assert_fail
    clang::SrcMgr::SLocEntry::getExpansion()
    clang::SourceManager::getExpansionLocSlowCase()
    clang::SourceManager::getExpansionLoc()
    clang::Lexer::getRawToken()
    clang::tidy::readability::NamespaceCommentCheck::check()
    clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch()
    clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches()
    clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter()
    clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchDispatch()
    clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl()
    clang::RecursiveASTVisitor<>::TraverseDeclContextHelper()
    clang::RecursiveASTVisitor<>::TraverseDecl()
    clang::RecursiveASTVisitor<>::TraverseDeclContextHelper()
    clang::RecursiveASTVisitor<>::TraverseDecl()
    clang::RecursiveASTVisitor<>::TraverseDeclContextHelper()
    clang::RecursiveASTVisitor<>::TraverseDecl()
    clang::ast_matchers::MatchFinder::matchAST()
    clang::MultiplexConsumer::HandleTranslationUnit()
    clang::ParseAST()
    clang::FrontendAction::Execute()
    clang::CompilerInstance::ExecuteAction()
    clang::tooling::FrontendActionFactory::runInvocation()
    clang::tooling::ToolInvocation::runInvocation()
    clang::tooling::ToolInvocation::run()

Still working on an isolated test case.

llvm-svn: 315580

7 years agoMachineInstr: Make isEqual agree with getHashValue in MachineInstrExpressionTrait
Diana Picus [Thu, 12 Oct 2017 13:59:51 +0000 (13:59 +0000)]
MachineInstr: Make isEqual agree with getHashValue in MachineInstrExpressionTrait

MachineInstr::isIdenticalTo has a lot of logic for dealing with register
Defs (i.e. deciding whether to take them into account or ignore them).
This logic gets things wrong in some obscure cases, for instance if an
operand is not a Def for both the current MI and the one we are
comparing to.

I'm not sure if it's possible for this to happen for regular register
operands, but it may happen in the ARM backend for special operands
which use sentinel values for the register (i.e. 0, which is neither a
physical register nor a virtual one).

This causes MachineInstrExpressionTrait::isEqual (which uses
MachineInstr::isIdenticalTo) to return true for the following
instructions, which are the same except for the fact that one sets the
flags and the other one doesn't:
%1114 = ADDrsi %1113, %216, 17, 14, _, def _
%1115 = ADDrsi %1113, %216, 17, 14, _, _

OTOH, MachineInstrExpressionTrait::getHashValue returns different values
for the 2 instructions due to the different isDef on the last operand.
In practice this means that when trying to add those instructions to a
DenseMap, they will be considered different because of their different
hash values, but when growing the map we might get an assertion while
copying from the old buckets to the new buckets because isEqual
misleadingly returns true.

This patch makes sure that isEqual and getHashValue agree, by improving
the checks in MachineInstr::isIdenticalTo when we are ignoring virtual
register definitions (which is what the Trait uses). Firstly, instead of
checking isPhysicalRegister, we use !isVirtualRegister, so that we cover
both physical registers and sentinel values. Secondly, instead of
checking MachineOperand::isReg, we use MachineOperand::isIdenticalTo,
which checks isReg, isSubReg and isDef, which are the same values that
the hash function uses to compute the hash.

Note that the function is symmetric with this change, since if the
current operand is not a Def, we check MachineOperand::isIdenticalTo,
which returns false if the operands have different isDef's.

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

llvm-svn: 315579

7 years ago[OPENMP] Fix PR34925: Fix getting thread_id lvalue for inlined regions
Alexey Bataev [Thu, 12 Oct 2017 13:51:32 +0000 (13:51 +0000)]
[OPENMP] Fix PR34925: Fix getting thread_id lvalue for inlined regions
in C.

If we try to get the lvalue for thread_id variables in inlined regions,
we did not use the correct version of function. Fixed this bug by adding
overrided version of the function getThreadIDVariableLValue for inlined
regions.

llvm-svn: 315578

7 years ago[clangd] less boilerplate in RPC dispatch
Sam McCall [Thu, 12 Oct 2017 13:29:58 +0000 (13:29 +0000)]
[clangd] less boilerplate in RPC dispatch

Summary:
Make the ProtocolHandlers glue between JSONRPCDispatcher and
ClangdLSPServer generic.
Eliminate small differences between methods, de-emphasize the unimportant
distinction between notifications and methods.

ClangdLSPServer is no longer responsible for producing a complete
JSON-RPC response, just the JSON of the result object. (In future, we
should move that JSON serialization out, too).
Handler methods now take a context object that we may hang more
functionality off in the future.

Added documentation to ProtocolHandlers.

Reviewers: ilya-biryukov, bkramer

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 315577

7 years agoReinstantiate old/bad deduplication logic that was removed in r315279.
Daniel Jasper [Thu, 12 Oct 2017 13:25:05 +0000 (13:25 +0000)]
Reinstantiate old/bad deduplication logic that was removed in r315279.

While this shouldn't be necessary anymore, we have cases where we run
into the assertion below, i.e. cases with two non-fragment entries for the
same variable at different frame indices.

This should be fixed, but for now, we should revert to a version that
does not trigger asserts.

llvm-svn: 315576

7 years ago[CodeGen] Generate TBAA info along with LValue base info
Ivan A. Kosarev [Thu, 12 Oct 2017 11:29:46 +0000 (11:29 +0000)]
[CodeGen] Generate TBAA info along with LValue base info

This patch enables explicit generation of TBAA information in all
cases where LValue base info is propagated or constructed in
non-trivial ways. Eventually, we will consider each of these
cases to make sure the TBAA information is correct and not too
conservative. For now, we just fall back to generating TBAA info
from the access type.

This patch should not bring in any functional changes.

This is part of D38126 reworked to be a separate patch to
simplify review.

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

llvm-svn: 315575

7 years agoFix the google-readability-namespace-comments-cxx17 test after r315060.
Alexander Kornienko [Thu, 12 Oct 2017 10:41:22 +0000 (10:41 +0000)]
Fix the google-readability-namespace-comments-cxx17 test after r315060.

Restore the file extension. Make the namespace longer than the
ShortNamespaceLines so that the check triggers.

llvm-svn: 315574