]> granicus.if.org Git - clang/log
clang
5 years ago[test] Fix -Wunused-variable in rC343665
Fangrui Song [Wed, 3 Oct 2018 20:53:53 +0000 (20:53 +0000)]
[test] Fix -Wunused-variable in rC343665

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343721 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove stray character from docs
Stephen Kelly [Wed, 3 Oct 2018 20:53:02 +0000 (20:53 +0000)]
Remove stray character from docs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343720 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUpdate documentation for correctness
Stephen Kelly [Wed, 3 Oct 2018 20:52:57 +0000 (20:52 +0000)]
Update documentation for correctness

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343719 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd matchers missing from dynamic AST registry
Stephen Kelly [Wed, 3 Oct 2018 20:52:51 +0000 (20:52 +0000)]
Add matchers missing from dynamic AST registry

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343717 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSort list of matchers
Stephen Kelly [Wed, 3 Oct 2018 20:52:45 +0000 (20:52 +0000)]
Sort list of matchers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343716 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] [tests] [quickfix] Make the test more resilient for a non-defaut std confi...
George Karpenkov [Wed, 3 Oct 2018 20:46:50 +0000 (20:46 +0000)]
[analyzer] [tests] [quickfix] Make the test more resilient for a non-defaut std configuration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343715 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP] Add reverse_offload clause to requires directive
Patrick Lyster [Wed, 3 Oct 2018 20:07:58 +0000 (20:07 +0000)]
[OPENMP] Add reverse_offload clause to requires directive

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343711 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd template type and value parameter metadata nodes to template variable specializations
Matthew Voss [Wed, 3 Oct 2018 18:45:04 +0000 (18:45 +0000)]
Add template type and value parameter metadata nodes to template variable specializations

Summary: Add an optional attribute referring to a tuple of type and value template parameter nodes to the DIGlobalVariable node. This allows us to record the parameters of template variable specializations.

Reviewers: dblaikie, aprantl, probinson, JDevlieghere, clayborg, jingham

Reviewed By: JDevlieghere

Subscribers: cfe-commits

Tags: #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343707 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[test] Use --sysroot instead of -B in print-multi-directory.c
Martin Storsjo [Wed, 3 Oct 2018 18:24:05 +0000 (18:24 +0000)]
[test] Use --sysroot instead of -B in print-multi-directory.c

This avoids finding a similar matching GCC installation outside
of the test directory tree in the surrounding environment, which
would make the test fail. (This happened on Ubuntu 16.04.)

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343702 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[COFF, ARM64] Add _ReadWriteBarrier intrinsic
Mandeep Singh Grang [Wed, 3 Oct 2018 17:24:21 +0000 (17:24 +0000)]
[COFF, ARM64] Add _ReadWriteBarrier intrinsic

Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar

Reviewed By: rnk

Subscribers: kristof.beyls, chrib, jfb, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343699 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoThread safety analysis: Unwrap __builtin_expect in getTrylockCallExpr
Aaron Puchert [Wed, 3 Oct 2018 11:58:19 +0000 (11:58 +0000)]
Thread safety analysis: Unwrap __builtin_expect in getTrylockCallExpr

Summary:
When people are really sure they'll get the lock they sometimes use
__builtin_expect. It's also used by some assertion implementations.
Asserting that try-lock succeeded is basically the same as asserting
that the lock is not held by anyone else (and acquiring it).

Reviewers: aaron.ballman, delesley

Reviewed By: aaron.ballman

Subscribers: kristina, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343681 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAllow comments with '#' in dynamic AST Matchers
Stephen Kelly [Wed, 3 Oct 2018 07:56:43 +0000 (07:56 +0000)]
Allow comments with '#' in dynamic AST Matchers

Summary: This is necessary for clang-query to be able to handle comments.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343665 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Frontend] Delete -print-decl-contexts
Fangrui Song [Wed, 3 Oct 2018 03:50:44 +0000 (03:50 +0000)]
[Frontend] Delete -print-decl-contexts

Summary: Its job is covered by -ast-dump. The option is rarely used and lacks many AST nodes which will lead to llvm_unreachable() crash.

Reviewers: rsmith, arphaman

Reviewed By: rsmith

Subscribers: jfb, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343660 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoOpenCL: Mark printf format string argument
Matt Arsenault [Wed, 3 Oct 2018 02:01:19 +0000 (02:01 +0000)]
OpenCL: Mark printf format string argument

Fixes not warning on format string errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343653 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CMake][Fuchsia] Use libc++ ABIv2 for Fuchsia toolchain
Petr Hosek [Wed, 3 Oct 2018 01:27:00 +0000 (01:27 +0000)]
[CMake][Fuchsia] Use libc++ ABIv2 for Fuchsia toolchain

We don't need to provide stable ABI and hence we can use the v2.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343652 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] [tests] Hotfix: missing space
George Karpenkov [Tue, 2 Oct 2018 22:31:44 +0000 (22:31 +0000)]
[analyzer] [tests] Hotfix: missing space

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343643 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove spurious assertion in -Wdocumentation
Reid Kleckner [Tue, 2 Oct 2018 22:23:27 +0000 (22:23 +0000)]
Remove spurious assertion in -Wdocumentation

Some code in OpenCV uses interesting doxygen directives that make it so
we don't see any tokens inside a @note, despite there definitely being
non-whitespace characters there. The consistency check isn't needed.
ParagraphComment supports receiving an empty list of comments.

Fixes PR39007

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343641 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] [tests] Allow specifying entire -analyze-config on the command line, make...
George Karpenkov [Tue, 2 Oct 2018 21:19:23 +0000 (21:19 +0000)]
[analyzer] [tests] Allow specifying entire -analyze-config on the command line, make sure it's always propagated

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343636 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Fix crash in exploded graph dumping
George Karpenkov [Tue, 2 Oct 2018 21:19:01 +0000 (21:19 +0000)]
[analyzer] Fix crash in exploded graph dumping

By allocating new DeclStmt to ASTContext

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343635 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Promote StdCLibraryFunctionsChecker to the apiModeling category.
Artem Dergachev [Tue, 2 Oct 2018 20:50:40 +0000 (20:50 +0000)]
[analyzer] Promote StdCLibraryFunctionsChecker to the apiModeling category.

Because all our languages are C-based, there's no reason to
enable this checker only on UNIX targets.

Patch by DonĂ¡t Nagy!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343632 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Fix symbol discovery in nonloc::LocAsInteger values.
Artem Dergachev [Tue, 2 Oct 2018 20:48:12 +0000 (20:48 +0000)]
[analyzer] Fix symbol discovery in nonloc::LocAsInteger values.

Doesn't do much despite sounding quite bad, but fixes an exotic test case where
liveness of a nonloc::LocAsInteger array index is now evaluated correctly.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343631 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cl-compat] Change /JMC from unsupported to ignored.
Zachary Turner [Tue, 2 Oct 2018 20:42:36 +0000 (20:42 +0000)]
[cl-compat] Change /JMC from unsupported to ignored.

A tracking bug for actually implementing this in clang-cl is at
https://bugs.llvm.org/show_bug.cgi?id=39156.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343629 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer][NFC] Refactor functions in PlistDiagnostics to take AnalyzerOptions as...
Kristof Umann [Tue, 2 Oct 2018 19:27:34 +0000 (19:27 +0000)]
[analyzer][NFC] Refactor functions in PlistDiagnostics to take AnalyzerOptions as parameter

I intend to add a new flag macro-expnasions-as-events, and unfortunately
I'll only be able to convert the macro piece into an event one once I'm
about to emit it, due to the lack of an avaible Preprocessor object in
the BugReporter.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343620 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenMP][NVPTX] Simplify codegen for orphaned parallel, NFCI.
Jonas Hahnfeld [Tue, 2 Oct 2018 19:12:54 +0000 (19:12 +0000)]
[OpenMP][NVPTX] Simplify codegen for orphaned parallel, NFCI.

Worker threads fork off to the compiler generated worker function
directly after entering the kernel function. Hence, there is no
need to check whether the current thread is the master if we are
outside of a parallel region (neither SPMD nor parallel_level > 0).

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343618 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenMP] Simplify code for reductions on distribute directives, NFC.
Jonas Hahnfeld [Tue, 2 Oct 2018 19:12:47 +0000 (19:12 +0000)]
[OpenMP] Simplify code for reductions on distribute directives, NFC.

Only need to care about the 'distribute simd' case, all other composite
directives are handled elsewhere. This was already reflected in the
outer 'if' condition, so all other inner conditions could never be true.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343617 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[HIP] Support early finalization of device code for -fno-gpu-rdc
Yaxun Liu [Tue, 2 Oct 2018 17:48:54 +0000 (17:48 +0000)]
[HIP] Support early finalization of device code for -fno-gpu-rdc

This patch renames -f{no-}cuda-rdc to -f{no-}gpu-rdc and keeps the original
options as aliases. When -fgpu-rdc is off,
clang will assume the device code in each translation unit does not call
external functions except those in the device library, therefore it is possible
to compile the device code in each translation unit to self-contained kernels
and embed them in the host object, so that the host object behaves like
usual host object which can be linked by lld.

The benefits of this feature is: 1. allow users to create static libraries which
can be linked by host linker; 2. amortized device code linking time.

This patch modifies HIP action builder to insert actions for linking device
code and generating HIP fatbin, and pass HIP fatbin to host backend action.
It extracts code for constructing command for generating HIP fatbin as
a function so that it can be reused by early finalization. It also modifies
codegen of HIP host constructor functions to embed the device fatbin
when it is available.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343611 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoclang-format: better handle statement macros
Francois Ferrand [Tue, 2 Oct 2018 16:37:51 +0000 (16:37 +0000)]
clang-format: better handle statement macros

Summary:
Some macros are used in the body of function, and actually contain the trailing semicolon: they should thus be automatically followed by a new line, and not get merged with the next line. This is for example the case with Qt's Q_UNUSED macro:

  void foo(int a, int b) {
    Q_UNUSED(a)
    return b;
  }

This patch deals with these cases by introducing a new option to specify list of statement macros. This re-uses the system already in place for foreach macros, to ensure there is no impact on performance.

Reviewers: krasimir, djasper, klimek

Reviewed By: krasimir

Subscribers: acoomans, mgrang, alexfh, klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343602 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Preprocesssor] Filename should fall back to the written name when typo correction...
Haojian Wu [Tue, 2 Oct 2018 14:42:51 +0000 (14:42 +0000)]
[Preprocesssor] Filename should fall back to the written name when typo correction fails.

Summary:
The test is added in  Testcase is at https://reviews.llvm.org/D52775. I tried to add the test to clang's code
completion test, it doesn't reproduce the crash.

Reviewers: sammccall, kristina

Reviewed By: sammccall

Subscribers: kristina, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343592 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Preprocessor] Hide include typo correction behind SpellChecking.
Haojian Wu [Tue, 2 Oct 2018 13:59:49 +0000 (13:59 +0000)]
[Preprocessor] Hide include typo correction behind SpellChecking.

Summary:
Similar to Sema typo correction, the Preprocessor typo correction should
also be hidden behind the SpellChecking flag.

Reviewers: sammccall

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343591 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenCL] Add block argument CodeGen test
Sven van Haastregt [Tue, 2 Oct 2018 13:02:27 +0000 (13:02 +0000)]
[OpenCL] Add block argument CodeGen test

r326937 ("[OpenCL] Remove block invoke function from emitted block
literal struct", 2018-03-07) broke block argument handling.  In
particular the commit was causing a crash during code generation, see
the discussion in https://reviews.llvm.org/D43783 .

The offending commit has just been reverted; add a test to avoid
breaking this again in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343583 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r326937 "[OpenCL] Remove block invoke function from emitted block literal...
Sven van Haastregt [Tue, 2 Oct 2018 13:02:24 +0000 (13:02 +0000)]
Revert r326937 "[OpenCL] Remove block invoke function from emitted block literal struct"

This reverts r326937 as it broke block argument handling in OpenCL.
See the discussion on https://reviews.llvm.org/D43783 .

The next commit will add a test case that revealed the issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343582 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Improvements to the SMT API
Mikhail R. Gadelha [Tue, 2 Oct 2018 12:55:48 +0000 (12:55 +0000)]
[analyzer] Improvements to the SMT API

Summary:
Several improvements in preparation for the new backends.

Refactoring:

- Removed duplicated methods `fromBoolean`, `fromAPSInt`, `fromInt` and `fromAPFloat`. The methods `mkBoolean`, `mkBitvector` and `mkFloat` are now used instead.
- The names of the functions that convert BVs to FPs were swapped (`mkSBVtoFP`, `mkUBVtoFP`, `mkFPtoSBV`, `mkFPtoUBV`).
- Added a couple of comments in function calls.

Crosscheck encoding:

- Changed how constraints are encoded in the refutation manager so it doesn't start with (false OR ...). This change introduces one duplicated line (see file `BugReporterVisitors.cpp`, the `SMTConv::getRangeExpr is called twice, so I can remove this change if the duplication is a problem.

Reviewers: george.karpenkov, NoQ

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin, Szelethus

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343581 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AST] Pack the bit-fields of FunctionProtoType into Type.
Bruno Ricci [Tue, 2 Oct 2018 11:46:38 +0000 (11:46 +0000)]
[AST] Pack the bit-fields of FunctionProtoType into Type.

Move the bit-fields of FunctionProtoType into FunctionTypeBitfields.
This cuts the size of FunctionProtoType by a pointer. Additionally use
llvm::TrailingObjects instead of manually doing the casts + arithmetic.

This patch is bigger then what could be expected for the following reasons:

1. As discussed before in D50631 it would be nice if there was some space left
   in FunctionTypeBitfields for future additions. This patch introduces an
   extra structure FunctionTypeExtraBitfields which is supposed to hold
   uncommon bits and is stored in a trailing object. The number of exception
   types NumExceptions is moved to this struct. As of this patch this trailing
   struct will only be allocated if we have > 0 types in a dynamic exception
   specification.

2. TrailingObjects cannot handle repeated types. Therefore the QualType
   representing an exception type is wrapped in a struct ExceptionType.
   The ExceptionType * is then reinterpret_cast'd to QualType *.

3. TrailingObjects needs the definition of the various trailing classes.
   Therefore ExtParameterInfo, ExceptionType and FunctionTypeExtraBitfields
   are put in FunctionType.

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

Reviewed By: rjmccall

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343579 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeComplete] Re-fix accessibilty of protected members from base class.
Eric Liu [Tue, 2 Oct 2018 10:29:00 +0000 (10:29 +0000)]
[CodeComplete] Re-fix accessibilty of protected members from base class.

Summary:
The initial fix (r337453) had bug and was partially reverted (r338255).
This simplies the original fix by explicitly passing the naming class to the
completion consumer.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343575 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert untintentionally commited changes
Eric Liu [Tue, 2 Oct 2018 10:28:54 +0000 (10:28 +0000)]
Revert untintentionally commited changes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343574 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Lex] TokenConcatenation now takes const Preprocessor
Eric Liu [Tue, 2 Oct 2018 10:28:50 +0000 (10:28 +0000)]
[Lex] TokenConcatenation now takes const Preprocessor

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343573 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang] Implement Override Suggestions in Sema.
Kadir Cetinkaya [Tue, 2 Oct 2018 09:42:31 +0000 (09:42 +0000)]
[clang] Implement Override Suggestions in Sema.

Summary:
In clangd we had a new type of completion suggestions for cpp
class/struct/unions that will show override signatures for virtual methods in
base classes. This patch implements it in sema because it is hard to deduce more
info about completion token outside of Sema and handle itchy cases.

See the patch D50898 for more info on the functionality.

In addition to above patch this one also converts the suggestion into a
CK_Pattern with whole insertion text as the name of the suggestion and factors
out CodeCompletionString generation for declerations so that it can be re-used
by others.

Reviewers: ioeric, ilya-biryukov

Reviewed By: ioeric

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343568 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][v8.5A] Test clang option for the Memory Tagging Extension
Oliver Stannard [Tue, 2 Oct 2018 09:38:59 +0000 (09:38 +0000)]
[AArch64][v8.5A] Test clang option for the Memory Tagging Extension

The implementation of this is in TargetParser, so we only need to add a
test for it in clang.

Patch by Pablo Barrio!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343566 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdded warning for unary minus used with unsigned type
David Bolvansky [Tue, 2 Oct 2018 06:02:30 +0000 (06:02 +0000)]
Added warning for unary minus used with unsigned type

Summary:
Inspired by MSVC, which found some occurrences of this expression on our code base.

Fixes PR38950

Reviewers: rsmith, craig.topper, spatel, RKSimon, aaron.ballman, thakis

Reviewed By: rsmith

Subscribers: joerg, Quuxplusone, lebedev.ri, craig.topper, RKSimon, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343560 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeGen] Before entering the loop that copies a non-trivial array field
Akira Hatanaka [Tue, 2 Oct 2018 01:00:44 +0000 (01:00 +0000)]
[CodeGen] Before entering the loop that copies a non-trivial array field
of a non-trivial C struct, copy the preceding trivial fields that
haven't been copied.

This commit fixes a bug where the instructions used to copy the
preceding trivial fields were emitted inside the loop body.

rdar://problem/44185064

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343556 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDistinguish `__block` variables that are captured by escaping blocks
Akira Hatanaka [Mon, 1 Oct 2018 21:51:28 +0000 (21:51 +0000)]
Distinguish `__block` variables that are captured by escaping blocks
from those that aren't.

This patch changes the way __block variables that aren't captured by
escaping blocks are handled:

- Since non-escaping blocks on the stack never get copied to the heap
  (see https://reviews.llvm.org/D49303), Sema shouldn't error out when
  the type of a non-escaping __block variable doesn't have an accessible
  copy constructor.

- IRGen doesn't have to use the specialized byref structure (see
  https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a
  non-escaping __block variable anymore. Instead IRGen can emit the
  variable as a normal variable and copy the reference to the block
  literal. Byref copy/dispose helpers aren't needed either.

This reapplies r343518 after fixing a use-after-free bug in function
Sema::ActOnBlockStmtExpr where the BlockScopeInfo was dereferenced after
it was popped and deleted.

rdar://problem/39352313

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343542 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MinGW] Allow using ASan
Martin Storsjo [Mon, 1 Oct 2018 20:53:25 +0000 (20:53 +0000)]
[MinGW] Allow using ASan

Linking to ASan for MinGW is similar to MSVC, but MinGW always links
the MSVCRT dynamically, so there is only one of the MSVC cases to
consider.

When linking to a shared compiler runtime library on MinGW, the suffix
of the import library is .dll.a.

The existing case of .dll as suffix for windows in general doesn't
seem correct (since this is used for linking). As long as callers never
actually set the Shared flag, the default static suffix of .lib also
worked fine for import libraries as well.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343537 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r343518.
Akira Hatanaka [Mon, 1 Oct 2018 20:29:34 +0000 (20:29 +0000)]
Revert r343518.

Bots are still failing.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/24420
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/12958

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343531 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUpdate CMakeLists.txt snippet so that example compiles
Stephen Kelly [Mon, 1 Oct 2018 20:28:07 +0000 (20:28 +0000)]
Update CMakeLists.txt snippet so that example compiles

Summary: Previous to this the example didn't work out of the box, it seems some cmake config changed between when this was written and now.

Author: Dan Zimmerman <daniel.zimmerman@me.com>

Reviewers: modocache, steveire

Reviewed By: steveire

Subscribers: smeenai, steveire, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343530 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDistinguish `__block` variables that are captured by escaping blocks
Akira Hatanaka [Mon, 1 Oct 2018 18:50:14 +0000 (18:50 +0000)]
Distinguish `__block` variables that are captured by escaping blocks
from those that aren't.

This patch changes the way __block variables that aren't captured by
escaping blocks are handled:

- Since non-escaping blocks on the stack never get copied to the heap
  (see https://reviews.llvm.org/D49303), Sema shouldn't error out when
  the type of a non-escaping __block variable doesn't have an accessible
  copy constructor.

- IRGen doesn't have to use the specialized byref structure (see
  https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a
  non-escaping __block variable anymore. Instead IRGen can emit the
  variable as a normal variable and copy the reference to the block
  literal. Byref copy/dispose helpers aren't needed either.

This reapplies r341754, which was reverted in r341757 because it broke a
couple of bots. r341754 was calling markEscapingByrefs after the call to
PopFunctionScopeInfo, which caused the popped function scope to be
cleared out when the following code was compiled, for example:

$ cat test.m
struct A {
  id data[10];
};

void foo() {
  __block A v;
  ^{ (void)v; };
}

This commit calls markEscapingByrefs before calling PopFunctionScopeInfo
to prevent that from happening.

rdar://problem/39352313

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343518 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-format] Update comment, NFCI
Krasimir Georgiev [Mon, 1 Oct 2018 18:41:21 +0000 (18:41 +0000)]
[clang-format] Update comment, NFCI

The initializer of `ParameterCount` was updated from 1 to 0 in r175165,
but the comment was never touched:
https://github.com/llvm-mirror/clang/commit/9fc56f2636137fcde8acb38865555ed6c7b84dfd

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343517 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang-format] Fix typo in comment, NFCI
Krasimir Georgiev [Mon, 1 Oct 2018 18:18:00 +0000 (18:18 +0000)]
[clang-format] Fix typo in comment, NFCI

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343513 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer][NFC] Refactor functions in PlistDiagnostics to take Preproc as parameter
Kristof Umann [Mon, 1 Oct 2018 18:11:51 +0000 (18:11 +0000)]
[analyzer][NFC] Refactor functions in PlistDiagnostics to take Preproc as parameter

This is patch is a preparation for the proposed inclusion of macro expansions in the plist output.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343511 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP][NVPTX] Handle `requires datasharing` flag correctly with
Alexey Bataev [Mon, 1 Oct 2018 16:20:57 +0000 (16:20 +0000)]
[OPENMP][NVPTX] Handle `requires datasharing` flag correctly with
lightweight runtime.

The datasharing flag must be set to `1` when executing SPMD-mode compatible directive with reduction|lastprivate clauses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343492 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Basic] Update clang tests (really testing sys::fs) that broke with r343460
Sam McCall [Mon, 1 Oct 2018 16:07:03 +0000 (16:07 +0000)]
[Basic] Update clang tests (really testing sys::fs) that broke with r343460

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343488 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP] Simplify code, NFC.
Alexey Bataev [Mon, 1 Oct 2018 14:40:06 +0000 (14:40 +0000)]
[OPENMP] Simplify code, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343483 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Preprocessor] Fix a crash when handling non-alpha include header.
Haojian Wu [Mon, 1 Oct 2018 14:38:43 +0000 (14:38 +0000)]
[Preprocessor] Fix a crash when handling non-alpha include header.

Summary: the crash is casued by an assertion in StringRef.
(llvm::StringRef::front() const: Assertion `!empty()' failed.)

Reviewers: sammccall

Subscribers: jsji, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343481 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP] Fix enum identifier, NFC.
Alexey Bataev [Mon, 1 Oct 2018 14:26:31 +0000 (14:26 +0000)]
[OPENMP] Fix enum identifier, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343479 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd support for unified_shared_memory clause on requires directive
Patrick Lyster [Mon, 1 Oct 2018 13:47:43 +0000 (13:47 +0000)]
Add support for unified_shared_memory clause on requires directive

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343472 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoBuild clang-headers when building clang tools.
Haojian Wu [Mon, 1 Oct 2018 12:16:38 +0000 (12:16 +0000)]
Build clang-headers when building clang tools.

Summary:
clang tools require clang headers to work on real project, e.g. when we
build clangd via `ninja clangd`, we expect the binary can run on
real-world project (without running another command `ninja clang-headers`).

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgorny, ilya-biryukov, ioeric, kadircet, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343459 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeComplete] #include completion treats -I as non-system (require header-like exten...
Sam McCall [Mon, 1 Oct 2018 11:56:42 +0000 (11:56 +0000)]
[CodeComplete] #include completion treats -I as non-system (require header-like extension).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343457 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse the container form llvm::sort(C, ...)
Fangrui Song [Sun, 30 Sep 2018 21:41:11 +0000 (21:41 +0000)]
Use the container form llvm::sort(C, ...)

There are a few leftovers of rC343147 that are not (\w+)\.begin but in
the form of ([-[:alnum:]>.]+)\.begin or spanning two lines. Change them
to use the container form in this commit. The 12 occurrences have been
inspected manually for safety.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343425 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix linkage error on ProgramPoint's dump method.
Eric Fiselier [Sun, 30 Sep 2018 18:05:39 +0000 (18:05 +0000)]
Fix linkage error on ProgramPoint's dump method.

Currently, ProgramPoint::dump calls the out-of-line function ProgramPoint::print. This causes
libraries which include ProgramPoint.h to become dependent on libclangAnalysis, which in turn
causes missing symbol link error when building with -DBUILD_SHARED_LIBS=ON -DLLVM_ENABLE_MODULES=ON.

The breakage was introduced in r343160.

This patch fixes the issues by moving ProgramPoint::dump's declaration out of line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343420 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUpdate ifunc attribute support documentation
Ed Maste [Sun, 30 Sep 2018 15:08:18 +0000 (15:08 +0000)]
Update ifunc attribute support documentation

Previously we documented GNU binutils and glibc versions required for
ifunc support, but our own lld linker and FreeBSD's rtld also support
ifuncs.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343408 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add more of the icc unaligned load/store to/from 128 bit vector intrinsics
Craig Topper [Sat, 29 Sep 2018 17:49:42 +0000 (17:49 +0000)]
[X86] Add more of the icc unaligned load/store to/from 128 bit vector intrinsics

Summary:
This patch adds
_mm_loadu_si32
_mm_loadu_si16
_mm_storeu_si64
_mm_storeu_si32
_mm_storeu_si16

We already had _mm_load_si64.

Reviewers: spatel, RKSimon

Reviewed By: RKSimon

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343388 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAttempt to fix a -Wdocumentation-html warning. NFCI.
Simon Pilgrim [Sat, 29 Sep 2018 13:30:43 +0000 (13:30 +0000)]
Attempt to fix a -Wdocumentation-html warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343374 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang][www] Fix typo. NFC
Kristina Brooks [Sat, 29 Sep 2018 09:45:21 +0000 (09:45 +0000)]
[clang][www] Fix typo. NFC

Fix a one letter typo in diagnostics.html. (Wanted to try it with
arcanist).

Patch by king6cong

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343372 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cxx2a] Fix warning triggered by r343285
Vitaly Buka [Sat, 29 Sep 2018 02:17:12 +0000 (02:17 +0000)]
[cxx2a] Fix warning triggered by r343285

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343369 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSupport enums with a fixed underlying type in all language modes.
Erik Pilkington [Fri, 28 Sep 2018 20:24:58 +0000 (20:24 +0000)]
Support enums with a fixed underlying type in all language modes.

Previously we supported these in C++, ObjC, and C with -fms-extensions.

rdar://43831380

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343360 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OPENMP]Fix PR39084: Check datasharing attributes of reduction variables only.
Alexey Bataev [Fri, 28 Sep 2018 19:33:14 +0000 (19:33 +0000)]
[OPENMP]Fix PR39084: Check datasharing attributes of reduction variables only.

According to OpenMP, the reduction item must be shared in parent region.
But the item can be an array section or array subscript. In this case,
we should not check for the datasharing of the base declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343356 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] [NFC] Remove unused parameters, as found by -Wunused-parameter
George Karpenkov [Fri, 28 Sep 2018 18:49:41 +0000 (18:49 +0000)]
[analyzer] [NFC] Remove unused parameters, as found by -Wunused-parameter

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343353 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Provide an option to dump generated exploded graphs to a given file.
George Karpenkov [Fri, 28 Sep 2018 18:49:21 +0000 (18:49 +0000)]
[analyzer] Provide an option to dump generated exploded graphs to a given file.

Dumping graphs instead of opening them is often very useful,
e.g. for transfer or converting to SVG.

Basic sanity check for generated exploded graphs.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343352 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cxx2a] P0614R1: Support init-statements in range-based for loops.
Richard Smith [Fri, 28 Sep 2018 18:44:09 +0000 (18:44 +0000)]
[cxx2a] P0614R1: Support init-statements in range-based for loops.

We don't yet support this for the case where a range-based for loop is
implicitly rewritten to an ObjC for..in statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343350 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add the movbe instruction intrinsics from icc.
Craig Topper [Fri, 28 Sep 2018 17:09:51 +0000 (17:09 +0000)]
[X86] Add the movbe instruction intrinsics from icc.

These intrinsics exist in icc. They can be found on the Intel Intrinsics Guide website.

All the backend support is in place to pattern match a load+bswap or a bswap+store pattern to the MOVBE instructions. So we just need to get the frontend to emit the correct IR. The pointer arguments in icc are declared as void so I had to jump through a packed struct to forcing a specific alignment on the load/store. Same trick we use in the unaligned vector load/store intrinsics

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343343 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAST: add missing ObjC extensions to MS style name decoration
Saleem Abdulrasool [Fri, 28 Sep 2018 16:47:53 +0000 (16:47 +0000)]
AST: add missing ObjC extensions to MS style name decoration

Add support for encoding type arguments for lightweight generics in
Objective-C++ mode.  Additionally, add support for the `__kindof` modifier.
This should complete the coverage of the ObjC extensions that clang currently
supports under the MS style name decoration scheme.

This is implemented similar to the Objective-C lifetime qualifiers decoration:
a template specialization in the `__ObjC` namespace so that we can interoperate
with Microsoft's tools as well as ensure that we do not accidentally collide
with new features in the Microsoft implementation.

Since the `__kindof` appertains to the type and not the pointer, we apply the
template specialization to the underlying type instead of the pointer type.

Unfortunately, until D52581 is resolved, the generated name is not really
compatible with the MS tools as well as breaks interoperability with
Objective-C++ and C++.

This resolves PR37754!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343338 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.
Alexey Bataev [Fri, 28 Sep 2018 16:17:59 +0000 (16:17 +0000)]
[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.

clang-offload-bundler should not be invoked with the unbundling action
when the input file type does not match the action type. For example,
.so files should be unbundled during linking phase and should be linked
only with the host code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343335 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Prevent DSP and SIM32 being set for v6m
Sam Parker [Fri, 28 Sep 2018 10:18:02 +0000 (10:18 +0000)]
[ARM] Prevent DSP and SIM32 being set for v6m

My previous change (rL340911) set the two features for architectures
>= 6, which wrongly includes v6m. Now set to >= 6 and not Cortex-M.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343309 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ClangFormat] 'try' of function-try-block doesn't obey BraceWrapping
Owen Pan [Fri, 28 Sep 2018 09:17:00 +0000 (09:17 +0000)]
[ClangFormat] 'try' of function-try-block doesn't obey BraceWrapping

It should respond to AfterFunction, not AfterControlStatement.

Fixes PR39067

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343305 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Alter test to account for change to armv6k default CPU
Peter Smith [Fri, 28 Sep 2018 09:04:31 +0000 (09:04 +0000)]
[ARM] Alter test to account for change to armv6k default CPU

Review D52594 will change the default in llvm for armv6k from the
non-existent cpu arm1176jf-s to mpcore. The tests in arm-cortex-cpus.c
need to be updated to account for this change.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343304 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoHandle dependent class template names in class template argument
Richard Smith [Fri, 28 Sep 2018 03:18:53 +0000 (03:18 +0000)]
Handle dependent class template names in class template argument
deduction for new-expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343293 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cxx2a] P0641R2: (Some) type mismatches on defaulted functions only
Richard Smith [Fri, 28 Sep 2018 01:16:43 +0000 (01:16 +0000)]
[cxx2a] P0641R2: (Some) type mismatches on defaulted functions only
render the function deleted instead of rendering the program ill-formed.

This change also adds an enabled-by-default warning for the case where
an explicitly-defaulted special member function of a non-template class
is implicitly deleted by the type checking rules. (This fires either due
to this language change or due to pre-C++20 reasons for the member being
implicitly deleted). I've tested this on a large codebase and found only
bugs (where the program means something that's clearly different from
what the programmer intended), so this is enabled by default, but we
should revisit this if there are problems with this being enabled by
default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343285 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[cxx2a] P0624R2: Lambdas with no capture-default are
Richard Smith [Thu, 27 Sep 2018 22:47:04 +0000 (22:47 +0000)]
[cxx2a] P0624R2: Lambdas with no capture-default are
default-constructible and assignable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343279 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Hotfix for the bug in exploded graph printing
George Karpenkov [Thu, 27 Sep 2018 22:31:13 +0000 (22:31 +0000)]
[analyzer] Hotfix for the bug in exploded graph printing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343276 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoNFC: Fix some darwin linker warnings introduced in r338385
Erik Pilkington [Thu, 27 Sep 2018 20:36:28 +0000 (20:36 +0000)]
NFC: Fix some darwin linker warnings introduced in r338385

The darwin linker was complaining about Toolchains/RISCV.cpp and
Toolchains/Arch/RISCV.cpp had the same name. Fix is to just rename
Toolchains/RISCV.cpp to Toolchains/RISCVToolchain.cpp.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343263 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenMP] Make default parallel for schedule in NVPTX target regions in SPMD mode...
Gheorghe-Teodor Bercea [Thu, 27 Sep 2018 20:29:00 +0000 (20:29 +0000)]
[OpenMP] Make default parallel for schedule in NVPTX target regions in SPMD mode achieve coalescing

Summary: Set default schedule for parallel for loops to schedule(static, 1) when using SPMD mode on the NVPTX device offloading toolchain to ensure coalescing.

Reviewers: ABataev, Hahnfeld, caomhin

Reviewed By: ABataev

Subscribers: jholewinski, guansong, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343260 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTest commit. NFC
Patrick Lyster [Thu, 27 Sep 2018 19:30:32 +0000 (19:30 +0000)]
Test commit. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343258 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenMP] Make default distribute schedule for NVPTX target regions in SPMD mode achie...
Gheorghe-Teodor Bercea [Thu, 27 Sep 2018 19:22:56 +0000 (19:22 +0000)]
[OpenMP] Make default distribute schedule for NVPTX target regions in SPMD mode achieve coalescing

Summary: For the OpenMP NVPTX toolchain choose a default distribute schedule that ensures coalescing on the GPU when in SPMD mode. This significantly increases the performance of offloaded target code and reduces the number of registers used on the GPU side.

Reviewers: ABataev, caomhin, Hahnfeld

Reviewed By: ABataev, Hahnfeld

Subscribers: Hahnfeld, jholewinski, guansong, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343253 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[clang][ubsan][NFC] Slight test cleanup in preparation for D50901
Roman Lebedev [Thu, 27 Sep 2018 19:07:48 +0000 (19:07 +0000)]
[clang][ubsan][NFC] Slight test cleanup in preparation for D50901

Reviewers: vsk, vitalybuka, filcab

Reviewed By: vitalybuka

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343251 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix greedy FileCheck expression in test/Driver/mips-abi.c
Jonas Hahnfeld [Thu, 27 Sep 2018 17:27:48 +0000 (17:27 +0000)]
Fix greedy FileCheck expression in test/Driver/mips-abi.c

'ld{{.*}}"' seems to match the complete line for me which is failing
the test. Only allow an optional '.exe' for Windows systems as most
other tests do.
Another possibility would be to collapse the greedy expression with
the next check to avoid matching the full line.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343240 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] Highlight nodes which have error reports in them in red in exploded graph
George Karpenkov [Thu, 27 Sep 2018 17:26:41 +0000 (17:26 +0000)]
[analyzer] Highlight nodes which have error reports in them in red in exploded graph

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343239 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenMP] Improve search for libomptarget-nvptx
Jonas Hahnfeld [Thu, 27 Sep 2018 16:12:32 +0000 (16:12 +0000)]
[OpenMP] Improve search for libomptarget-nvptx

When looking for the bclib Clang considered the default library
path first while it preferred directories in LIBRARY_PATH when
constructing the invocation of nvlink. The latter actually makes
more sense because during development it allows using a non-default
runtime library. So change the search for the bclib to start
looking in directories given by LIBRARY_PATH.
Additionally add a new option --libomptarget-nvptx-path= which
will be searched first. This will be handy for testing purposes.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343230 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tooling] Get rid of uses of llvm::Twine::str which is slow. NFC
Eric Liu [Thu, 27 Sep 2018 14:50:24 +0000 (14:50 +0000)]
[Tooling] Get rid of uses of llvm::Twine::str which is slow. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343224 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][v8.5A] Test optional Armv8.5-A random number extension
Oliver Stannard [Thu, 27 Sep 2018 14:20:59 +0000 (14:20 +0000)]
[AArch64][v8.5A] Test optional Armv8.5-A random number extension

The implementation of this is in TargetParser, so we only need to add a
test for it in clang.

Patch by Pablo Barrio!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343220 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[OpenCL] Improve extension-version.cl and to_addr_builtin.cl tests
Sven van Haastregt [Thu, 27 Sep 2018 13:20:29 +0000 (13:20 +0000)]
[OpenCL] Improve extension-version.cl and to_addr_builtin.cl tests

Add cl_khr_depth_images to extension-version.cl.

Extend to_addr_builtin.cl to additionally test the built-in methods
to_private and to_local, and test assignment with to_global to
incorrect types.

Patch by Alistair Davies.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343207 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert untintentionally commited changes
Kristof Umann [Thu, 27 Sep 2018 12:46:37 +0000 (12:46 +0000)]
Revert untintentionally commited changes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343205 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Lex] TokenConcatenation now takes const Preprocessor
Kristof Umann [Thu, 27 Sep 2018 12:40:16 +0000 (12:40 +0000)]
[Lex] TokenConcatenation now takes const Preprocessor

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343204 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Sema] Handle __va_start for Windows/ARM64 in the same way as for ARM
Martin Storsjo [Thu, 27 Sep 2018 08:24:15 +0000 (08:24 +0000)]
[Sema] Handle __va_start for Windows/ARM64 in the same way as for ARM

This fixes PR39090.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343184 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[DebugInfo] Generate debug information for labels."
Vitaly Buka [Thu, 27 Sep 2018 08:15:24 +0000 (08:15 +0000)]
Revert "[DebugInfo] Generate debug information for labels."

This reverts commit r343148.

It crashes on sanitizer-x86_64-linux-autoconf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343183 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoclang-format: [JS] conditional types.
Martin Probst [Thu, 27 Sep 2018 06:48:13 +0000 (06:48 +0000)]
clang-format: [JS] conditional types.

Summary:
This change adds some rudimentary support for conditional types.
Specifically it avoids breaking before `extends` and `infer` keywords,
which are subject to Automatic Semicolon Insertion, so breaking before
them creates incorrect syntax.

The actual formatting of the type expression is odd, but there is as of
yet no clear idea on how to format these.

See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#conditional-types.

Reviewers: krasimir

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343179 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[driver][mips] Adjust target triple accordingly to provided ABI name
Simon Atanasyan [Thu, 27 Sep 2018 05:04:50 +0000 (05:04 +0000)]
[driver][mips] Adjust target triple accordingly to provided ABI name

Explicitly selected MIPS ABI using the `-mabi` option implies
corresponding target triple. For 'O32' ABI it's a 32-bit target triple
like `mips-linux-gnu`. For 'N32' and 'N64' ABIs it's a 64-bit target
triple like `mips64-linux-gnu`. This patch adjusts target triple
accordingly these rules like we do for pseudo-target flags '-m64',
'-m32' etc already.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343169 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] [NFC] Move the code for dumping the program point to ProgramPoint
George Karpenkov [Thu, 27 Sep 2018 01:46:18 +0000 (01:46 +0000)]
[analyzer] [NFC] Move the code for dumping the program point to ProgramPoint

So we can dump them outside of viewing the exploded grpah.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343160 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] [NFC] Heavy refactoring of trackNullOrUndefValue
George Karpenkov [Thu, 27 Sep 2018 01:45:57 +0000 (01:45 +0000)]
[analyzer] [NFC] Heavy refactoring of trackNullOrUndefValue

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343159 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[analyzer] [testing] Pass through an extra argument for specifying extra analyzer...
George Karpenkov [Thu, 27 Sep 2018 01:10:59 +0000 (01:10 +0000)]
[analyzer] [testing] Pass through an extra argument for specifying extra analyzer options

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343158 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove trailing space in rC343150
Fangrui Song [Wed, 26 Sep 2018 23:47:00 +0000 (23:47 +0000)]
Remove trailing space in rC343150

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343152 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoInit LookupResult::AmbiguityKind
Vitaly Buka [Wed, 26 Sep 2018 22:58:53 +0000 (22:58 +0000)]
Init LookupResult::AmbiguityKind

We don't expect useful value there unless it's "ambiguous".
However we use read it for copying and moving, so we need either init the field
add login to avoid reading invalid values. Such reads trigger ubsan errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343150 91177308-0d34-0410-b5e6-96231b3b80d8