]> granicus.if.org Git - clang/log
clang
7 years ago[AArch64] Add ARMv8.2-A FP16 vefctor intrinsics
Abderrazek Zaafrani [Thu, 1 Jun 2017 23:22:29 +0000 (23:22 +0000)]
[AArch64] Add ARMv8.2-A FP16 vefctor intrinsics

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

7 years agoRelax test to try and appease builders. NFC.
Vedant Kumar [Thu, 1 Jun 2017 22:27:39 +0000 (22:27 +0000)]
Relax test to try and appease builders. NFC.

I'm not sure why, but on some bots, the order of two instructions are
swapped (as compared to the output on my machine). Loosen up the
CHECK-NEXT directives to deal with this.

Failing bot: http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/3097

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

7 years agoAdded LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
Galina Kistanova [Thu, 1 Jun 2017 21:29:45 +0000 (21:29 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.

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

7 years agoAdded LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
Galina Kistanova [Thu, 1 Jun 2017 21:28:26 +0000 (21:28 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.

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

7 years agoAdded LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
Galina Kistanova [Thu, 1 Jun 2017 21:26:38 +0000 (21:26 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.

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

7 years agoAdded LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
Galina Kistanova [Thu, 1 Jun 2017 21:23:52 +0000 (21:23 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.

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

7 years agoAdded LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
Galina Kistanova [Thu, 1 Jun 2017 21:21:49 +0000 (21:21 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.

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

7 years agoAdded LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
Galina Kistanova [Thu, 1 Jun 2017 21:19:06 +0000 (21:19 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.

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

7 years agoAdded LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
Galina Kistanova [Thu, 1 Jun 2017 21:15:34 +0000 (21:15 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.

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

7 years ago[CGDebugInfo] Finalize SubPrograms when we're done with them
Keno Fischer [Thu, 1 Jun 2017 21:14:03 +0000 (21:14 +0000)]
[CGDebugInfo] Finalize SubPrograms when we're done with them

`GenerateVarArgsThunk` in `CGVTables` clones a function before the frontend
is done emitting the compilation unit. Because of the way that DIBuilder
works, this means that the attached subprogram had incomplete (temporary)
metadata. Cloning such metadata is semantically disallowed, but happened
to work anyway due to bugs in the cloning logic. rL304226 attempted to fix
up that logic, but in the process exposed the incorrect API use here and
had to be reverted. To be able to fix this, I added a new method to
DIBuilder in rL304467, to allow finalizing a subprogram independently
of the entire compilation unit. Use that here, in preparation of re-applying
rL304226.

Reviewers: aprantl, dblaikie
Differential Revision: https://reviews.llvm.org/D33705

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

7 years agoDon't assume that a store source is a vector type just because the destination is...
Simon Pilgrim [Thu, 1 Jun 2017 20:13:34 +0000 (20:13 +0000)]
Don't assume that a store source is a vector type just because the destination is (PR26099)

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

7 years agoEscape filenames in module map line marker directives, to unbreak Windows build bots.
Richard Smith [Thu, 1 Jun 2017 20:10:35 +0000 (20:10 +0000)]
Escape filenames in module map line marker directives, to unbreak Windows build bots.

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

7 years ago[Modules] Handle sanitizer feature mismatches when importing modules
Vedant Kumar [Thu, 1 Jun 2017 20:01:01 +0000 (20:01 +0000)]
[Modules] Handle sanitizer feature mismatches when importing modules

This patch makes it an error to have a mismatch between the enabled
sanitizers in a CU, and in any module being imported into the CU. Only
mismatches between non-modular sanitizers are treated as errors.

This patch also includes non-modular sanitizers in module hashes, in
order to ensure module rebuilds occur when -fsanitize=X is toggled on
and off for non-modular sanitizers, and to cut down on module rebuilds
when the option is toggled for modular sanitizers.

This fixes a longstanding issue with implicit modules and sanitizers,
which Duncan originally diagnosed.

When building with implicit modules it's possible to hit a scenario
where modules are built without -fsanitize=address, and are subsequently
imported into CUs with -fsanitize=address enabled. This causes strange
failures at runtime. The case Duncan found affects libcxx, since its
vector implementation behaves differently when ASan is enabled.

Implicit module builds should "just work" when -fsanitize=X is toggled
on and off across multiple compiler invocations, which is what this
patch does.

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

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

7 years ago[ubsan] Add a check for pointer overflow UB
Vedant Kumar [Thu, 1 Jun 2017 19:22:18 +0000 (19:22 +0000)]
[ubsan] Add a check for pointer overflow UB

Check pointer arithmetic for overflow.

For some more background on this check, see:

  https://wdtz.org/catching-pointer-overflow-bugs.html
  https://reviews.llvm.org/D20322

Patch by Will Dietz and John Regehr!

This version of the patch is different from the original in a few ways:

  - It introduces the EmitCheckedInBoundsGEP utility which inserts
    checks when the pointer overflow check is enabled.

  - It does some constant-folding to reduce instrumentation overhead.

  - It does not check some GEPs in CGExprCXX. I'm not sure that
    inserting checks here, or in CGClass, would catch many bugs.

Possible future directions for this check:

  - Introduce CGF.EmitCheckedStructGEP, to detect overflows when
    accessing structures.

Testing: Apart from the added lit test, I ran check-llvm and check-clang
with a stage2, ubsan-instrumented clang. Will and John have also done
extensive testing on numerous open source projects.

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

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

7 years agoAdd compatibility alias for -Wno-#warnings
David Blaikie [Thu, 1 Jun 2017 19:08:34 +0000 (19:08 +0000)]
Add compatibility alias for -Wno-#warnings

GCC uses -Wno-cpp for this, so seems reasonable to add an alias to
match.

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

7 years agoFixed broken test (strict-vtable-pointers)
Piotr Padlewski [Thu, 1 Jun 2017 19:08:05 +0000 (19:08 +0000)]
Fixed broken test (strict-vtable-pointers)

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

7 years ago[SemaCXX] Add diagnostics to require_constant_initialization
Keno Fischer [Thu, 1 Jun 2017 18:54:16 +0000 (18:54 +0000)]
[SemaCXX] Add diagnostics to require_constant_initialization

Summary:
This hooks up the detailed diagnostics of why constant initialization was
not possible if require_constant_initialization reports an error.
I have updated the test to account for the new notes.

Reviewed By: EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24371

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

7 years ago[CodeGen][ObjC] Fix assertion failure in EmitARCStoreStrongCall.
Akira Hatanaka [Thu, 1 Jun 2017 18:41:25 +0000 (18:41 +0000)]
[CodeGen][ObjC] Fix assertion failure in EmitARCStoreStrongCall.

The assertion fails because EmitValueForIvarAtOffset doesn't get the
correct type of the ivar when the class the ivar belongs to is
parameterized. This commit fixes the function to compute the ivar's type
based on the type argument provided to the parameterized class.

rdar://problem/32461723

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

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

7 years agoEmit invariant.group.barrier when using union field
Piotr Padlewski [Thu, 1 Jun 2017 18:39:34 +0000 (18:39 +0000)]
Emit invariant.group.barrier when using union field

Summary:
We need to emit barrier if the union field
is CXXRecordDecl because it might have vptrs. The testcode
was wrongly devirtualized. It also proves that having different
groups for different dynamic types is not sufficient.

Reviewers: rjmccall, rsmith, mehdi_amini

Subscribers: amharc, cfe-commits

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

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

7 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Thu, 1 Jun 2017 18:17:18 +0000 (18:17 +0000)]
Strip trailing whitespace. NFCI.

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

7 years agoRemove late nullptr pointer test (PR32447)
Simon Pilgrim [Thu, 1 Jun 2017 18:13:02 +0000 (18:13 +0000)]
Remove late nullptr pointer test (PR32447)

IgnoreNarrowingConversion should never return nullptr, but I've added an assert just in case.

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

7 years agoIncrease the limit for the number of DiagnosticLexKinds.td diags.
Yaron Keren [Thu, 1 Jun 2017 12:46:59 +0000 (12:46 +0000)]
Increase the limit for the number of DiagnosticLexKinds.td diags.
300 was reached in r304190, 400 should be enough for a while.

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

7 years agoMake the clang-cl test less restrictive.
Alexander Kornienko [Thu, 1 Jun 2017 11:41:21 +0000 (11:41 +0000)]
Make the clang-cl test less restrictive.

Make the test less restrictive to allow directory layout used in our test setup.

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

7 years agoFixed warnings
Piotr Padlewski [Thu, 1 Jun 2017 09:24:36 +0000 (09:24 +0000)]
Fixed warnings

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

7 years ago[OpenCL] spir_kern by defaul: fix old test cases
Pekka Jaaskelainen [Thu, 1 Jun 2017 08:19:43 +0000 (08:19 +0000)]
[OpenCL] spir_kern by defaul: fix old test cases

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

7 years agoEmit available_externally vtables opportunistically
Piotr Padlewski [Thu, 1 Jun 2017 08:04:05 +0000 (08:04 +0000)]
Emit available_externally vtables opportunistically

Summary:
We can emit vtable definition having inline function
if they are all emitted.

Reviewers: rjmccall, rsmith

Subscribers: cfe-commits

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

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

7 years agoAdapt tests after making mcpu=generic the default for armv7-a and armv8-a.
Kristof Beyls [Thu, 1 Jun 2017 07:31:50 +0000 (07:31 +0000)]
Adapt tests after making mcpu=generic the default for armv7-a and armv8-a.

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

7 years ago[OpenCL] Makes kernels use the SPIR_KERNEL CC by default.
Pekka Jaaskelainen [Thu, 1 Jun 2017 07:18:49 +0000 (07:18 +0000)]
[OpenCL] Makes kernels use the SPIR_KERNEL CC by default.

Rationale: OpenCL kernels are called via an explicit runtime API
with arguments set with clSetKernelArg(), not as normal sub-functions.
Return SPIR_KERNEL by default as the kernel calling convention to ensure
the fingerprint is fixed such way that each OpenCL argument gets one
matching argument in the produced kernel function argument list to enable
feasible implementation of clSetKernelArg() with aggregates etc. In case
we would use the default C calling conv here, clSetKernelArg() might
break depending on the target-specific conventions; different targets
might split structs passed as values to multiple function arguments etc.

https://reviews.llvm.org/D33639

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

7 years agodocs: Document LLD's cache dir argument.
Peter Collingbourne [Thu, 1 Jun 2017 03:48:12 +0000 (03:48 +0000)]
docs: Document LLD's cache dir argument.

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

7 years agoCGCleanup: (NFC) add another test for r304335 - Don't try to spill static allocas
Gor Nishanov [Thu, 1 Jun 2017 01:15:25 +0000 (01:15 +0000)]
CGCleanup: (NFC) add another test for r304335 - Don't try to spill static allocas

Summary:
Coroutine related test that used to trigger broken IR prior to r304335.

```
%x = alloca i32, align 4
store i32* %x, i32** %tmp.exprcleanup, align 4 ; <===== HERE
%ref.tmp3 = alloca %struct.A, align 1
%agg.tmp5 = alloca %"struct.std::experimental::coroutines_v1::coroutine_handle.0", align 4
%tmp.exprcleanup = alloca i32*, align 4
%allocapt = bitcast i32 undef to i32
store i32 %0, i32* %.addr, align 4
```

Fixed with r304335

Subscribers: cfe-commits

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

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

7 years agoPR33232: implement support for MSVC's __is_trivially_destructible trait.
Richard Smith [Thu, 1 Jun 2017 00:28:16 +0000 (00:28 +0000)]
PR33232: implement support for MSVC's __is_trivially_destructible trait.

Unlike the GCC-compatible __has_trivial_destructor trait, this one computes the
right answer rather than performing the quirky set of checks described in GCC's
documentation (https://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html).

MSVC also has a __has_trivial_destructor trait which is the same as its (and
now Clang's) __is_trivially_destructible trait; we might want to consider
changing the behavior of __has_trivial_destructor if we're targeting an MSVC
platform, but I'm not doing so for now.

While implementing this I found that we were incorrectly rejecting
__is_destructible queries on arrays of unknown bound of incomplete types; that
too is fixed, and I've added similar tests for other traits for good measure.

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

7 years ago[coroutines] Fix checking for prvalue-ness of `await_suspend` return type
Eric Fiselier [Wed, 31 May 2017 23:41:11 +0000 (23:41 +0000)]
[coroutines] Fix checking for prvalue-ness of `await_suspend` return type

Summary:
@rsmith Does this correctly address the issues mentioned in https://reviews.llvm.org/D33625#inline-292971 ?

Reviewers: rsmith, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, rsmith

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

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

7 years ago[modules] When compiling a preprocessed module map, look for headers relative
Richard Smith [Wed, 31 May 2017 20:56:55 +0000 (20:56 +0000)]
[modules] When compiling a preprocessed module map, look for headers relative
to the original module map.

Also use the path and name of the original module map when emitting that
information into the .pcm file. The upshot of this is that the produced .pcm
file will track information for headers in their original locations (where the
module was preprocessed), not relative to whatever directory the preprocessed
module map was in when it was built.

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

7 years ago[clang-cl] Expose -nostdinc and -nobuiltininc
Reid Kleckner [Wed, 31 May 2017 20:42:43 +0000 (20:42 +0000)]
[clang-cl] Expose -nostdinc and -nobuiltininc

These are already wired up to work in the MSVC toolchain header search
code. However, they were unreachable from clang-cl. A user attempted to
use them in https://bugs.llvm.org/show_bug.cgi?id=33205, so let's expose
them.

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

7 years agoFix cl-diagnostics.c test by hardcoding the version of MSVC to mimic
Reid Kleckner [Wed, 31 May 2017 20:07:36 +0000 (20:07 +0000)]
Fix cl-diagnostics.c test by hardcoding the version of MSVC to mimic

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

7 years agoAdd test case for r304316 which implemented clang-cl /diagnostics:*
Reid Kleckner [Wed, 31 May 2017 20:02:27 +0000 (20:02 +0000)]
Add test case for r304316 which implemented clang-cl /diagnostics:*

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

7 years agoDon't try to spill static allocas when emitting expr cleanups with branches
Reid Kleckner [Wed, 31 May 2017 19:59:41 +0000 (19:59 +0000)]
Don't try to spill static allocas when emitting expr cleanups with branches

Credit goes to Gor Nishanov for putting together the fix in
https://reviews.llvm.org/D33733!

This patch is essentially me patching it locally and writing some test
cases to convince myself that it was necessary for GNU statement
expressions with branches as well as coroutines. I'll ask Gor to land
his patch with just the coroutines test.

During LValue expression evaluation, references can be bound to
anything, really: call results, aggregate temporaries, local variables,
global variables, or indirect arguments. We really only want to spill
instructions that were emitted as part of expression evaluation, and
static allocas are not that.

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

7 years ago[coroutines] Fix assertion during -Wuninitialized analysis
Eric Fiselier [Wed, 31 May 2017 19:36:59 +0000 (19:36 +0000)]
[coroutines] Fix assertion during -Wuninitialized analysis

Summary: @rsmith Is there a better place to put this test?

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov

Subscribers: cfe-commits, rsmith

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

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

7 years ago[TableGen] Clang changes to support Record::getValueAsString and getValueAsListOfStri...
Craig Topper [Wed, 31 May 2017 19:01:22 +0000 (19:01 +0000)]
[TableGen] Clang changes to support Record::getValueAsString and getValueAsListOfStrings returning StringRef instead of std::string

This is the clang version of D33710.

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

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

7 years ago[CodeGen] Surround assertion with parens and format.
Davide Italiano [Wed, 31 May 2017 18:51:36 +0000 (18:51 +0000)]
[CodeGen] Surround assertion with parens and format.

This should placate GCC7 with -Werror.

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

7 years ago[clang-cl] Implement /diagnostic: flag
Reid Kleckner [Wed, 31 May 2017 17:37:49 +0000 (17:37 +0000)]
[clang-cl] Implement /diagnostic: flag

This flag has three possible values: caret, column, and classic.

"caret" corresponds to clang's default mode, "column" removes the caret
and code snippet, and "classic" emits nothing.

Documentation is here:
https://docs.microsoft.com/en-us/cpp/build/reference/diagnostics-compiler-diagnostic-options

Implements the last part of PR33237

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

7 years agoFix incorrect spelling of calling conv flag and add -Wno-msvc-not-found to test
Reid Kleckner [Wed, 31 May 2017 15:50:35 +0000 (15:50 +0000)]
Fix incorrect spelling of calling conv flag and add -Wno-msvc-not-found to test

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

7 years ago[Sema][ObjC] Don't emit availability diags for category @implementations
Erik Pilkington [Wed, 31 May 2017 15:45:57 +0000 (15:45 +0000)]
[Sema][ObjC] Don't emit availability diags for category @implementations

These diagnostics can't be disabled, and can't actually catch any bugs.
rdar://32427296

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

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

7 years ago[clang-cl] Improve default calling convention flag handling
Reid Kleckner [Wed, 31 May 2017 15:39:28 +0000 (15:39 +0000)]
[clang-cl] Improve default calling convention flag handling

Ignore default CC flags that don't make sense for the target arch. This
is consistent with MSVC.

Addresses part of PR33237

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

7 years ago[clang-cl] Ignore /Zc:ternary, clang behaves this way already
Reid Kleckner [Wed, 31 May 2017 14:50:28 +0000 (14:50 +0000)]
[clang-cl] Ignore /Zc:ternary, clang behaves this way already

Addresses part of PR33237

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

7 years agoEnable the ARM Neon intrinsics test by default.
Alexander Kornienko [Wed, 31 May 2017 14:35:50 +0000 (14:35 +0000)]
Enable the ARM Neon intrinsics test by default.

The test being marked 'REQUIRES: long-tests' doesn't make sense. It's not the
first time the test is broken without being noticed by the committer. If the
test is too long, it should be shortened, split in multiple ones or removed
altogether. Keeping it as is is actively harmful.
(BTW, on my machine `ninja check-clang` takes 90-92 seconds with and without
this test. The difference in times is below the spread caused by random
factors.)

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

7 years agoRevert "[ARM] Update long-test after r304201."
Alexander Kornienko [Wed, 31 May 2017 14:33:29 +0000 (14:33 +0000)]
Revert "[ARM] Update long-test after r304201."

This reverts commit 304208, since r304201 has been reverted as well.

The test needs to be turned on by default to detect breakages earlier. Will
commit this change separately.

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

7 years agoclang-format: [JS] improve calculateBraceType heuristic
Martin Probst [Wed, 31 May 2017 09:29:40 +0000 (09:29 +0000)]
clang-format: [JS] improve calculateBraceType heuristic

Summary:

calculateBraceTypes decides for braced init for empty brace pairs ({}).
In context of a function declaration, this incorrectly classifies empty
function or method bodies as braced inits, leading to missing wraps:

    class C {
      foo() {}[bar]() {}
    }

Where code should have wrapped after "}", before "[". This change adds
another piece of contextual information in that braces following closing
parentheses must always be the opening braces of function blocks. This
fixes brace detection for methods immediately followed by brackets
(computed property declarations), but also curlies.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[ODRHash] Support TemplateSpecializationType
Richard Trieu [Wed, 31 May 2017 00:31:58 +0000 (00:31 +0000)]
[ODRHash] Support TemplateSpecializationType

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

7 years ago[modules] Minor documentation clarification for behavior of requires-declaration.
Richard Smith [Tue, 30 May 2017 23:05:23 +0000 (23:05 +0000)]
[modules] Minor documentation clarification for behavior of requires-declaration.

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

7 years agoAdd an explicit -std= to test to unbreak on PS4 targets.
Richard Smith [Tue, 30 May 2017 20:13:34 +0000 (20:13 +0000)]
Add an explicit -std= to test to unbreak on PS4 targets.

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

7 years ago[OpenMP][Driver] Put target binary for each offload target into a
Alexey Bataev [Tue, 30 May 2017 18:57:51 +0000 (18:57 +0000)]
[OpenMP][Driver] Put target binary for each offload target into a
separate section, by Sergey Dmitriev

Linker script that is generated by the clang driver for creating fat binary puts target binaries for all offload targets into a single ELF section .omp_offloading. This is not convenient because it greatly complicates operations with the final fat binary once it is linked. For example extracting target binary for a particular target from such fat executable would not be an easy task if you have more than one offload target.

Attached patch changes clang driver to put target binary for each
offload target into a separate ELF section .omp_offloading.<target
triple>.

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

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

7 years agoReverting Neon vector type 64-alignment fix
Javed Absar [Tue, 30 May 2017 17:09:47 +0000 (17:09 +0000)]
Reverting Neon vector type 64-alignment fix

The patch caused ABI breaks on darwin/others.
Reverting to come back with a more restrictive patch.

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

7 years ago[OPENMP] Allow 'use_device_ptr' clause in 'target data' alone.
Alexey Bataev [Tue, 30 May 2017 16:00:04 +0000 (16:00 +0000)]
[OPENMP] Allow 'use_device_ptr' clause in 'target data' alone.

According to OpenMP 5.0 at least one 'map' or 'use_device_ptr' clause
must be specified for 'target data' construct. Patch adds support for
this feature.

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

7 years ago[libclang] Allow to suspend a translation unit.
Erik Verbruggen [Tue, 30 May 2017 14:25:54 +0000 (14:25 +0000)]
[libclang] Allow to suspend a translation unit.

A suspended translation unit uses significantly less memory but on the
other side does not support any other calls than
clang_reparseTranslationUnit to resume it or
clang_disposeTranslationUnit to dispose it completely.

This helps IDEs to reduce the memory footprint. The data that is freed
by a call to clang_suspendTranslationUnit will be re-generated on the
next (re)parse anyway. Used with a preamble, this allows pretty fast
resumption of the translation unit for further use (compared to disposal
of the translation unit and a parse from scratch).

Patch by Nikolai Kosjar!

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

7 years agoFixup r304205 - Require PowerPC target
Diana Picus [Tue, 30 May 2017 14:05:33 +0000 (14:05 +0000)]
Fixup r304205 - Require PowerPC target

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

7 years agoFix issue with test that caused bildbot failure
Javed Absar [Tue, 30 May 2017 13:34:26 +0000 (13:34 +0000)]
Fix issue with test that caused bildbot failure

These tests did not specify the target.
The failure was triggered by change -
https://reviews.llvm.org/D33205
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/7314

which sets vector alignment to 8-byte for arm-targets (except for Android).
So, fixing the test to make it target specific.

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

7 years ago[ARM] Update long-test after r304201.
Benjamin Kramer [Tue, 30 May 2017 12:44:48 +0000 (12:44 +0000)]
[ARM] Update long-test after r304201.

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

7 years agoAllow for unfinished #if blocks in preambles
Erik Verbruggen [Tue, 30 May 2017 11:54:55 +0000 (11:54 +0000)]
Allow for unfinished #if blocks in preambles

Previously, a preamble only included #if blocks (and friends like
ifdef) if there was a corresponding #endif before any declaration or
definition. The problem is that any header file that uses include guards
will not have a preamble generated, which can make code-completion very
slow.

To prevent errors about unbalanced preprocessor conditionals in the
preamble, and unbalanced preprocessor conditionals after a preamble
containing unfinished conditionals, the conditional stack is stored
in the pch file.

This fixes PR26045.

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

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

7 years ago[PPC] Make altivec conversion function macros.
Benjamin Kramer [Tue, 30 May 2017 11:37:29 +0000 (11:37 +0000)]
[PPC] Make altivec conversion function macros.

The second argument must be a constant, otherwise instruction selection
will fail. always_inline is not enough for isel to always fold
everything away at -O0.

Sadly the overloading turned this into a big macro mess. Fixes PR33212.

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

7 years ago[ARM] Fix Neon vector type alignment to 64-bit
Javed Absar [Tue, 30 May 2017 10:12:15 +0000 (10:12 +0000)]
[ARM] Fix Neon vector type alignment to 64-bit

The maximum alignment for ARM NEON data types should be 64-bits as specified
in ARM procedure call standard document Sec. A.2 Notes.
This patch fixes it from its current larger natural default values, except
for Android (so as not to break existing ABI).
Reviewed by: Stephen Hines, Renato Golin.
Differential Revision: https://reviews.llvm.org/D33205

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

7 years ago[OpenCL] Added diagnostic for implicit declaration of function in OpenCL
Egor Churaev [Tue, 30 May 2017 05:57:52 +0000 (05:57 +0000)]
[OpenCL] Added diagnostic for implicit declaration of function in OpenCL

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

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

7 years ago[OpenCL] An error shall occur if any scalar operand has greater rank than the type...
Egor Churaev [Tue, 30 May 2017 05:32:03 +0000 (05:32 +0000)]
[OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element

Summary:
This is the fix for patch https://reviews.llvm.org/D33353
@uweigand, could you please verify that everything will be good on SystemZ?
I added triple spir-unknown-unknown.
Thank you in advance!

Reviewers: uweigand

Reviewed By: uweigand

Subscribers: yaxunl, cfe-commits, bader, Anastasia, uweigand

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

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

7 years agoDiagnose attempts to build a preprocessed module that defines an unavailable submodule.
Richard Smith [Tue, 30 May 2017 05:22:59 +0000 (05:22 +0000)]
Diagnose attempts to build a preprocessed module that defines an unavailable submodule.

The errors we would otherwise get are incomprehensible, as we would enter the
module but not make its contents visible to itself.

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

7 years ago[trivial] fix a typo in comment, NFC
Hiroshi Inoue [Tue, 30 May 2017 05:06:46 +0000 (05:06 +0000)]
[trivial] fix a typo in comment, NFC

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

7 years ago[modules] When we #include a local submodule header that we've already built,
Richard Smith [Tue, 30 May 2017 02:03:19 +0000 (02:03 +0000)]
[modules] When we #include a local submodule header that we've already built,
and it has an include guard, produce callbacks for a module import, not for a
skipped non-modular header.

Fixes -E output when preprocessing a module to list these cases as a module
import, rather than suppressing the #include and losing the import side effect.

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

7 years agoCGCoroutine.cpp: (NFC) clang-format misplaced brace
Gor Nishanov [Mon, 29 May 2017 21:15:31 +0000 (21:15 +0000)]
CGCoroutine.cpp: (NFC) clang-format misplaced brace

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

7 years ago[analyzer] Fix immutable map factory lifetime for partial taint.
Artem Dergachev [Mon, 29 May 2017 18:54:02 +0000 (18:54 +0000)]
[analyzer] Fix immutable map factory lifetime for partial taint.

This should fix the leaks found by asan buildbot in r304162.

Also don't store a reference to the factory with every map value,
which is the only difference between ImmutableMap and ImmutableMapRef.

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

7 years agoUnbreak long test after r304127.
Benjamin Kramer [Mon, 29 May 2017 18:11:11 +0000 (18:11 +0000)]
Unbreak long test after r304127.

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

7 years ago[analyzer] Support partially tainted records.
Artem Dergachev [Mon, 29 May 2017 15:42:56 +0000 (15:42 +0000)]
[analyzer] Support partially tainted records.

The analyzer's taint analysis can now reason about structures or arrays
originating from taint sources in which only certain sections are tainted.

In particular, it also benefits modeling functions like read(), which may
read tainted data into a section of a structure, but RegionStore is incapable of
expressing the fact that the rest of the structure remains intact, even if we
try to model read() directly.

Patch by Vlad Tsyrklevich!

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

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

7 years ago[analyzer] Initial commit for the upcoming refactoring of the IteratorChecker.
Artem Dergachev [Mon, 29 May 2017 15:03:20 +0000 (15:03 +0000)]
[analyzer] Initial commit for the upcoming refactoring of the IteratorChecker.

The new checker currently contains the very core infrastructure for tracking
the state of iterator-type objects in the analyzer: relating iterators to
their containers, tracking symbolic begin and end iterator values for
containers, and solving simple equality-type constraints over iterators.
A single specific check over this infrastructure is capable of finding usage of
out-of-range iterators in some simple cases.

Patch by Ádám Balogh!

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

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

7 years ago[analyzer] PthreadLockChecker: model failed pthread_mutex_destroy() calls.
Artem Dergachev [Mon, 29 May 2017 14:51:39 +0000 (14:51 +0000)]
[analyzer] PthreadLockChecker: model failed pthread_mutex_destroy() calls.

pthread_mutex_destroy() may fail, returning a non-zero error number, and
keeping the mutex untouched. The mutex can be used on the execution branch
that follows such failure, so the analyzer shouldn't warn on using
a mutex that was previously destroyed, when in fact the destroy call has failed.

Patch by Malhar Thakkar!

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

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

7 years agoclang-format: [JS] do not clean up duplicated commas.
Martin Probst [Mon, 29 May 2017 08:41:11 +0000 (08:41 +0000)]
clang-format: [JS] do not clean up duplicated commas.

Summary:
In JavaScript, duplicated commas have semantic meaning.
    x = [a,,b];

The statement above creates an array with three entries, the middle being undefined. Because clang-format should not change semantics, disable this cleanup in JS.

Reviewers: djasper

Subscribers: klimek

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

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

7 years agoclang-format: [JS] fix indenting bound functions.
Martin Probst [Mon, 29 May 2017 07:50:52 +0000 (07:50 +0000)]
clang-format: [JS] fix indenting bound functions.

Summary:
The previous fix to force build style wrapping if the previous token is a closing parenthesis broke a peculiar pattern where users parenthesize the function declaration in a bind call:
    fn((function() { ... }).bind(this));

This restores the previous behaviour by reverting that change, but narrowing the special case for unindenting closing parentheses to those followed by semicolons and opening braces, i.e. immediate calls and function declarations.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[OpenCL] Test on half immediate support.
Egor Churaev [Mon, 29 May 2017 07:44:22 +0000 (07:44 +0000)]
[OpenCL] Test on half immediate support.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

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

7 years agoIRGen: Add optnone attribute on function during O0
Mehdi Amini [Mon, 29 May 2017 05:38:20 +0000 (05:38 +0000)]
IRGen: Add optnone attribute on function during O0

Amongst other, this will help LTO to correctly handle/honor files
compiled with O0, helping debugging failures.
It also seems in line with how we handle other options, like how
-fnoinline adds the appropriate attribute as well.

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

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

7 years ago[coroutines] Support "coroutines" feature in module map requires clause
Eric Fiselier [Sun, 28 May 2017 21:07:22 +0000 (21:07 +0000)]
[coroutines] Support "coroutines" feature in module map requires clause

Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

7 years ago[coroutines] Diagnose invalid result types for `await_resume` and `await_suspend...
Eric Fiselier [Sun, 28 May 2017 18:21:12 +0000 (18:21 +0000)]
[coroutines] Diagnose invalid result  types for `await_resume` and `await_suspend` and add missing conversions.

Summary:
The expression `await_ready` is required to be contextually convertible to bool and `await_suspend` must be a prvalue of either `void` or `bool`.
This patch adds diagnostics for when those requirements are violated.

It also correctly performs the contextual conversion to bool on the result of `await_ready`

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

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

7 years ago[coroutines] www/cxx_status.html: add non-breaking hyphen
Gor Nishanov [Sun, 28 May 2017 17:35:23 +0000 (17:35 +0000)]
[coroutines] www/cxx_status.html: add non-breaking hyphen

Reviewers: GorNishanov

Reviewed By: GorNishanov

Subscribers: EricWF, rsmith, cfe-commits

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

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

7 years ago[coroutines] www/cxx_status.html: add non-breaking hyphen
Gor Nishanov [Sun, 28 May 2017 16:25:31 +0000 (16:25 +0000)]
[coroutines] www/cxx_status.html: add non-breaking hyphen

Reviewers: GorNishanov

Reviewed By: GorNishanov

Subscribers: EricWF, rsmith, cfe-commits

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

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

7 years agobaremetal.cpp: Fix tests where lib suffix is 64
Ismail Donmez [Sun, 28 May 2017 06:15:42 +0000 (06:15 +0000)]
baremetal.cpp: Fix tests where lib suffix is 64

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

7 years ago[coroutines] Mark cxx_status.html of Coroutines TS as (SVN)
Gor Nishanov [Sat, 27 May 2017 22:54:52 +0000 (22:54 +0000)]
[coroutines] Mark cxx_status.html of Coroutines TS as (SVN)

Summary: It is time!

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov, rsmith

Subscribers: EricWF, rsmith, cfe-commits

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

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

7 years agoRevert "[coroutines] Support "coroutines" feature in module map requires clause"
Eric Fiselier [Sat, 27 May 2017 03:04:51 +0000 (03:04 +0000)]
Revert "[coroutines] Support "coroutines" feature in module map requires clause"

This reverts commit r304054.

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

7 years ago[OpenMP] Create COMDAT group for OpenMP offload registration code to avoid multiple...
George Rokos [Sat, 27 May 2017 03:03:13 +0000 (03:03 +0000)]
[OpenMP] Create COMDAT group for OpenMP offload registration code to avoid multiple copies

Thanks to Sergey Dmitriev for submitting the patch.

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

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

7 years ago[coroutines] Support "coroutines" feature in module map requires clause
Eric Fiselier [Sat, 27 May 2017 02:46:17 +0000 (02:46 +0000)]
[coroutines] Support "coroutines" feature in module map requires clause

Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

7 years agoResubmit r303861.
Konstantin Zhuravlyov [Fri, 26 May 2017 21:08:20 +0000 (21:08 +0000)]
Resubmit r303861.

[AMDGPU] add __builtin_amdgcn_s_getpc

Patch by Tim Corringham

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

7 years agoRemove unused diagnostics. NFC.
Benjamin Kramer [Fri, 26 May 2017 20:14:12 +0000 (20:14 +0000)]
Remove unused diagnostics. NFC.

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

7 years agoMake helper functions static. NFC.
Benjamin Kramer [Fri, 26 May 2017 20:08:24 +0000 (20:08 +0000)]
Make helper functions static. NFC.

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

7 years ago[scan-build] Patch to scan-build tool to support "--target=<value>" flag
Petr Hosek [Fri, 26 May 2017 19:25:32 +0000 (19:25 +0000)]
[scan-build] Patch to scan-build tool to support "--target=<value>" flag

The scan-build script provided by clang can be used to detect defects in
code in the compile time. However, we discovered that the
"--target=<value>" flag in clang is not properly handled by this script,
which results in failures when analyzing projects that have used this
flag in their makefile.

This single line of change allows scan-build script to properly handle
the "--target=<value>" flag.

Patch by Haowei Wu

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

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

7 years agoCodeGen: Define Swift's legal vector types for AArch64, ARM
Arnold Schwaighofer [Fri, 26 May 2017 18:11:54 +0000 (18:11 +0000)]
CodeGen: Define Swift's legal vector types for AArch64, ARM

rdar://32401301

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

7 years agoOnly define __SIZEOF_FLOAT128__ on x86 as intended in r304012
Reid Kleckner [Fri, 26 May 2017 17:48:01 +0000 (17:48 +0000)]
Only define __SIZEOF_FLOAT128__ on x86 as intended in r304012

GCC only defines it on x86.

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

7 years agoEnable __float128 for mingw for GCC compatibility and define __SIZEOF_FLOAT128__...
Reid Kleckner [Fri, 26 May 2017 17:38:15 +0000 (17:38 +0000)]
Enable __float128 for mingw for GCC compatibility and define __SIZEOF_FLOAT128__ on x86

GCC defines __FLOAT128__ on Power and __SIZEOF_FLOAT128__ on x86. We're
just following the inconsistency for now so users have some way to test.

Effectively merges this patch as requested by Martell Malone:
https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-clang/0107-enable-__float128-for-X86-MinGW.patch

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

7 years agoUpdate MS mangling EBNF, NFC
Reid Kleckner [Fri, 26 May 2017 17:11:10 +0000 (17:11 +0000)]
Update MS mangling EBNF, NFC

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

7 years agoAdding a const overload of DesignatedInitExpr::getDesignator().
Aaron Ballman [Fri, 26 May 2017 15:55:52 +0000 (15:55 +0000)]
Adding a const overload of DesignatedInitExpr::getDesignator().

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

7 years agoRevert "[OpenCL] An error shall occur if any scalar operand has greater rank than...
Renato Golin [Fri, 26 May 2017 15:32:45 +0000 (15:32 +0000)]
Revert "[OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element"

This reverts commit r303986 as it broke all ARM and AArch64 buildbots...

http://lab.llvm.org:8011/builders/clang-cmake-aarch64-39vma/builds/7007
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/6705
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/7509
etc.

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

7 years ago[OpenCL] An error shall occur if any scalar operand has greater rank than the type...
Egor Churaev [Fri, 26 May 2017 13:30:26 +0000 (13:30 +0000)]
[OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: cfe-commits, bader, yaxunl

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

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

7 years ago[docs] Point coroutine link to an actual document
George Burgess IV [Fri, 26 May 2017 02:56:51 +0000 (02:56 +0000)]
[docs] Point coroutine link to an actual document

Unsure if there's a better document, but what we had before led to a
404. :)

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

7 years agoCreate valid LValue to represent null pointers in constant exprs
Tim Northover [Fri, 26 May 2017 02:16:00 +0000 (02:16 +0000)]
Create valid LValue to represent null pointers in constant exprs

We were leaving the SubobjectDesignator in a surprising situation, where
it was allegedly valid but didn't actually refer to a type. This caused
a crash later on.

This patch fills out the SubobjectDesignator with the pointee type (as
happens in other evaluations of constant pointers) so that we don't
crash later.

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

7 years agoFactor resolving of header directives -> files out of module map parser.
Richard Smith [Fri, 26 May 2017 00:01:53 +0000 (00:01 +0000)]
Factor resolving of header directives -> files out of module map parser.

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

7 years ago"*" => "+" to avoid matching on empty string.
Richard Trieu [Thu, 25 May 2017 23:25:36 +0000 (23:25 +0000)]
"*" => "+" to avoid matching on empty string.

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