]> granicus.if.org Git - clang/log
clang
6 years ago[CMake] Use PRIVATE in target_link_libraries for fuzzers.
Matt Morehouse [Wed, 6 Dec 2017 19:52:40 +0000 (19:52 +0000)]
[CMake] Use PRIVATE in target_link_libraries for fuzzers.

Several fuzzers were missed by r319840.

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

6 years agoDelete special-case "out-of-range" handling for bools, and just use the normal
Richard Smith [Wed, 6 Dec 2017 19:23:19 +0000 (19:23 +0000)]
Delete special-case "out-of-range" handling for bools, and just use the normal
codepath plus the new "minimum / maximum value of type" diagnostic to get the
same effect.

Move the warning for an in-range but tautological comparison of a constant (0
or 1) against a bool out of -Wtautological-constant-out-of-range-compare into
the more-appropriate -Wtautological-constant-compare.

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

6 years agoFix PR35542: Correct adjusting of private reduction variable
Jonas Hahnfeld [Wed, 6 Dec 2017 19:15:28 +0000 (19:15 +0000)]
Fix PR35542: Correct adjusting of private reduction variable

The adjustment is calculated with CreatePtrDiff() which returns
the difference in (base) elements. This is passed to CreateGEP()
so make sure that the GEP base has the correct pointer type:
It needs to be a pointer to the base type, not a pointer to a
constant sized array.

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

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

6 years ago[NVPTX,CUDA] Added llvm.nvvm.fns intrinsic and matching __nvvm_fns builtin in clang.
Artem Belevich [Wed, 6 Dec 2017 17:50:05 +0000 (17:50 +0000)]
[NVPTX,CUDA] Added llvm.nvvm.fns intrinsic and matching __nvvm_fns builtin in clang.

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

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

6 years ago[CUDA] Added overloads for '[unsigned] long' variants of shfl builtins.
Artem Belevich [Wed, 6 Dec 2017 17:40:35 +0000 (17:40 +0000)]
[CUDA] Added overloads for '[unsigned] long' variants of shfl builtins.

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

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

6 years agoStringizing raw string literals containing newline
Taewook Oh [Wed, 6 Dec 2017 17:00:53 +0000 (17:00 +0000)]
Stringizing raw string literals containing newline

Summary: This patch implements 4.3 of http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4220.pdf. If a raw string contains a newline character, replace each newline character with the \n escape code. Without this patch, included test case (macro_raw_string.cpp) results compilation failure.

Reviewers: rsmith, doug.gregor, jkorous-apple

Reviewed By: jkorous-apple

Subscribers: jkorous-apple, vsapsai, cfe-commits

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

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

6 years ago[OPENMP] Improve error message for mapping union members.
Alexey Bataev [Wed, 6 Dec 2017 15:04:36 +0000 (15:04 +0000)]
[OPENMP] Improve error message for mapping union members.

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

6 years ago[OPENMP] Initial codegen for `teams distribute simd` directive.
Alexey Bataev [Wed, 6 Dec 2017 14:31:09 +0000 (14:31 +0000)]
[OPENMP] Initial codegen for `teams distribute simd` directive.

Host + default devices codegen for `teams distribute simd` directive.

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

6 years ago[OpenCL] Fix layering violation by getOpenCLTypeAddrSpace
Sven van Haastregt [Wed, 6 Dec 2017 10:11:28 +0000 (10:11 +0000)]
[OpenCL] Fix layering violation by getOpenCLTypeAddrSpace

Commit 7ac28eb0a5 / r310911 ("[OpenCL] Allow targets to select address
space per type", 2017-08-15) made Basic depend on AST, introducing a
circular dependency.  Break this dependency by adding the
OpenCLTypeKind enum in Basic and map from AST types to this enum in
ASTContext.

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

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

6 years ago[libclang] Add function to get the buffer for a file
Erik Verbruggen [Wed, 6 Dec 2017 09:02:52 +0000 (09:02 +0000)]
[libclang] Add function to get the buffer for a file

This can be used by clients in conjunction with an offset returned by
e.g. clang_getFileLocation. Now those clients do not need to also
open/read the file.

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

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

6 years agoFix a bunch of wrong "tautological unsigned enum compare" diagnostics in C++.
Richard Smith [Wed, 6 Dec 2017 03:00:51 +0000 (03:00 +0000)]
Fix a bunch of wrong "tautological unsigned enum compare" diagnostics in C++.

An enumeration with a fixed underlying type can have any value in its
underlying type, not just those spanned by the values of its enumerators.

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

6 years agoP0722R2: The first parameter in an implicit call to a destroying operator
Richard Smith [Tue, 5 Dec 2017 23:54:25 +0000 (23:54 +0000)]
P0722R2: The first parameter in an implicit call to a destroying operator
delete should be a cv-unqualified pointer to the deleted object.

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

6 years agoFix another record-parsing-invocation.c test issue on Windows
Douglas Yung [Tue, 5 Dec 2017 23:04:12 +0000 (23:04 +0000)]
Fix another record-parsing-invocation.c test issue on Windows

Lit's env should be used before not. (Another case missed by the previous commit)

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

6 years ago[CMake] Use PRIVATE in target_link_libraries for executables
Shoaib Meenai [Tue, 5 Dec 2017 21:49:56 +0000 (21:49 +0000)]
[CMake] Use PRIVATE in target_link_libraries for executables

We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.

Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.

Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).

Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.

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

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

6 years agoFix one more record-parsing-invocation.c test issue on Windows
Alex Lorenz [Tue, 5 Dec 2017 21:33:05 +0000 (21:33 +0000)]
Fix one more record-parsing-invocation.c test issue on Windows

Lit's env should be used before not.

Sean Eveson pointed out the right solution. Thanks!

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

6 years agoUse an even more precise triple to avoid errors on Darwin, where we don't use comdats...
Richard Smith [Tue, 5 Dec 2017 21:29:36 +0000 (21:29 +0000)]
Use an even more precise triple to avoid errors on Darwin, where we don't use comdats for inline entities.

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

6 years ago[analyzer] do not crash on cases where an array subscript is an rvalue
George Karpenkov [Tue, 5 Dec 2017 21:19:59 +0000 (21:19 +0000)]
[analyzer] do not crash on cases where an array subscript is an rvalue

Array subscript is almost always an lvalue, except for a few cases where
it is not, such as a subscript into an Objective-C property, or a
return from the function.
This commit prevents crashing in such cases.

Fixes rdar://34829842

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

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

6 years agoGive this test a triple to avoid failures on MS bots.
Richard Smith [Tue, 5 Dec 2017 19:39:37 +0000 (19:39 +0000)]
Give this test a triple to avoid failures on MS bots.

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

6 years ago[OPENMP] Fix implicit mapping analysis.
Alexey Bataev [Tue, 5 Dec 2017 19:20:09 +0000 (19:20 +0000)]
[OPENMP] Fix implicit mapping analysis.

Fixed processing of implicitly mapped objects in target-based executable
directives.

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

6 years ago[WebAssembly] Don't use Wasm function sections for more than one function
Dan Gohman [Tue, 5 Dec 2017 17:46:17 +0000 (17:46 +0000)]
[WebAssembly] Don't use Wasm function sections for more than one function

Patch by Nicholas Wilson!

Fixes PR35467.

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

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

6 years ago[OPENMP] Remove non-required parameters for distribute simd outlined
Alexey Bataev [Tue, 5 Dec 2017 17:41:34 +0000 (17:41 +0000)]
[OPENMP] Remove non-required parameters for distribute simd outlined
region, NFC.

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

6 years ago[analyzer] Mark heap-based symbolic regions in debug dumps.
Artem Dergachev [Tue, 5 Dec 2017 17:14:39 +0000 (17:14 +0000)]
[analyzer] Mark heap-based symbolic regions in debug dumps.

They are now printed as HeapSymRegion{$x} in order to discriminate between that
and regular SymRegion{$x}, which are two different regions, having different
parent reginos (memory spaces) - HeapSpaceRegion and UnknownSpaceRegion
respectively.

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

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

6 years ago[x86][AVX512] Lowering kunpack intrinsics to LLVM IR
Jina Nahias [Tue, 5 Dec 2017 15:42:47 +0000 (15:42 +0000)]
[x86][AVX512] Lowering kunpack intrinsics to LLVM IR

This patch, together with a matching llvm patch (https://reviews.llvm.org/D39720), implements the lowering of X86 kunpack intrinsics to IR.

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

Change-Id: Id5d3cb394ad33b98be79a6783d1d15569e2b798d

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

6 years ago[OPENMP] Fix assert fail after target implicit map checks.
Alexey Bataev [Tue, 5 Dec 2017 15:22:49 +0000 (15:22 +0000)]
[OPENMP] Fix assert fail after target implicit map checks.

If the error is generated during analysis of implicitly or explicitly
mapped variables, it may cause compiler crash because of incorrect
analysis.

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

6 years ago[clang-format] Releasenotes for rL319024 : Add option to group multiple #include...
Sylvestre Ledru [Tue, 5 Dec 2017 09:23:47 +0000 (09:23 +0000)]
[clang-format] Releasenotes for rL319024 : Add option to group multiple #include blocks when sorting includes

Summary:
This change adds missing releasenotes for commit rL319024
https://reviews.llvm.org/rL319024

Patch by Krzysztof Kapusta

Reviewers: sylvestre.ledru

Reviewed By: sylvestre.ledru

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

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

6 years agoAdd __WINT_MAX__.
Ed Schouten [Tue, 5 Dec 2017 09:13:18 +0000 (09:13 +0000)]
Add __WINT_MAX__.

This definition is similar to __WCHAR_MAX__, except that it applies to
wint_t. It's also documented as being supported by GCC 4.5 and later.

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

6 years agoAMDGPU: Don't add fp64 feature to r600 subtargets
Matt Arsenault [Tue, 5 Dec 2017 03:51:26 +0000 (03:51 +0000)]
AMDGPU: Don't add fp64 feature to r600 subtargets

Should fix test after r319709

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

6 years ago[libclang] Store unsaved file hashes when recording parsing invocations
Alex Lorenz [Tue, 5 Dec 2017 02:30:43 +0000 (02:30 +0000)]
[libclang] Store unsaved file hashes when recording parsing invocations

Storing the contents of unsaved files is too expensive.
Instead a hash is stored with a record invocation. When a reproducer is
generated, Clang will compare the stored hashes to the new hashes to determine
if the contents of a file has changed. This way we'll know when a reproducer was
generated for a different source to the one that triggered the original crash.

rdar://35322543

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

6 years agoGeneralize "static data member instantiated" notification to cover variable templates...
Richard Smith [Tue, 5 Dec 2017 01:31:47 +0000 (01:31 +0000)]
Generalize "static data member instantiated" notification to cover variable templates too.

While here, split the "point of instantiation changed" notification out from
it; these two really are orthogonal changes.

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

6 years ago[CMake] Don't use comma as an alternate separator
Petr Hosek [Tue, 5 Dec 2017 00:15:20 +0000 (00:15 +0000)]
[CMake] Don't use comma as an alternate separator

Using comma can break in cases when we're passing flags that already
use comma as a separator.

Fixes PR35504.

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

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

6 years ago[Lex] Fix lldb-x86_64-ubuntu-14.04-buildserver build bot broken with r319714 (NFC).
Eugene Zelenko [Mon, 4 Dec 2017 23:38:10 +0000 (23:38 +0000)]
[Lex] Fix lldb-x86_64-ubuntu-14.04-buildserver build bot broken with r319714 (NFC).

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

6 years agoFix record-parsing-invocation.c test on Windows
Alex Lorenz [Mon, 4 Dec 2017 23:21:07 +0000 (23:21 +0000)]
Fix record-parsing-invocation.c test on Windows

We should not check for the forward slash '/'

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

6 years ago[Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Mon, 4 Dec 2017 23:16:21 +0000 (23:16 +0000)]
[Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoCorrectly handle line table entries without filenames during AST serialization
Hans Wennborg [Mon, 4 Dec 2017 22:28:45 +0000 (22:28 +0000)]
Correctly handle line table entries without filenames during AST serialization

The current code would hit an assert in ASTWriter when trying to write
out the filename for a line table entry that didn't have any. Fix this
by allowing the -1 sentinel value to round-trip through serialization.

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

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

6 years agoAdd _Float128 as alias to __float128 to enable compilations on Fedora27/glibc2-26
Erich Keane [Mon, 4 Dec 2017 21:58:43 +0000 (21:58 +0000)]
Add _Float128 as alias to __float128 to enable compilations on Fedora27/glibc2-26

Fedora27 is using a new version of glibc that refers to the _Float128 type. This
patch adds that name as an alias to float128. I also added some predefined macro
values for the digits, mantissa, epilon, etc (FloatMacros). For the test case, I
copied an existing float128 test. This functionality needs work long term, but
it should be sufficient to tread water for a while. At Intel we have test
servers running our LLVM compiler with various open source workloads, the server
has been upgraded to Fedora27 so many workloads are failing due to _Float128.

Patch-By: mibintc
Differential Revision: https://reviews.llvm.org/D40673

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

6 years ago[libclang] Record parsing invocation to a temporary file when requested
Alex Lorenz [Mon, 4 Dec 2017 21:56:36 +0000 (21:56 +0000)]
[libclang] Record parsing invocation to a temporary file when requested
by client

This patch extends libclang by allowing it to record parsing operations to a
temporary JSON file. The file is deleted after parsing succeeds. When a crash
happens during parsing, the file is preserved and the client will be able to use
it to generate a reproducer for the crash.

These files are not emitted by default, and the client has to specify the
invocation emission path first.

rdar://35322543

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

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

6 years ago[OPENMP] Fix PR35486: crash when collapsing loops with dependent iteration spaces.
Alexey Bataev [Mon, 4 Dec 2017 21:30:42 +0000 (21:30 +0000)]
[OPENMP] Fix PR35486: crash when collapsing loops with dependent iteration spaces.

Though it is incorrect from point of view of OpenMP standard to have
dependent iteration space in OpenMP loops, compiler should not crash.
Patch fixes this problem.

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

6 years ago[analyzer] [NFC] remove duplicated function
George Karpenkov [Mon, 4 Dec 2017 21:00:05 +0000 (21:00 +0000)]
[analyzer] [NFC] remove duplicated function

Two copies of getSymLERange in RangeConstraintManager are virtually
identical, which is clearly bad.
This patch uses lambdas to call one from another (assuming that we would
like to avoid getting ranges from the state when necessary).

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

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

6 years ago[OpenMP] Initial implementation of code generation for pragma 'teams distribute paral...
Carlo Bertolli [Mon, 4 Dec 2017 20:57:19 +0000 (20:57 +0000)]
[OpenMP] Initial implementation of code generation for pragma 'teams distribute parallel for simd' on host

https://reviews.llvm.org/D40795

This includes regression tests for all associated clauses.

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

6 years agoNow that C++17 is official (https://www.iso.org/standard/68564.html), start changing...
Aaron Ballman [Mon, 4 Dec 2017 20:27:34 +0000 (20:27 +0000)]
Now that C++17 is official (https://www.iso.org/standard/68564.html), start changing the C++1z terminology over to C++17. NFC intended, these are all mechanical changes.

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

6 years agodesign document for a hardware-assisted memory safety (HWAMS) tool, similar to Addres...
Kostya Serebryany [Mon, 4 Dec 2017 20:01:38 +0000 (20:01 +0000)]
design document for a hardware-assisted memory safety (HWAMS) tool, similar to AddressSanitizer

Summary:
preliminary design document for a hardware-assisted memory safety (HWAMS) tool, similar to AddressSanitizer
The name TaggedAddressSanitizer and the rest of the document, are early draft, suggestions are welcome.

The code will follow shortly.

Reviewers: eugenis, alekseyshl

Reviewed By: eugenis

Subscribers: davidxl, cryptoad, fedor.sergeev, cfe-commits, llvm-commits

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

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

6 years agoChanging mixed CRLFs back to LFs; NFC.
Aaron Ballman [Mon, 4 Dec 2017 18:36:34 +0000 (18:36 +0000)]
Changing mixed CRLFs back to LFs; NFC.

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

6 years ago[OPENMP] Codegen for `distribute simd` directive.
Alexey Bataev [Mon, 4 Dec 2017 15:38:33 +0000 (15:38 +0000)]
[OPENMP] Codegen for `distribute simd` directive.

Initial codegen support for `distribute simd` directive.

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

6 years ago[OpenCL] Define __IMAGE_SUPPORT__ macro for SPIR
Sven van Haastregt [Mon, 4 Dec 2017 15:01:08 +0000 (15:01 +0000)]
[OpenCL] Define __IMAGE_SUPPORT__ macro for SPIR

Add #define __IMAGE_SUPPORT__ 1 for SPIR targets to indicate that SPIR
supports images.

Patch by Dmitry Borisenkov.

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

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

6 years agoFix bug where we wouldn't break columns over the limit.
Manuel Klimek [Mon, 4 Dec 2017 08:53:16 +0000 (08:53 +0000)]
Fix bug where we wouldn't break columns over the limit.

Before, we would not break:
  int a = foo(/* trailing */);
when the end of /* trailing */ was exactly the column limit; the reason
is that block comments can have an unbreakable tail length - in this case
2, for the trailing ");"; we would unconditionally account that when
calculating the column state at the end of the token, but not correctly
add it into the remaining column length before, as we do for string
literals.
The fix is to correctly account the trailing unbreakable sequence length
into our formatting decisions for block comments. Line comments cannot
have a trailing unbreakable sequence, so no change is needed for them.

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

6 years ago[analyzer] Don't treat lambda-captures float constexprs as undefined
Devin Coughlin [Mon, 4 Dec 2017 04:46:47 +0000 (04:46 +0000)]
[analyzer] Don't treat lambda-captures float constexprs as undefined

RegionStore has special logic to evaluate captured constexpr variables.
However, if the constexpr initializer cannot be evaluated as an integer, the
value is treated as undefined. This leads to false positives when, for example,
a constexpr float is captured by a lambda.

To fix this, treat a constexpr capture that cannot be evaluated as unknown
rather than undefined.

rdar://problem/35784662

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

6 years ago[ASTImporter] Add unit tests for UsingDecl and UsingShadowDecl
Aleksei Sidorin [Sun, 3 Dec 2017 16:04:07 +0000 (16:04 +0000)]
[ASTImporter] Add unit tests for UsingDecl and UsingShadowDecl

Patch by Kareem Khazem!

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

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

6 years agoRevert "[CodeGen] Add initial support for union members in TBAA"
Hal Finkel [Sun, 3 Dec 2017 03:10:13 +0000 (03:10 +0000)]
Revert "[CodeGen] Add initial support for union members in TBAA"

This reverts commit r319413. See PR35503.

We can't use "union member" as the access type here like this.

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

6 years ago[WebAssembly] Pass through --undefined to Wasm LLD
Sam Clegg [Sat, 2 Dec 2017 23:11:13 +0000 (23:11 +0000)]
[WebAssembly] Pass through --undefined to Wasm LLD

This is a follow-on to D40724 (Wasm entrypoint changes #1,
add `--undefined` argument to LLD).

Patch by Nicholas Wilson

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

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

6 years agoFix assume-filename handling in clang-format.el
Philipp Stephani [Sat, 2 Dec 2017 21:18:14 +0000 (21:18 +0000)]
Fix assume-filename handling in clang-format.el

Summary:
When 'buffer-file-name' is nil 'call-process-region' returned a segmentation fault error.

This was a problem when using clang-format-buffer on an orgmode source code editing buffer.

I fixed this problem by excluding the '-assume-filename' argument when 'buffer-file-name' is nil.

To make it a bit more flexible I also added an optional argument, 'assume-file-name', to specify an assume-filename that overrides 'buffer-file-name'.

Reviewers: klimek, djasper, phst, phi

Reviewed By: phst, phi

Subscribers: phi, jholewinski, mgorny, javed.absar, eraman, cfe-commits

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

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

6 years ago[CodeGen] fix mapping from fmod calls to frem instruction
Sanjay Patel [Sat, 2 Dec 2017 17:52:00 +0000 (17:52 +0000)]
[CodeGen] fix mapping from fmod calls to frem instruction

Similar to D40044 and discussed in D40594.

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

6 years ago[CodeGen] remove stale comment; NFC
Sanjay Patel [Sat, 2 Dec 2017 16:29:34 +0000 (16:29 +0000)]
[CodeGen] remove stale comment; NFC

The libm functions with LLVM intrinsic twins were moved above this blob with:
https://reviews.llvm.org/rL319593

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

6 years agoPR35456: Track definedness of variable template specializations separately from
Richard Smith [Sat, 2 Dec 2017 02:48:42 +0000 (02:48 +0000)]
PR35456: Track definedness of variable template specializations separately from
whether they have an initializer.

We cannot distinguish between a declaration of a variable template
specialization and a definition of one that lacks an initializer without this,
and would previously mistake the latter for the former.

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

6 years agoMove comment back to being next to the code it's a comment for.
Richard Smith [Sat, 2 Dec 2017 00:55:48 +0000 (00:55 +0000)]
Move comment back to being next to the code it's a comment for.

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

6 years ago[AST] Try to fix build bot with modules broken r319589. However real fix may belong...
Eugene Zelenko [Fri, 1 Dec 2017 23:23:28 +0000 (23:23 +0000)]
[AST] Try to fix build bot with modules broken r319589. However real fix may belong to other place.

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

6 years ago[CodeGen] convert math libcalls/builtins to equivalent LLVM intrinsics
Sanjay Patel [Fri, 1 Dec 2017 23:15:52 +0000 (23:15 +0000)]
[CodeGen] convert math libcalls/builtins to equivalent LLVM intrinsics

There are 20 LLVM math intrinsics that correspond to mathlib calls according to the LangRef:
http://llvm.org/docs/LangRef.html#standard-c-library-intrinsics

We were only converting 3 mathlib calls (sqrt, fma, pow) and 12 builtin calls (ceil, copysign,
fabs, floor, fma, fmax, fmin, nearbyint, pow, rint, round, trunc) to their intrinsic-equivalents.

This patch pulls the transforms together and handles all 20 cases. The switch is guarded by a
check for const-ness to make sure we're not doing the transform if errno could possibly be set by
the libcall or builtin.

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

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Fri, 1 Dec 2017 22:04:49 +0000 (22:04 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[OPENMP] Emit `__tgt_target_teams` for all teams directives.
Alexey Bataev [Fri, 1 Dec 2017 21:31:08 +0000 (21:31 +0000)]
[OPENMP] Emit `__tgt_target_teams` for all teams directives.

Previously we emitted `__tgt_target_teams` only for standalone teams
directives. This patch allows emit this function for all teams-based
directives.

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

6 years ago[c++17] When deducing the type of a non-type template parameter from the type
Richard Smith [Fri, 1 Dec 2017 21:24:36 +0000 (21:24 +0000)]
[c++17] When deducing the type of a non-type template parameter from the type
of its argument, perform function-to-pointer and array-to-pointer decay on the
parameter type first.

Otherwise deduction will fail, as the type of the argument will be decayed.

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

6 years agoFix the second part of the broken comment from r306079
Adam Nemet [Fri, 1 Dec 2017 19:59:45 +0000 (19:59 +0000)]
Fix the second part of the broken comment from r306079

The driver-based test is still not identical to the front-end line, remove the
hotness threshold from there and add a new front-end based test with
threshold.

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

6 years agoFix opt-remark with hotness testcase for sample-based PGO
Adam Nemet [Fri, 1 Dec 2017 19:59:42 +0000 (19:59 +0000)]
Fix opt-remark with hotness testcase for sample-based PGO

1. Require hotness on all remark lines with -verify.

3. Fix the samplePGO file to actually produce hotness on each line.

The second remark has hotness 60 rather 30 which I don't quite understand but
testing this is strictly better than before.  It also unblocks the commit of
D40678.

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

6 years agoPartially fix comment in test broken in r306079 and r306948
Adam Nemet [Fri, 1 Dec 2017 19:59:37 +0000 (19:59 +0000)]
Partially fix comment in test broken in r306079 and r306948

A RUN line was referring to the previous RUN line but a new test was added in
between them.  Just reorder the lines.

Note this still does not completely fix this the brokenness of the comment as
the driver-based test gained a new hotness-threshold argument in r306948 but
I'll fix that is a separate commit.

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

6 years ago[OPENMP] Do not allow variables to be first|last-privates in
Alexey Bataev [Fri, 1 Dec 2017 17:40:15 +0000 (17:40 +0000)]
[OPENMP] Do not allow variables to be first|last-privates in
distribute directives.

OpenMP standard does not allow to mark the variables as firstprivate and lastprivate at the same time in distribute-based directives. Patch fixes this problem.

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

6 years agoDisallow a cleanup attribute from appertaining to a parameter (the attribute only...
Aaron Ballman [Fri, 1 Dec 2017 16:53:49 +0000 (16:53 +0000)]
Disallow a cleanup attribute from appertaining to a parameter (the attribute only appertains to local variables and is silently a noop on parameters). This repurposes the unused (and syntactically incorrect) NormalVar attribute subject.

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

6 years agoRemove duplicate, nonsense information from an attribute diagnostic. The NonParmVar...
Aaron Ballman [Fri, 1 Dec 2017 15:54:29 +0000 (15:54 +0000)]
Remove duplicate, nonsense information from an attribute diagnostic. The NonParmVar subject does not need to mention functions, and the resulting diagnostic definitely does not need to mention functions twice.

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

6 years agoBetter trade-off for excess characters vs. staying within the column limits.
Manuel Klimek [Fri, 1 Dec 2017 13:28:08 +0000 (13:28 +0000)]
Better trade-off for excess characters vs. staying within the column limits.

When we break a long line like:
Column limit: 21
                      |
  // foo foo foo foo foo foo foo foo foo foo foo foo

The local decision when to allow protruding vs. breaking can lead to this
outcome (2 excess characters, 2 breaks):
  // foo foo foo foo foo
  // foo foo foo foo foo
  // foo foo

While strictly staying within the column limit leads to this strictly better
outcome (fully below the column limit, 2 breaks):
  // foo foo foo foo
  // foo foo foo foo
  // foo foo foo foo

To get an optimal solution, we would need to consider all combinations of excess
characters vs. breaking for all lines, but that would lead to a significant
increase in the search space of the algorithm for little gain.

Instead, we blindly try both approches and·select the one that leads to the
overall lower penalty.

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

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

6 years ago[c++2a] P0515R3: Support for overloaded operator<=>.
Richard Smith [Fri, 1 Dec 2017 02:13:10 +0000 (02:13 +0000)]
[c++2a] P0515R3: Support for overloaded operator<=>.

No CodeGen support for MSABI yet, we don't know how to mangle this there.

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

6 years ago[c++2a] P0515R3: lexer support for new <=> token.
Richard Smith [Fri, 1 Dec 2017 01:07:10 +0000 (01:07 +0000)]
[c++2a] P0515R3: lexer support for new <=> token.

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

6 years agoMark all library options as hidden.
Zachary Turner [Fri, 1 Dec 2017 00:53:10 +0000 (00:53 +0000)]
Mark all library options as hidden.

These command line options are not intended for public use, and often
don't even make sense in the context of a particular tool anyway. About
90% of them are already hidden, but when people add new options they
forget to hide them, so if you were to make a brand new tool today, link
against one of LLVM's libraries, and run tool -help you would get a
bunch of junk that doesn't make sense for the tool you're writing.

This patch hides these options. The real solution is to not have
libraries defining command line options, but that's a much larger effort
and not something I'm prepared to take on.

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

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

6 years agoUpdate website to mention that you still need -frelaxed-template-template-args to...
Richard Smith [Thu, 30 Nov 2017 23:07:29 +0000 (23:07 +0000)]
Update website to mention that you still need -frelaxed-template-template-args to enable the corresponding C++17 feature in Clang 5.

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

6 years ago[clang] Use add_llvm_install_targets
Shoaib Meenai [Thu, 30 Nov 2017 22:35:02 +0000 (22:35 +0000)]
[clang] Use add_llvm_install_targets

Use this function to create the install targets rather than doing so
manually, which gains us the `-stripped` install targets to perform
stripped installations.

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

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Thu, 30 Nov 2017 22:33:48 +0000 (22:33 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[CUDA] Tweak CUDA wrappers to make cuda-9 work with libc++
Artem Belevich [Thu, 30 Nov 2017 22:22:21 +0000 (22:22 +0000)]
[CUDA] Tweak CUDA wrappers to make cuda-9 work with libc++

CUDA-9 headers check for specific libc++ version and ifdef out
some of the definitions we need if LIBCPP_VERSION >= 3800.

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

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

6 years ago[OpenMP] Diagnose undeclared variables on declare target clause
Kelvin Li [Thu, 30 Nov 2017 18:52:06 +0000 (18:52 +0000)]
[OpenMP] Diagnose undeclared variables on declare target clause

Clang asserts on undeclared variables on the to or link clause in the declare
target directive. The patch is to properly diagnose the error.

// foo1 and foo2 are not declared
#pragma omp declare target to(foo1)
#pragma omp declare target link(foo2)

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

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

6 years ago[OPENMP] Fix possible assert for target regions with incorrect inner
Alexey Bataev [Thu, 30 Nov 2017 18:01:54 +0000 (18:01 +0000)]
[OPENMP] Fix possible assert for target regions with incorrect inner
teams region.

If the inner teams region is not correct, it may cause an assertion when
processing outer target region. Patch fixes this problem.

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

6 years agoFix __has_unique_object_representations implementation
Erich Keane [Thu, 30 Nov 2017 16:37:02 +0000 (16:37 +0000)]
Fix __has_unique_object_representations implementation

As rsmith pointed out, the original implementation of this intrinsic
missed a number of important situations.  This patch fixe a bunch of
shortcomings and implementation details to make it work correctly.

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

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

6 years agoRevert [ARM] disable FPU features when using soft floating point.
Keith Walker [Thu, 30 Nov 2017 12:05:18 +0000 (12:05 +0000)]
Revert [ARM] disable FPU features when using soft floating point.

This reverts r319420
It is failing the test Driver/arm-mfpu.c so reverting while I investigate the failure.

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

6 years ago[ARM] disable FPU features when using soft floating point.
Keith Walker [Thu, 30 Nov 2017 11:38:56 +0000 (11:38 +0000)]
[ARM] disable FPU features when using soft floating point.

To be compatible with GCC if soft floating point is in effect any FPU
specified is effectively ignored, eg,

  -mfloat-abi=soft -fpu=neon

If any floating point features which require FPU hardware are enabled
they must be disable.

There was some support for doing this for NEON, but it did not handle
VFP, nor did it prevent the backend from emitting the build attribute
Tag_FP_arch describing the generated code as using the floating point
hardware if a FPU was specified (even though soft float does not use
the FPU).

Disabling the hardware floating point features for targets which are
compiling for soft float has meant that some tests which were incorrectly
checking for hardware support also needed to be updated. In such cases,
where appropriate the tests have been updated to check compiling for
soft float and a non-soft float variant (usually softfp). This was
usually because the target specified in the test defaulted to soft float.

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

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

6 years agoclang-format: [JS] do not wrap after async/await.
Martin Probst [Thu, 30 Nov 2017 10:25:17 +0000 (10:25 +0000)]
clang-format: [JS] do not wrap after async/await.

Summary:
Otherwise automatic semicolon insertion can trigger, i.e. wrapping
produces invalid syntax.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

6 years ago[CodeGen] Add initial support for union members in TBAA
Ivan A. Kosarev [Thu, 30 Nov 2017 09:26:39 +0000 (09:26 +0000)]
[CodeGen] Add initial support for union members in TBAA

The basic idea behind this patch is that since in strict aliasing
mode all accesses to union members require their outermost
enclosing union objects to be specified explicitly, then for a
couple given accesses to union members of the form

p->a.b.c...
q->x.y.z...

it is known they can only alias if both p and q point to the same
union type and offset ranges of members a.b.c... and x.y.z...
overlap. Note that the actual types of the members do not matter.

Specifically, in this patch we do the following:

* Make unions to be valid TBAA base access types. This enables
  generation of TBAA type descriptors for unions.

* Encode union types as structures with a single member of a
  special "union member" type. Currently we do not encode
  information about sizes of types, but conceptually such union
  members are considered to be of the size of the whole union.

* Encode accesses to direct and indirect union members, including
  member arrays, as accesses to these special members. All
  accesses to members of a union thus get the same offset, which
  is the offset of the union they are part of. This means the
  existing LLVM TBAA machinery is able to handle such accesses
  with no changes.

While this is already an improvement comparing to the current
situation, that is, representing all union accesses as may-alias
ones, there are further changes planned to complete the support
for unions. One of them is storing information about access sizes
so we can distinct accesses to non-overlapping union members,
including accesses to different elements of member arrays.
Another change is encoding type sizes in order to make it
possible to compute offsets within constant-indexed array
elements. These enhancements will be addressed with separate
patches.

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

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

6 years ago[analyzer] Fix false negative on post-increment of uninitialized variable.
Roman Lebedev [Thu, 30 Nov 2017 09:18:35 +0000 (09:18 +0000)]
[analyzer] Fix false negative on post-increment of uninitialized variable.

Summary:
Currently clang static analyzer does warn on:
```
int x;
x+=1;
x-=1;
x=x+1;
x=x-1;
```
But does warn on:
```
int x;
x++;
x--;
--x;
++x;
```

This differential should fix that.
Fixes https://bugs.llvm.org/show_bug.cgi?id=35419

Reviewers: dcoughlin, NoQ

Reviewed By: dcoughlin

Subscribers: NoQ, xazax.hun, szepet, cfe-commits, a.sidorin

Tags: #clang

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

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

6 years agoPreserve the "last diagnostic was suppressed" flag across SFINAE checks.
Richard Smith [Thu, 30 Nov 2017 08:18:21 +0000 (08:18 +0000)]
Preserve the "last diagnostic was suppressed" flag across SFINAE checks.

Sometimes we check the validity of some construct between producing a
diagnostic and producing its notes. Ideally, we wouldn't do that, but in
practice running code that "cannot possibly produce a diagnostic" in such a
situation should be safe, and reasonable factoring of some code requires it
with our current diagnostics infrastruture. If this does happen, a diagnostic
that's suppressed due to SFINAE should not cause notes connected to the prior
diagnostic to be suppressed.

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

6 years ago[XRay][clang] Introduce -fxray-always-emit-customevents
Dean Michael Berris [Thu, 30 Nov 2017 00:04:54 +0000 (00:04 +0000)]
[XRay][clang] Introduce -fxray-always-emit-customevents

Summary:
The -fxray-always-emit-customevents flag instructs clang to always emit
the LLVM IR for calls to the `__xray_customevent(...)` built-in
function. The default behaviour currently respects whether the function
has an `[[clang::xray_never_instrument]]` attribute, and thus not lower
the appropriate IR code for the custom event built-in.

This change allows users calling through to the
`__xray_customevent(...)` built-in to always see those calls lowered to
the corresponding LLVM IR to lay down instrumentation points for these
custom event calls.

Using this flag enables us to emit even just the user-provided custom
events even while never instrumenting the start/end of the function
where they appear. This is useful in cases where "phase markers" using
__xray_customevent(...) can have very few instructions, must never be
instrumented when entered/exited.

Reviewers: rnk, dblaikie, kpw

Subscribers: cfe-commits

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

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

6 years agoMS ABI: Treat explicit instantiation definitions of dllimport function templates...
Hans Wennborg [Wed, 29 Nov 2017 23:44:11 +0000 (23:44 +0000)]
MS ABI: Treat explicit instantiation definitions of dllimport function templates as explicit instantiation decls (PR35435)

This matches MSVC's behaviour, and we already do it for class templates
since r270897.

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

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 29 Nov 2017 23:27:36 +0000 (23:27 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoPerform a bounds check on a function's argument list before accessing any index value...
Aaron Ballman [Wed, 29 Nov 2017 23:10:14 +0000 (23:10 +0000)]
Perform a bounds check on a function's argument list before accessing any index value specified by an 'argument_with_type_tag' attribute. Fixes PR28520.

Patch by Matt Davis.

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 29 Nov 2017 22:39:22 +0000 (22:39 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[Coverage] Emit gap areas in braces-optional statements (PR35387)
Vedant Kumar [Wed, 29 Nov 2017 22:25:14 +0000 (22:25 +0000)]
[Coverage] Emit gap areas in braces-optional statements (PR35387)

Emit a gap area starting after the r-paren location and ending at the
start of the body for the braces-optional statements (for, for-each,
while, etc). The count for the gap area equal to the body's count. This
extends the fix in r317758.

Fixes PR35387, rdar://35570345

Testing: stage2 coverage-enabled build of clang, check-clang

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

6 years agoReformat switch statement added in r319297, NFC
Reid Kleckner [Wed, 29 Nov 2017 21:36:00 +0000 (21:36 +0000)]
Reformat switch statement added in r319297, NFC

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

6 years ago[EH] Use __CxxFrameHandler3 for C++ EH in MS environments
Reid Kleckner [Wed, 29 Nov 2017 21:35:34 +0000 (21:35 +0000)]
[EH] Use __CxxFrameHandler3 for C++ EH in MS environments

Fixes regression introduced by r319297. MSVC environments still use SEH
unwind opcodes but they should use the Microsoft C++ EH personality, not
the mingw one.

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

6 years ago[OPENMP] Allow only loop control variables in distribute simd
Alexey Bataev [Wed, 29 Nov 2017 21:31:48 +0000 (21:31 +0000)]
[OPENMP] Allow only loop control variables in distribute simd
directives.

According to the OpenMP standard, only loop control variables can be
used in linear clauses of distribute-based simd directives.

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

6 years agoAdd the hasDefinition() AST matcher to match class declarations that also have a...
Aaron Ballman [Wed, 29 Nov 2017 21:21:51 +0000 (21:21 +0000)]
Add the hasDefinition() AST matcher to match class declarations that also have a definition.

Patch by Julie Hockett.

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

6 years ago[SourceLocations] Use stronger sort predicate to remove non-deterministic ordering
Mandeep Singh Grang [Wed, 29 Nov 2017 20:55:13 +0000 (20:55 +0000)]
[SourceLocations] Use stronger sort predicate to remove non-deterministic ordering

Summary:
This fixes the following failure uncovered by D39245:
  Clang :: Index/getcursor-preamble.m

Reviewers: gbenyei, akyrtzi, bkramer, arphaman

Reviewed By: arphaman

Subscribers: arphaman, cfe-commits

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

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

6 years ago[clang-cl] Alias /wd4018 to -Wno-sign-compare
Reid Kleckner [Wed, 29 Nov 2017 18:45:03 +0000 (18:45 +0000)]
[clang-cl] Alias /wd4018 to -Wno-sign-compare

This warning is known to be noisy and projects frequently disable it. In
particular, this should make building isl as bundled in polly with
clang-cl a lot quieter.

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

6 years ago[analyzer] Fix unreachable creating PathDiagnosticLocation with widen-loops=true
Devin Coughlin [Wed, 29 Nov 2017 18:25:37 +0000 (18:25 +0000)]
[analyzer] Fix unreachable creating PathDiagnosticLocation with widen-loops=true

In the original design of the analyzer, it was assumed that a BlockEntrance
doesn't create a new binding on the Store, but this assumption isn't true when
'widen-loops' is set to true. Fix this by finding an appropriate location
BlockEntrace program points.

Patch by Henry Wong!

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

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

6 years ago[OPENMP] Do not allow `linear` clauses on non-simd distribute
Alexey Bataev [Wed, 29 Nov 2017 18:20:04 +0000 (18:20 +0000)]
[OPENMP] Do not allow `linear` clauses on non-simd distribute
directives.

`linear` clause is not allowed on non-simd distribute-based directives.

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

6 years ago[Driver] Turns out the GNU assembler does support falkor/saphira.
Chad Rosier [Wed, 29 Nov 2017 16:42:44 +0000 (16:42 +0000)]
[Driver] Turns out the GNU assembler does support falkor/saphira.

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

6 years agoFix function call to fix build
Ismail Donmez [Wed, 29 Nov 2017 15:18:02 +0000 (15:18 +0000)]
Fix function call to fix build

../tools/clang/lib/Driver/ToolChains/Cuda.cpp:80:18: error: reference to non-static member function must be called; did you mean to call it with no arguments?
    if (Distro(D.getVFS).IsDebian())
               ~~^~~~~~
                       ()

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

6 years ago[OPENMP] General improvement of handling of `teams distribute`
Alexey Bataev [Wed, 29 Nov 2017 15:14:16 +0000 (15:14 +0000)]
[OPENMP] General improvement of handling of `teams distribute`
directive, NFC.

Some general improvements in support of `teams distribute` directive.

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

6 years agoFollow up of r319317, add the missing header file
Sylvestre Ledru [Wed, 29 Nov 2017 15:11:53 +0000 (15:11 +0000)]
Follow up of r319317, add the missing header file

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