]> granicus.if.org Git - clang/log
clang
6 years agoRevert r320230 to fix buildbots.
Richard Trieu [Sat, 9 Dec 2017 03:02:21 +0000 (03:02 +0000)]
Revert r320230 to fix buildbots.

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

6 years agoFix Driver/darwin-version.c test
Alex Lorenz [Sat, 9 Dec 2017 02:56:48 +0000 (02:56 +0000)]
Fix Driver/darwin-version.c test

A target argument should be provided to avoid failures on non-Darwin

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

6 years ago[driver][darwin] Refactor the target selection code, NFC
Alex Lorenz [Sat, 9 Dec 2017 02:27:11 +0000 (02:27 +0000)]
[driver][darwin] Refactor the target selection code, NFC

The simulator variant of Darwin's platforms is removed in favor of a new
environment field.
The code that selects the platform and the version is split into 4 different
functions instead of being all in one function.
This is an NFC commit, although it slightly improves the
"invalid version number" diagnostic by displaying the environment variable
instead of -m<os>-version-min if the OS version was derived from the
environment.

rdar://35813850

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

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

6 years agoFix fsanitize-blacklist test on Windows.
Evgeniy Stepanov [Sat, 9 Dec 2017 02:15:42 +0000 (02:15 +0000)]
Fix fsanitize-blacklist test on Windows.

Broken in r320232.

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

6 years agoHardware-assisted AddressSanitizer (clang part).
Evgeniy Stepanov [Sat, 9 Dec 2017 01:32:07 +0000 (01:32 +0000)]
Hardware-assisted AddressSanitizer (clang part).

Summary:
Driver, frontend and LLVM codegen for HWASan.
A clone of ASan, basically.

Reviewers: kcc, pcc, alekseyshl

Subscribers: srhines, javed.absar, cfe-commits

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

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

6 years ago[ODRHash] Support ODR violation detection in functions.
Richard Trieu [Sat, 9 Dec 2017 01:29:40 +0000 (01:29 +0000)]
[ODRHash] Support ODR violation detection in functions.

Extend the hashing to functions, which allows detection of function definition
mismatches across modules.

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

6 years agoDon't link NetBSD programs with -ldl in linkXRayRuntimeDeps
Kamil Rytarowski [Sat, 9 Dec 2017 00:34:01 +0000 (00:34 +0000)]
Don't link NetBSD programs with -ldl in linkXRayRuntimeDeps

Summary:
There is no such library on NetBSD, the corresponding functions like dlopen(3) are in libc.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, eugenis

Reviewed By: vitalybuka

Subscribers: dberris, llvm-commits, #sanitizers

Tags: #sanitizers

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

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

6 years ago[CodeGen][X86] Fix handling of __fp16 vectors.
Akira Hatanaka [Sat, 9 Dec 2017 00:02:37 +0000 (00:02 +0000)]
[CodeGen][X86] Fix handling of __fp16 vectors.

This commit fixes a bug in IRGen where it generates completely broken
code for __fp16 vectors on X86. For example when the following code is
compiled:

half4 hv0, hv1, hv2; // these are vectors of __fp16.

void foo221() {
  hv0 = hv1 + hv2;
}

clang generates the following IR, in which two i16 vectors are added:

@hv1 = common global <4 x i16> zeroinitializer, align 8
@hv2 = common global <4 x i16> zeroinitializer, align 8
@hv0 = common global <4 x i16> zeroinitializer, align 8

define void @foo221() {
  %0 = load <4 x i16>, <4 x i16>* @hv1, align 8
  %1 = load <4 x i16>, <4 x i16>* @hv2, align 8
  %add = add <4 x i16> %0, %1
  store <4 x i16> %add, <4 x i16>* @hv0, align 8
  ret void
}

To fix the bug, this commit uses the code committed in r314056, which
modified clang to promote and truncate __fp16 vectors to and from float
vectors in the AST. It also fixes another IRGen bug where a short value
is assigned to an __fp16 variable without any integer-to-floating-point
conversion, as shown in the following example:

__fp16 a;
short b;

void foo1() {
  a = b;
}

@b = common global i16 0, align 2
@a = common global i16 0, align 2

define void @foo1() #0 {
  %0 = load i16, i16* @b, align 2
  store i16 %0, i16* @a, align 2
  ret void
}

rdar://problem/20625184

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

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

6 years agoRemove creation of out-of-bounds value of enumeration type (resulting in UB).
Richard Smith [Fri, 8 Dec 2017 23:29:59 +0000 (23:29 +0000)]
Remove creation of out-of-bounds value of enumeration type (resulting in UB).

Also remove unnecessary initialization of out-parameters with this value, so
that MSan is able to catch errors appropriately.

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

6 years agoUnify implementation of our two different flavours of -Wtautological-compare,
Richard Smith [Fri, 8 Dec 2017 22:57:11 +0000 (22:57 +0000)]
Unify implementation of our two different flavours of -Wtautological-compare,
and fold together into a single function.

In so doing, fix a handful of remaining bugs where we would report false
positives or false negatives if we promote a signed value to an unsigned type
for the comparison.

This re-commits r320122 and r320124, minus two changes:

 * Comparisons between a constant and a non-constant expression of enumeration
   type never warn, not even if the constant is out of range. We should be
   warning about the creation of such a constant, not about its use.

 * We do not use more precise bit-widths for comparisons against bit-fields.
   The more precise diagnostics probably are the right thing, but we should
   consider moving them under their own warning flag.

Other than the refactoring, this patch should only change the behavior for the
buggy cases (where the warnings didn't take into account that promotion from
signed to unsigned can leave a range of inaccessible values in the middle of
the promoted type).

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

6 years ago[Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Fri, 8 Dec 2017 22:39:26 +0000 (22:39 +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@320207 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[OPENMP] Simplify codegen for loop iteration variables in loop preamble.
Alexey Bataev [Fri, 8 Dec 2017 20:18:58 +0000 (20:18 +0000)]
[OPENMP] Simplify codegen for loop iteration variables in loop preamble.

Initial patch could cause trouble in the optimized code because of the
incorrectly generated lifetime intrinsics.

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

6 years ago[ubsan] array-bounds: Ignore params with constant size
Vedant Kumar [Fri, 8 Dec 2017 19:51:42 +0000 (19:51 +0000)]
[ubsan] array-bounds: Ignore params with constant size

This is a follow-up to r320128. Eli pointed out that there is some gray
area in the language standard about whether the constant size is exact,
or a lower bound.

https://reviews.llvm.org/D40940

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

6 years ago[hwasan] typo in docs
Kostya Serebryany [Fri, 8 Dec 2017 18:14:03 +0000 (18:14 +0000)]
[hwasan] typo in docs

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

6 years agoFix a comment in the code
Kamil Rytarowski [Fri, 8 Dec 2017 17:38:25 +0000 (17:38 +0000)]
Fix a comment in the code

The -ldl library is missing on NetBSD too, make the comment more generic.

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

6 years agoRevert "Unify implementation of our two different flavours of -Wtautological-compare."
Hans Wennborg [Fri, 8 Dec 2017 16:54:08 +0000 (16:54 +0000)]
Revert "Unify implementation of our two different flavours of -Wtautological-compare."

> Unify implementation of our two different flavours of -Wtautological-compare.
>
> In so doing, fix a handful of remaining bugs where we would report false
> positives or false negatives if we promote a signed value to an unsigned type
> for the comparison.

This caused a new warning in Chromium:

../../base/trace_event/trace_log.cc:1545:29: error: comparison of constant 64
with expression of type 'unsigned int' is always true
[-Werror,-Wtautological-constant-out-of-range-compare]
  DCHECK(handle.event_index < TraceBufferChunk::kTraceBufferChunkSize);
         ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The 'unsigned int' is really a 6-bit bitfield, which is why it's always
less than 64.

I thought we didn't use to warn (with out-of-range-compare) when comparing
against the boundaries of a type?

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

6 years ago[OPENMP] Initial codegen for `target teams distribute` directive.
Alexey Bataev [Fri, 8 Dec 2017 15:03:50 +0000 (15:03 +0000)]
[OPENMP] Initial codegen for `target teams distribute` directive.

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

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

6 years agoIn stdbool.h, define bool, false, true only in gnu++98
Stephan Bergmann [Fri, 8 Dec 2017 08:28:08 +0000 (08:28 +0000)]
In stdbool.h, define bool, false, true only in gnu++98

GCC has meanwhile corrected that with the similar
<https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=216679> "C++11
explicitly forbids macros for bool, true and false."

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

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

6 years agoRevert r320124 "Fold together the in-range and out-of-range portions of -Wtautologica...
Hans Wennborg [Fri, 8 Dec 2017 05:19:12 +0000 (05:19 +0000)]
Revert r320124 "Fold together the in-range and out-of-range portions of -Wtautological-compare."

This broke Chromium:

../../base/trace_event/trace_log.cc:1545:29: error: comparison of constant 64
with expression of type 'unsigned int' is always true
[-Werror,-Wtautological-constant-out-of-range-compare]
  DCHECK(handle.event_index < TraceBufferChunk::kTraceBufferChunkSize);
         ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The 'unsigned int' is really a 6-bit bitfield, which is why it's always
less than 63.

Did this use to fall under the "in-range" case before? I thought we
didn't use to warn when comparing against the boundaries of a type.

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

6 years ago[Blocks] Inherit sanitizer options from parent decl
Vedant Kumar [Fri, 8 Dec 2017 02:47:58 +0000 (02:47 +0000)]
[Blocks] Inherit sanitizer options from parent decl

There is no way to apply sanitizer suppressions to ObjC blocks. A
reasonable default is to have blocks inherit their parent's sanitizer
options.

rdar://32769634

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

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

6 years agoAdd a test that the __STDC_VERSION__ macro reports the correct value for -std=c17.
Aaron Ballman [Fri, 8 Dec 2017 02:39:26 +0000 (02:39 +0000)]
Add a test that the __STDC_VERSION__ macro reports the correct value for -std=c17.

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

6 years ago[ubsan] Use pass_object_size info in bounds checks
Vedant Kumar [Fri, 8 Dec 2017 01:51:47 +0000 (01:51 +0000)]
[ubsan] Use pass_object_size info in bounds checks

Teach UBSan's bounds check to opportunistically use pass_object_size
information to check array accesses.

rdar://33272922

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

6 years agoFold together the in-range and out-of-range portions of -Wtautological-compare.
Richard Smith [Fri, 8 Dec 2017 01:00:27 +0000 (01:00 +0000)]
Fold together the in-range and out-of-range portions of -Wtautological-compare.

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

6 years agoUnify implementation of our two different flavours of -Wtautological-compare.
Richard Smith [Fri, 8 Dec 2017 00:45:25 +0000 (00:45 +0000)]
Unify implementation of our two different flavours of -Wtautological-compare.

In so doing, fix a handful of remaining bugs where we would report false
positives or false negatives if we promote a signed value to an unsigned type
for the comparison.

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

6 years agoCorrect line endings that got mixed up in r320088; NFC.
Aaron Ballman [Thu, 7 Dec 2017 23:10:09 +0000 (23:10 +0000)]
Correct line endings that got mixed up in r320088; NFC.

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

6 years agoFix more line endings changed in r320089. NFC.
Ahmed Bougacha [Thu, 7 Dec 2017 23:08:46 +0000 (23:08 +0000)]
Fix more line endings changed in r320089. NFC.

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

6 years agoCorrect line endings that got mixed up in r320089; NFC.
Aaron Ballman [Thu, 7 Dec 2017 23:04:11 +0000 (23:04 +0000)]
Correct line endings that got mixed up in r320089; NFC.

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

6 years agoRemove line-endings added by r320089. NFC.
Ahmed Bougacha [Thu, 7 Dec 2017 22:58:02 +0000 (22:58 +0000)]
Remove line-endings added by r320089. NFC.

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

6 years ago[Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Thu, 7 Dec 2017 21:55:09 +0000 (21:55 +0000)]
[Analysis] 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@320091 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd new language mode flags for C17.
Aaron Ballman [Thu, 7 Dec 2017 21:46:26 +0000 (21:46 +0000)]
Add new language mode flags for C17.

This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode flags for C17 and updates the value of __STDC_VERSION__ to the value based on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is expected that we (and GCC) will add c18 flags as aliases once the ballot passes.

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

6 years agoAdd support for the __has_c_attribute builtin preprocessor macro.
Aaron Ballman [Thu, 7 Dec 2017 21:37:49 +0000 (21:37 +0000)]
Add support for the __has_c_attribute builtin preprocessor macro.

This behaves similar to the __has_cpp_attribute builtin macro in that it allows users to detect whether an attribute is supported with the [[]] spelling syntax, which can be enabled in C with -fdouble-square-bracket-attributes.

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

6 years ago[libclang] Record code-completion invocations to a temporary file when
Alex Lorenz [Thu, 7 Dec 2017 20:37:50 +0000 (20:37 +0000)]
[libclang] Record code-completion invocations to a temporary file when
requested by client

This is a follow up to r319702 which records parsing invocations.

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

rdar://35322543

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

6 years ago[OpenMP] NVPTX: Set default/minimum compute capability to sm_35
George Rokos [Thu, 7 Dec 2017 20:27:31 +0000 (20:27 +0000)]
[OpenMP] NVPTX: Set default/minimum compute capability to sm_35

The current implementation of the nvptx runtime (to be upstreamed shortly) uses the atomicMax operation on 64-bit integers.
This is only supported in compute capabilities 3.5 and later. I've changed the clang default to sm_35.

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

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

6 years ago[OPENMP] Do not capture private variables in the target regions.
Alexey Bataev [Thu, 7 Dec 2017 19:49:28 +0000 (19:49 +0000)]
[OPENMP] Do not capture private variables in the target regions.

Private variables are completely redefined in the outlined regions, so
we don't need to capture them. Patch adds this behavior to the
target-based regions.

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

6 years agoupdate hwasan docs
Kostya Serebryany [Thu, 7 Dec 2017 19:21:30 +0000 (19:21 +0000)]
update hwasan docs

Summary:
* use more readable name
* document the hwasan attribute

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits, cfe-commits

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

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

6 years ago[driver] Set the 'simulator' environment for Darwin when compiling for
Alex Lorenz [Thu, 7 Dec 2017 19:04:10 +0000 (19:04 +0000)]
[driver] Set the 'simulator' environment for Darwin when compiling for
iOS/tvOS/watchOS simulator

rdar://35135215

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

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

6 years ago[Index] Add setPreprocessor member to IndexDataConsumer.
Eric Liu [Thu, 7 Dec 2017 11:04:24 +0000 (11:04 +0000)]
[Index] Add setPreprocessor member to IndexDataConsumer.

Summary:
This enables us to use information in Preprocessor when handling symbol
occurrences.

Reviewers: arphaman, hokein

Reviewed By: hokein

Subscribers: malaperle, cfe-commits

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

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

6 years ago[ARM] ACLE parallel arithmetic and DSP style multiplications
Sjoerd Meijer [Thu, 7 Dec 2017 09:54:39 +0000 (09:54 +0000)]
[ARM] ACLE parallel arithmetic and DSP style multiplications

This is a follow up of r302131, in which we forgot to add SemaChecking
tests. Adding these tests revealed two problems which have been fixed:
- added missing intrinsic __qdbl,
- properly range checking ssat16 and usat16.

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

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

6 years agoIgnore pointers to incomplete types when diagnosing misaligned addresses
Roger Ferrer Ibanez [Thu, 7 Dec 2017 09:23:50 +0000 (09:23 +0000)]
Ignore pointers to incomplete types when diagnosing misaligned addresses

This is a fix for PR35509 in which we crash because we attempt to compute the
alignment of an incomplete type.

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

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

6 years agoAllow conditions to be decomposed with structured bindings
Zhihao Yuan [Thu, 7 Dec 2017 07:03:15 +0000 (07:03 +0000)]
Allow conditions to be decomposed with structured bindings

Summary:
This feature was discussed but not yet proposed.  It allows a structured binding to appear as a //condition//

    if (auto [ok, val] = f(...))

So the user can save an extra //condition// if the statement can test the value to-be-decomposed instead.  Formally, it makes the value of the underlying object of the structured binding declaration also the value of a //condition// that is an initialized declaration.

Considering its logicality which is entirely evident from its trivial implementation, I think it might be acceptable to land it as an extension for now before I write the paper.

Reviewers: rsmith, faisalv, aaron.ballman

Reviewed By: rsmith

Subscribers: aaron.ballman, cfe-commits

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

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

6 years agoTest commit access
Zhihao Yuan [Thu, 7 Dec 2017 06:27:58 +0000 (06:27 +0000)]
Test commit access

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

6 years agoCodeGen: Fix invalid bitcasts for memcpy
Yaxun Liu [Thu, 7 Dec 2017 01:39:52 +0000 (01:39 +0000)]
CodeGen: Fix invalid bitcasts for memcpy

CreateCoercedLoad/CreateCoercedStore assumes pointer argument of
memcpy is in addr space 0, which is not correct and causes invalid
bitcasts for triple amdgcn---amdgiz.

It is fixed by using alloca addr space instead.

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

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

6 years agoRemove old concepts parsing code
Hubert Tong [Thu, 7 Dec 2017 00:34:20 +0000 (00:34 +0000)]
Remove old concepts parsing code

Summary:
This is so we can implement concepts per P0734R0. Relevant failing test
cases are disabled.

Reviewers: hubert.reinterpretcast, rsmith, saar.raz, nwilson

Reviewed By: saar.raz

Subscribers: cfe-commits

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

Patch by Changyu Li!

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

6 years ago[Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 6 Dec 2017 23:18:41 +0000 (23:18 +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@319986 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[clang] Add PRIVATE to target_link_libraries
Shoaib Meenai [Wed, 6 Dec 2017 23:02:00 +0000 (23:02 +0000)]
[clang] Add PRIVATE to target_link_libraries

Another follow-up to r319840. I'd done a test configure with
LLVM_BUILD_STATIC, so I'm not sure why this didn't show up in that.

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

6 years ago[clang] Use PRIVATE in target_link_libraries
Shoaib Meenai [Wed, 6 Dec 2017 20:05:42 +0000 (20:05 +0000)]
[clang] Use PRIVATE in target_link_libraries

I'd missed this one in r319840 because I hadn't been configuring with an
order file before.

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

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