]> granicus.if.org Git - clang/log
clang
8 years ago[CUDA] Remove duplicated test that should have been removed in r276995.
Samuel Antao [Thu, 28 Jul 2016 16:18:31 +0000 (16:18 +0000)]
[CUDA] Remove duplicated test that should have been removed in r276995.

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

8 years ago[CUDA] Rename cuda_phases.cu test to cuda-phases.cu to be consistent with the other...
Samuel Antao [Thu, 28 Jul 2016 16:12:30 +0000 (16:12 +0000)]
[CUDA] Rename cuda_phases.cu test to cuda-phases.cu to be consistent with the other tests.

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

8 years ago[OpenMP] Change name of variable in mappble expression.
Samuel Antao [Thu, 28 Jul 2016 15:31:29 +0000 (15:31 +0000)]
[OpenMP] Change name of variable in mappble expression.

This attempts to fix a failure in Windows bots pottentially related with a reserved keyword.

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

8 years ago[OpenMP] Fix link command pattern in offloading interoperability test.
Samuel Antao [Thu, 28 Jul 2016 14:56:19 +0000 (14:56 +0000)]
[OpenMP] Fix link command pattern in offloading interoperability test.

It was causing a few bots to fail.

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

8 years ago[OpenMP] Do not use default argument in lambda from mappable expressions handlers.
Samuel Antao [Thu, 28 Jul 2016 14:47:35 +0000 (14:47 +0000)]
[OpenMP] Do not use default argument in lambda from mappable expressions handlers.

Windows bots were complaining about that.

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

8 years ago[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.
Samuel Antao [Thu, 28 Jul 2016 14:29:18 +0000 (14:29 +0000)]
[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.

Summary:
This patch prevents OpenMP flags from being forwarded to CUDA device commands. That was causing the CUDA frontend to attempt to emit OpenMP code which is not supported.

This fixes the bug reported in https://llvm.org/bugs/show_bug.cgi?id=28723.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, tra, ABataev

Subscribers: caomhin, cfe-commits

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

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

8 years ago[OpenMP] Code generation for the is_device_ptr clause
Samuel Antao [Thu, 28 Jul 2016 14:25:09 +0000 (14:25 +0000)]
[OpenMP] Code generation for the is_device_ptr clause

Summary: This patch adds support for the is_device_ptr clause. It expands SEMA to use the mappable expression logic that can only be tested with code generation in place and check conflicts with other data sharing related clauses using the mappable expressions infrastructure.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

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

8 years ago[OpenMP] Codegen for use_device_ptr clause.
Samuel Antao [Thu, 28 Jul 2016 14:23:26 +0000 (14:23 +0000)]
[OpenMP] Codegen for use_device_ptr clause.

Summary: This patch adds support for the use_device_ptr clause. It includes changes in SEMA that could not be tested without codegen, namely, the use of the first private logic and mappable expressions support.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

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

8 years agoReapply r276856 "Adjust Registry interface to not require plugins to export a registry"
John Brawn [Thu, 28 Jul 2016 12:48:17 +0000 (12:48 +0000)]
Reapply r276856 "Adjust Registry interface to not require plugins to export a registry"

This version has two fixes compared to the original:
 * In Registry.h the template static members are instantiated before they are
   used, as clang gives an error if you do it the other way around.
 * The use of the Registry template in clang-tidy is updated in the same way as
   has been done everywhere else.

Original commit message:

Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.

This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.

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

8 years ago[AArch64] Using AArch64TargetParser in Clang.
Zijiao Ma [Thu, 28 Jul 2016 06:24:48 +0000 (06:24 +0000)]
[AArch64] Using AArch64TargetParser in Clang.

This resubmit r270688 which broke some specific buildbots.That's because
there is incorrect indexing problem in the targetparser,and the problem is
fixed in r276957.

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

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

8 years ago[analyzer] Add check::BeginFunction to CheckerDocumentation checks. NFC.
Devin Coughlin [Thu, 28 Jul 2016 00:52:10 +0000 (00:52 +0000)]
[analyzer] Add check::BeginFunction to CheckerDocumentation checks. NFC.

This was an oversight from when I added BeginFunction support in r261293.

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

8 years agoReplace preserve-as-comments CodeGen test with driver test
Nirav Dave [Thu, 28 Jul 2016 00:36:34 +0000 (00:36 +0000)]
Replace preserve-as-comments CodeGen test with driver test

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

8 years agoRetry: [Driver] Compute effective target triples once per job (NFCI)
Vedant Kumar [Wed, 27 Jul 2016 23:02:20 +0000 (23:02 +0000)]
Retry: [Driver] Compute effective target triples once per job (NFCI)

Compute an effective triple once per job. Cache the triple in the
prevailing ToolChain for the duration of the job.

Clients which need effective triples now look them up in the ToolChain.
This eliminates wasteful re-computation of effective triples (e.g in
getARMFloatABI()).

While we're at it, delete MachO::ComputeEffectiveClangTriple. It was a
no-op override.

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

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

8 years agoRevert "[Driver] Compute effective target triples once per job (NFCI)"
Vedant Kumar [Wed, 27 Jul 2016 23:01:55 +0000 (23:01 +0000)]
Revert "[Driver] Compute effective target triples once per job (NFCI)"

This reverts commit r275895 in order to address some post-commit review
feedback from Eric Christopher (see: the list thread for r275895).

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

8 years ago[OpenMP] Add support to map member expressions with references to pointers.
Samuel Antao [Wed, 27 Jul 2016 22:52:16 +0000 (22:52 +0000)]
[OpenMP] Add support to map member expressions with references to pointers.

Summary: This patch add support to map pointers through references in class members. Although a reference does not have storage that a user can access, it still has to be mapped in order to get the deep copy right and the dereferencing code work properly.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

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

8 years ago[OpenMP] Add support for mapping array sections through pointer references.
Samuel Antao [Wed, 27 Jul 2016 22:49:49 +0000 (22:49 +0000)]
[OpenMP] Add support for mapping array sections through pointer references.

Summary:
This patch fixes a bug in the map of array sections whose base is a reference to a pointer. The existing mapping support was not prepared to deal with it, causing the compiler to crash.

Mapping a reference to a pointer enjoys the same characteristics of a regular pointer, i.e., it is passed by value. Therefore, the reference has to be materialized in the target region.

Reviewers: hfinkel, carlo.bertolli, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

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

8 years agoBasic/Targets.cpp: Reformat aarch64 CPU list.
Matthias Braun [Wed, 27 Jul 2016 22:47:09 +0000 (22:47 +0000)]
Basic/Targets.cpp: Reformat aarch64 CPU list.

Having 1 entry per line and an alphabetical order is clearer and reduces
the risk of invalid merges.

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

8 years agotest/Frontend: Add a test for aarch64 target CPU names.
Matthias Braun [Wed, 27 Jul 2016 22:47:07 +0000 (22:47 +0000)]
test/Frontend: Add a test for aarch64 target CPU names.

Nothing else checked the target cpu names for aarch64 yet.
Add a test in the spirit of x86-target-cpu.c.

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

8 years agoRefactor how include paths are appended to the command arguments.
Samuel Antao [Wed, 27 Jul 2016 22:46:31 +0000 (22:46 +0000)]
Refactor how include paths are appended to the command arguments.

Summary:
This patch aims at removing redundancy in the way include paths for the regular and offloading toolchains are appended to the arguments list in the clang tool.

This was suggested by @rsmith in response to r275931.

Reviewers: rsmith, tra

Subscribers: rsmith, cfe-commits

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

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

8 years ago[CUDA] Align kernel launch args correctly when the LLVM type's alignment is different...
Justin Lebar [Wed, 27 Jul 2016 22:36:21 +0000 (22:36 +0000)]
[CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment.

Summary:
Before this patch, we computed the offsets in memory of args passed to
GPU kernel functions by throwing all of the args into an LLVM struct.

clang emits packed llvm structs basically whenever it feels like it, and
packed structs have alignment 1.  So we cannot rely on the llvm type's
alignment matching the C++ type's alignment.

This patch fixes our codegen so we always respect the clang types'
alignments.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

8 years agoDon't crash when generating code for __attribute__((naked)) member functions.
Justin Lebar [Wed, 27 Jul 2016 22:04:24 +0000 (22:04 +0000)]
Don't crash when generating code for __attribute__((naked)) member functions.

Summary:
Previously this crashed inside EmitThisParam().  There should be no
prelude for naked functions, so just skip the whole thing.

Reviewers: majnemer

Subscribers: llvm-commits

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

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

8 years agoAdd target triple in test
Nirav Dave [Wed, 27 Jul 2016 20:48:39 +0000 (20:48 +0000)]
Add target triple in test

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

8 years agotest commit
Matt Masten [Wed, 27 Jul 2016 20:23:32 +0000 (20:23 +0000)]
test commit

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

8 years agoAdd flags to toggle preservation of assembly comments
Nirav Dave [Wed, 27 Jul 2016 19:57:40 +0000 (19:57 +0000)]
Add flags to toggle preservation of assembly comments

Summary: Add -fpreserve-as-comments and -fno-preserve-as-comments.

Reviewers: echristo, rnk

Subscribers: mehdi_amini, llvm-commits

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

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

8 years agoAdjust coercion of aggregates on RenderScript
Pirama Arumuga Nainar [Wed, 27 Jul 2016 19:01:51 +0000 (19:01 +0000)]
Adjust coercion of aggregates on RenderScript

Summary:
In RenderScript, the size of the argument or return value emitted in the
IR is expected to be the same as the size of corresponding qualified
type.  For ARM and AArch64, the coercion performed by Clang can
change the parameter or return value to a type whose size is different
(usually larger) than the original aggregate type.  Specifically, this
can happen in the following cases:
    - Aggregate parameters of size <= 64 bytes and return values smaller
      than 4 bytes on ARM
    - Aggregate parameters and return values smaller than bytes on
      AArch64

This patch coerces the cases above to an integer array that is the same
size and alignment as the original aggregate.  A new field is added to
TargetInfo to detect a RenderScript target and limit this coercion just
to that case.

Tests added to test/CodeGen/renderscript.c

Reviewers: rsmith

Subscribers: aemerson, srhines, llvm-commits

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

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

8 years ago[Sema] Teach getCurrentThisType to reconize lambda in in-class initializer
Erik Pilkington [Wed, 27 Jul 2016 18:25:10 +0000 (18:25 +0000)]
[Sema] Teach getCurrentThisType to reconize lambda in in-class initializer

Fixes PR27994, a crash on valid.

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

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

8 years agoUpdate Clang Parser test error message to match new parser errors
Nirav Dave [Wed, 27 Jul 2016 17:39:47 +0000 (17:39 +0000)]
Update Clang Parser test error message to match new parser errors

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

8 years agoUsersManual.rst: update clang-cl option list
Hans Wennborg [Wed, 27 Jul 2016 16:56:03 +0000 (16:56 +0000)]
UsersManual.rst: update clang-cl option list

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

8 years agoFix unnecessary default switch warning
Simon Pilgrim [Wed, 27 Jul 2016 16:41:56 +0000 (16:41 +0000)]
Fix unnecessary default switch warning

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

8 years agoUpdate cxx_dr_Status after 3.9 branch
Hans Wennborg [Wed, 27 Jul 2016 16:39:45 +0000 (16:39 +0000)]
Update cxx_dr_Status after 3.9 branch

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

8 years agoImplement filtering for code completion of identifiers.
Vassil Vassilev [Wed, 27 Jul 2016 14:56:59 +0000 (14:56 +0000)]
Implement filtering for code completion of identifiers.

Patch by Cristina Cristescu and Axel Naumann!

Agreed on post commit review (D17820).

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

8 years ago[ARM] Pass thumb as architecture to the underlying tools, when targeting windows
Renato Golin [Wed, 27 Jul 2016 14:12:20 +0000 (14:12 +0000)]
[ARM] Pass thumb as architecture to the underlying tools, when targeting windows

This makes sure that the thumb section flag gets set by the assembler.

Patch by Martin Storsjö.

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

8 years agoRevert r276856 "Adjust Registry interface to not require plugins to export a registry"
John Brawn [Wed, 27 Jul 2016 11:41:18 +0000 (11:41 +0000)]
Revert r276856 "Adjust Registry interface to not require plugins to export a registry"

This is causing a huge pile of buildbot failures.

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

8 years agoAdjust Registry interface to not require plugins to export a registry
John Brawn [Wed, 27 Jul 2016 11:18:38 +0000 (11:18 +0000)]
Adjust Registry interface to not require plugins to export a registry

Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.

This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.

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

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

8 years agoclang-format: Fix incorrect detection of QT-signals access specifier.
Daniel Jasper [Wed, 27 Jul 2016 10:13:24 +0000 (10:13 +0000)]
clang-format: Fix incorrect detection of QT-signals access specifier.

Before:
  void f() {
  label:
    signals
    .baz();
  }

After:
  void f() {
  label:
    signals.baz();
  }

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

8 years ago[ARM] Pass -mimplcit-it= to integrated assembler
Oliver Stannard [Wed, 27 Jul 2016 08:54:13 +0000 (08:54 +0000)]
[ARM] Pass -mimplcit-it= to integrated assembler

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

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

8 years agoSupport setting default value for -rtlib at build time
Jonas Hahnfeld [Wed, 27 Jul 2016 08:15:54 +0000 (08:15 +0000)]
Support setting default value for -rtlib at build time

This patch introduces a new cmake variable: CLANG_DEFAULT_RTLIB, thru
which we can specify a default value for -rtlib (libgcc or
compiler-rt) at build time, just like how we set the default C++
stdlib thru CLANG_DEFAULT_CXX_STDLIB.

With these two options, we can configure clang to build binaries on
Linux that have no runtime dependence on any gcc libs (libstdc++ or
libgcc_s).

Patch by Lei Zhang!

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

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

8 years agoFix for compiling with clang <= 3.7 and g++6 headers
Vedant Kumar [Wed, 27 Jul 2016 03:43:34 +0000 (03:43 +0000)]
Fix for compiling with clang <= 3.7 and g++6 headers

Make integers explicitly unsigned, so the tuple constructor will resolve
properly when but with clang 3.6, 3.7 and gcc 6.1.1 libstdc++ headers.

Patch by Frederich Munch!

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

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

8 years agoModules: follow up to r276769.
Manman Ren [Tue, 26 Jul 2016 19:56:12 +0000 (19:56 +0000)]
Modules: follow up to r276769.

In r276769, I forgot to forward the driver option, add that here.

rdar://26675801

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

8 years ago[analyzer] Hotfix for build failure due to declaration shadowing in r276782.
Artem Dergachev [Tue, 26 Jul 2016 19:05:22 +0000 (19:05 +0000)]
[analyzer] Hotfix for build failure due to declaration shadowing in r276782.

CloneDetector member variable is shadowing the class with the same name,
which causes build failures on some platforms.

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

8 years ago[analyzer] Add basic capabilities to detect source code clones.
Artem Dergachev [Tue, 26 Jul 2016 18:13:12 +0000 (18:13 +0000)]
[analyzer] Add basic capabilities to detect source code clones.

This patch adds the CloneDetector class which allows searching source code
for clones.

For every statement or group of statements within a compound statement,
CloneDetector computes a hash value, and finds clones by detecting
identical hash values.

This initial patch only provides a simple hashing mechanism
that hashes the kind of each sub-statement.

This patch also adds CloneChecker - a simple static analyzer checker
that uses CloneDetector to report copy-pasted code.

Patch by Raphael Isemann!

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

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

8 years agoModules: add command line option fmodules-disable-diagnostic-validation
Manman Ren [Tue, 26 Jul 2016 17:12:17 +0000 (17:12 +0000)]
Modules: add command line option fmodules-disable-diagnostic-validation

With PCH+Module, sometimes compiler gives a hard error:
Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt

This happens when we have a pch importing a module and the module gets
overwritten by another compiler instance after we build the pch (one example is
that both compiler instances hash to the same pcm file but use different
diagnostic options). When we try to load the pch later on, the compiler notices
that the imported module is out of date (modification date, size do not match)
but it can't handle this out of date pcm (i.e it does not know how to rebuild
the pch).

This commit introduces a new command line option so for PCH + module, we can
turn on this option and if two compiler instances only differ in diagnostic
options, the latter instance will not invalidate the original pcm.

rdar://26675801
Differential Revision: http://reviews.llvm.org/D22773

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

8 years agoRevert "Make RecursiveASTVisitor visit lambda capture initialization expressions"
Martin Bohme [Tue, 26 Jul 2016 16:01:55 +0000 (16:01 +0000)]
Revert "Make RecursiveASTVisitor visit lambda capture initialization expressions"

This reverts commit r276755.

(Broke clang-tidy check modernize-loop-convert.)

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

8 years agoUpdate for LLVM changes
David Majnemer [Tue, 26 Jul 2016 15:21:18 +0000 (15:21 +0000)]
Update for LLVM changes

InstSimplify has gained the ability to remove needless bitcasts which
perturbed some clang codegen tests.

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

8 years agoMake RecursiveASTVisitor visit lambda capture initialization expressions
Martin Bohme [Tue, 26 Jul 2016 15:19:10 +0000 (15:19 +0000)]
Make RecursiveASTVisitor visit lambda capture initialization expressions

Summary:
Lambda capture initializations are part of the explicit source code and therefore should be visited by default but, so far, RecursiveASTVisitor does not visit them.

This appears to be an oversight. Because the lambda body needs custom handling (calling TraverseLambdaBody()), the DEF_TRAVERSE_STMT for LambdaExpr sets ShouldVisitChildren to false but then neglects to visit the lambda capture initializations. This patch adds code to visit the expressions associated with lambda capture initializations.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

8 years ago[Tooling] skip anonymous namespaces when checking if typeLoc references a type decl...
Eric Liu [Tue, 26 Jul 2016 14:53:05 +0000 (14:53 +0000)]
[Tooling] skip anonymous namespaces when checking if typeLoc references a type decl from a different canonical namespace.

Summary:
[Tooling] skip anonymous namespaces when checking if typeLoc
references a type decl from a different canonical namespace.

Reviewers: bkramer

Subscribers: cfe-commits, klimek

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

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

8 years agoUpdate for LLVM changes
David Majnemer [Tue, 26 Jul 2016 05:52:37 +0000 (05:52 +0000)]
Update for LLVM changes

InstSimplify has gained the ability to remove needless bitcasts which
perturbed some clang codegen tests.

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

8 years ago[OpenMP] diagnose orphaned teams construct
Kelvin Li [Tue, 26 Jul 2016 04:32:50 +0000 (04:32 +0000)]
[OpenMP] diagnose orphaned teams construct

The OpenMP spec mandates that 'a teams construct must be contained within a
target construct'. Currently, this scenario is not diagnosed. This patch is
to add check for orphaned teams construct and issue an error message.

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

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

8 years ago[Coverage] Do not write out coverage mappings with zero entries
Vedant Kumar [Tue, 26 Jul 2016 00:24:59 +0000 (00:24 +0000)]
[Coverage] Do not write out coverage mappings with zero entries

After r275121, we stopped mapping regions from system headers. Lambdas
declared in regions belonging to system headers started producing empty
coverage mappings, since the files corresponding to their spelling locs
were being ignored.

The coverage reader doesn't know what to do with these empty mappings.
This commit makes sure that we don't produce them and adds a test. I'll
make the reader stricter in a follow-up commit.

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

8 years ago[CMake] Pass DYLD_LIBRARY_PATH as CMake variable instead of as envar
Chris Bieneman [Mon, 25 Jul 2016 23:48:14 +0000 (23:48 +0000)]
[CMake] Pass DYLD_LIBRARY_PATH as CMake variable instead of as envar

On OS X 10.11 System Integrity Protection prevents the DYLD environment variables from being set on system binaries. To work around this r276710 accepts DYLD_LIBRARY_PATH as a CMake variable and sets it directly on the archiver commands.

To make this work with bootstrapping we need to set DYLD_LIBRARY_PATH to the current stage's library directory and pass that into the next stage's configuration.

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

8 years ago[Sema][ObjC] Compute the nullability of a conditional expression based
Akira Hatanaka [Mon, 25 Jul 2016 21:58:19 +0000 (21:58 +0000)]
[Sema][ObjC] Compute the nullability of a conditional expression based
on the nullabilities of its operands.

This commit is a follow-up to r276076 and enables
computeConditionalNullability to compute the merged nullability when
the operands are objective-c pointers.

rdar://problem/22074116

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

8 years ago[CMake] Cleaning up some CMake warnings
Chris Bieneman [Mon, 25 Jul 2016 18:54:30 +0000 (18:54 +0000)]
[CMake] Cleaning up some CMake warnings

In Bootstrap builds Clang logs some warnings. These are caused because Clang passes CLANG_STAGE and BOOTSTRAP_DEFAULT_PASSTHROUGH into the next stage's configuration.

BOOTSTRAP_DEFAULT_PASSTHROUGH shouldn't be passed, so it is renamed to _BOOTSTRAP_DEFAULT_PASSTHROUGH, to prevent passthrough.

CLANG_STAGE should be passed, so I've changed the code to log it if it is set outside the if(CLANG_ENABLE_BOOTSTRAP) block. This makes the variable always used, so the warning goes away.

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

8 years ago[cc1as] Add MCTargetOptions argument to createAsmBackend
Joel Jones [Mon, 25 Jul 2016 17:18:44 +0000 (17:18 +0000)]
[cc1as] Add MCTargetOptions argument to createAsmBackend

Allow an assembler backend to get ABI options. This is to match the changes
to http://reviews.llvm.org/D16213.

Tested with "make check-clang"

Patch by: Joel Jones

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

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

8 years agoSupport '#pragma once' in headers when using PCH
Sunil Srivastava [Mon, 25 Jul 2016 17:17:06 +0000 (17:17 +0000)]
Support '#pragma once' in headers when using PCH

The '#pragma once' directive was erroneously ignored when encountered
in the header-file specified in generate-PCH-mode. This resulted in
compile-time errors in some cases with legal code, and also a misleading
warning being produced.

Patch by Warren Ristow!

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

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

8 years ago[Myriad]: better compatibility with vendor source
Douglas Katzman [Mon, 25 Jul 2016 16:36:02 +0000 (16:36 +0000)]
[Myriad]: better compatibility with vendor source

- Accept ma{2100,2150,2150} for -mcpu
- Define more preprocessor macros
- Don't append "le/" to little-endian lib dirs

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

8 years agoMPI-Checker: move MPIFunctionClassifier.h
Alexander Kornienko [Mon, 25 Jul 2016 15:27:16 +0000 (15:27 +0000)]
MPI-Checker: move  MPIFunctionClassifier.h

Summary:
This patch moves the MPIFunctionClassifier header to `clang/include/clang/StaticAnalyzer/Checkers`,
in order to make it accessible in other parts of the architecture.

Reviewers: dcoughlin, zaks.anna

Subscribers: alexfh, cfe-commits

Patch by Alexander Droste!

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

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

8 years agoUpdate description for CLANG_DEFAULT_CXX_STDLIB and add comment. NFC
Jonas Hahnfeld [Mon, 25 Jul 2016 08:04:26 +0000 (08:04 +0000)]
Update description for CLANG_DEFAULT_CXX_STDLIB and add comment. NFC

We agreed to call it "platform default" instead of "architecture default".
(see D17286)

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

8 years agoUpdate test to account for r276604
David Majnemer [Mon, 25 Jul 2016 04:47:45 +0000 (04:47 +0000)]
Update test to account for r276604

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

8 years ago[MSVCToolChain] Guard hardcoded Windows paths with LLVM_ON_WIN32
David Majnemer [Mon, 25 Jul 2016 04:47:44 +0000 (04:47 +0000)]
[MSVCToolChain] Guard hardcoded Windows paths with LLVM_ON_WIN32

Paths like C:/foo will never work on UNIX platforms, don't bother
implicitly adding them to the search path.

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

8 years ago[Sema] Replace mem_fn with lambdas. NFC.
George Burgess IV [Sun, 24 Jul 2016 23:12:40 +0000 (23:12 +0000)]
[Sema] Replace mem_fn with lambdas. NFC.

I'm told that some optimizers like lambdas a lot more than mem_fn.
Given that the readability difference is basically nil, and we seem to
use lambdas basically everywhere else, it seems sensible to just use
lambdas.

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

8 years ago[Driver] Switch some getenv calls to llvm::sys::Process::GetEnv
David Majnemer [Sun, 24 Jul 2016 17:44:03 +0000 (17:44 +0000)]
[Driver] Switch some getenv calls to llvm::sys::Process::GetEnv

No functional change is intended.

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

8 years ago[X86] Block pbroadcastq instructions on 32-bit targets instead of pbroadcastb.
Craig Topper [Sun, 24 Jul 2016 14:58:06 +0000 (14:58 +0000)]
[X86] Block pbroadcastq instructions on 32-bit targets instead of pbroadcastb.

Thanks to Simon Pilgrim for catching the mistake.

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

8 years ago[analyzer] Pring LocationContext in ExplodedGraph dumps.
Artem Dergachev [Sun, 24 Jul 2016 08:15:58 +0000 (08:15 +0000)]
[analyzer] Pring LocationContext in ExplodedGraph dumps.

Remove some FIXMEs in the surrounding code,
which have been addressed long time ago
by introducing checker-specific tags.

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

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

8 years ago[Profile] Use a flag to enable PGO rather than the profraw filename
Xinliang David Li [Sat, 23 Jul 2016 04:28:59 +0000 (04:28 +0000)]
[Profile] Use a flag to enable PGO rather than the profraw filename

Patch by Jake VanAdrighem

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

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

8 years ago[cxx1z-constexpr-lambda] Make a lambda's closure type eligible as a literal-type...
Faisal Vali [Sat, 23 Jul 2016 04:05:19 +0000 (04:05 +0000)]
[cxx1z-constexpr-lambda] Make a lambda's closure type eligible as a literal-type in C++1z

Additionally, for pre-C++1z, instead of forbidding a lambda's closure type from being a literal type through circumlocutorily setting HasNonLiteralTypeFieldsOrBases falsely to true -- handle lambda's more directly in CXXRecordDecl::isLiteral().

One additional small step towards implementing constexpr-lambdas.

Thanks to Richard Smith for his review!
https://reviews.llvm.org/D22662

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

8 years agoWork around MSVC's lack of support for unrestricted unions by making this
Richard Smith [Sat, 23 Jul 2016 02:39:52 +0000 (02:39 +0000)]
Work around MSVC's lack of support for unrestricted unions by making this
struct a bit bigger under MSVC (this shouldn't be a big deal; we typically
allocate no more than two of these at a time, on the stack).

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

8 years agoAdd -fmodules-ts flag to cc1 for the provisional C++ modules TS, and mark
Richard Smith [Sat, 23 Jul 2016 02:32:21 +0000 (02:32 +0000)]
Add -fmodules-ts flag to cc1 for the provisional C++ modules TS, and mark
'module' and 'import' as keywords when the flag is specified.

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

8 years agoAdd doxygen comments to emmintrin.h's intrinsics.
Ekaterina Romanova [Fri, 22 Jul 2016 23:49:37 +0000 (23:49 +0000)]
Add doxygen comments to emmintrin.h's intrinsics.

Only around 50% of the intrinsics in this file are documented now. The patches for the rest of the intrisics in this file will be send out later.

The doxygen comments are automatically generated based on Sony's intrinsics docu
ment.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream. This patch was internally reviewed by Paul Robinson.

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

8 years agoP0217R3: Parsing support and framework for AST representation of C++1z
Richard Smith [Fri, 22 Jul 2016 23:36:59 +0000 (23:36 +0000)]
P0217R3: Parsing support and framework for AST representation of C++1z
decomposition declarations.

There are a couple of things in the wording that seem strange here:
decomposition declarations are permitted at namespace scope (which we partially
support here) and they are permitted as the declaration in a template (which we
reject).

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

8 years ago[Profile] Enable profile merging with -fprofile-generat[=<dir>]
Xinliang David Li [Fri, 22 Jul 2016 22:25:01 +0000 (22:25 +0000)]
[Profile] Enable profile merging with -fprofile-generat[=<dir>]

This patch enables raw profile merging for this option which is the
new intended behavior.

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

8 years ago[modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.
Vassil Vassilev [Fri, 22 Jul 2016 21:08:24 +0000 (21:08 +0000)]
[modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.

Processing update records (and loading a module, in general) might trigger
unexpected calls to the ASTWriter (being a mutation listener). Now we have a
mechanism to suppress those calls to the ASTWriter but notify other possible
mutation listeners.

Fixes https://llvm.org/bugs/show_bug.cgi?id=28332

Patch by Cristina Cristescu and me.

Reviewed by Richard Smith (D21800).

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

8 years agoAdd regression test for PR27699.
Vassil Vassilev [Fri, 22 Jul 2016 20:49:31 +0000 (20:49 +0000)]
Add regression test for PR27699.

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

8 years agoAdd .rgba syntax extension to ext_vector_type types
Pirama Arumuga Nainar [Fri, 22 Jul 2016 18:49:43 +0000 (18:49 +0000)]
Add .rgba syntax extension to ext_vector_type types

Summary:
This patch enables .rgba accessors to ext_vector_type types and adds
tests for syntax validation and code generation.

'a' and 'b' can appear either in the point access mode or the numeric
access mode (for indices 10 and 11).  To disambiguate between the two
usages, the accessor type is explicitly passed to relevant methods.

Reviewers: rsmith

Subscribers: Anastasia, bader, srhines, cfe-commits

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

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

8 years agoClang changes for overloading invariant.start and end intrinsics
Anna Thomas [Fri, 22 Jul 2016 17:50:08 +0000 (17:50 +0000)]
Clang changes for overloading invariant.start and end intrinsics

This change depends on the corresponding LLVM change at:
https://reviews.llvm.org/D22519

The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address
space.

With this LLVM change, these intrinsics are overloaded for any adddress space
for memory objects and we can use these llvm invariant intrinsics in
non-default address spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant
memory in managed languages.

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

8 years agotest commit. update comment grammatically. NFC
Anna Thomas [Fri, 22 Jul 2016 15:37:56 +0000 (15:37 +0000)]
test commit. update comment grammatically. NFC

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

8 years ago[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 with generic IR
Simon Pilgrim [Fri, 22 Jul 2016 13:58:56 +0000 (13:58 +0000)]
[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 with generic IR

As discussed on D22460, I've updated the vbroadcastf128 pd256/ps256 builtins to map directly to generic IR - load+splat a 128-bit vector to both lanes of a 256-bit vector.

Fix for PR28657.

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

8 years ago[Coverage] Attempt to appease a Windows builder
Vedant Kumar [Fri, 22 Jul 2016 00:25:09 +0000 (00:25 +0000)]
[Coverage] Attempt to appease a Windows builder

The builder prints out the following IR:

  \5CCoverageMapping\5COutput\5Ctest\5Cf1.c

The updated test in r276367 expects path separators to be either '/' or
'\\', so it chokes on the unexpected "5C" stuff. I'm not sure what that
is, but I included a kludge that should work around it.

Failing bot:

  http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8718

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

8 years ago[Coverage] Strengthen a test case
Vedant Kumar [Fri, 22 Jul 2016 00:00:02 +0000 (00:00 +0000)]
[Coverage] Strengthen a test case

We should be able to use `mkdir` without turning on `REQUIRES: shell`.
Moreover, this test should check for a path separator which precedes the
relative filename to make sure that absolute paths are being used.

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

8 years ago[analyzer] Add checker modeling potential C++ self-assignment
Devin Coughlin [Thu, 21 Jul 2016 23:42:31 +0000 (23:42 +0000)]
[analyzer] Add checker modeling potential C++ self-assignment

This checker checks copy and move assignment operators whether they are
protected against self-assignment. Since C++ core guidelines discourages
explicit checking for `&rhs==this` in general we take a different approach: in
top-frame analysis we branch the exploded graph for two cases, where &rhs==this
and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the
work. It is important that we check all copy and move assignment operator in top
frame even if we checked them already since self-assignments may happen
undetected even in the same translation unit (e.g. using random indices for an
array what may or may not be the same).

This reapplies r275820 after fixing a string-lifetime issue discovered by the
bots.

A patch by Ádám Balogh!

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

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

8 years agoReverting r275115 which caused PR28634.
Wolfgang Pieb [Thu, 21 Jul 2016 23:28:18 +0000 (23:28 +0000)]
Reverting r275115 which caused PR28634.
When empty (forwarding) basic blocks that are referenced by user labels
are removed, incorrect code may be generated.

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

8 years ago[profile] update test case with interface change.
Xinliang David Li [Thu, 21 Jul 2016 23:19:39 +0000 (23:19 +0000)]
[profile] update test case with interface change.

See http://reviews.llvm.org/D22613, http://reviews.llvm.org/D22614

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

8 years ago[Sema] Handle errors during rewriteBuiltinFunctionDecl
David Majnemer [Thu, 21 Jul 2016 23:03:43 +0000 (23:03 +0000)]
[Sema] Handle errors during rewriteBuiltinFunctionDecl

rewriteBuiltinFunctionDecl can encounter errors when performing
DefaultFunctionArrayLvalueConversion.  These errors were not handled
which led to a null pointer dereference.

This fixes PR28651.

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

8 years ago[CodeGen] Fix a crash when constant folding switch statement
Erik Pilkington [Thu, 21 Jul 2016 22:31:40 +0000 (22:31 +0000)]
[CodeGen] Fix a crash when constant folding switch statement

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

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

8 years agoDisable a flaky test on Windows that uses "echo >>"
Reid Kleckner [Thu, 21 Jul 2016 21:07:47 +0000 (21:07 +0000)]
Disable a flaky test on Windows that uses "echo >>"

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

8 years agoReroll "Include unreferenced nested types in member list only for CodeView"
Adrian McCarthy [Thu, 21 Jul 2016 18:43:20 +0000 (18:43 +0000)]
Reroll "Include unreferenced nested types in member list only for CodeView"

Another attempt at r276271, hopefully without breaking ModuleDebugInfo test.

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

8 years agoMove some IntrusiveRefCntPtrs instead of copying.
Benjamin Kramer [Thu, 21 Jul 2016 15:06:51 +0000 (15:06 +0000)]
Move some IntrusiveRefCntPtrs instead of copying.

No functionality change intended.

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

8 years agoRevert "Include unreferenced nested types in member list only for CodeView"
Adrian McCarthy [Thu, 21 Jul 2016 13:41:25 +0000 (13:41 +0000)]
Revert "Include unreferenced nested types in member list only for CodeView"

Patch broke ModuleDebugInfo test on the build bots (but not locally).  Again.

svn revision:  r276271

This reverts commit 9da8a1b05362bc96f2855fb32b5588b89407685d.

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

8 years agoInclude unreferenced nested types in member list only for CodeView
Adrian McCarthy [Thu, 21 Jul 2016 13:16:14 +0000 (13:16 +0000)]
Include unreferenced nested types in member list only for CodeView

Unreferenced nested structs and classes were omitted from the debug info.  In DWARF, this was intentional, to avoid bloat.  But for CodeView, we want this information to be consistent with what Microsoft tools would produce and expect.

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

8 years agoProvide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu language...
Yaron Keren [Thu, 21 Jul 2016 07:44:41 +0000 (07:44 +0000)]
Provide __GLIBCXX_TYPE_INT_N_0 and __GLIBCXX_BITSIZE_INT_N_0 when in C++ gnu language extensions.
These are used by libstdc++ <type_traits> for is_integral<__int128>.
Addresses http://llvm.org/pr23156.

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

8 years ago[Sema,X86] Add explicit check to ensure that builtins that require x86-64 target...
Craig Topper [Thu, 21 Jul 2016 07:38:43 +0000 (07:38 +0000)]
[Sema,X86] Add explicit check to ensure that builtins that require x86-64 target throw an error if used on 32-bit target.

If these builtins are allowed to go through on a 32-bit target they will fire assertions in the backend.

Fixes PR28635.

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

8 years ago[X86] Add missing __x86_64__ qualifiers on a bunch of intrinsics that assume 64-bit...
Craig Topper [Thu, 21 Jul 2016 07:38:39 +0000 (07:38 +0000)]
[X86] Add missing __x86_64__ qualifiers on a bunch of intrinsics that assume 64-bit GPRs are available.

Usages of these intrinsics in a 32-bit build results in assertions in the backend.

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

8 years ago[CodeGen] Handle recursion in LLVMIRGeneration Timer.
Davide Italiano [Thu, 21 Jul 2016 06:28:48 +0000 (06:28 +0000)]
[CodeGen] Handle recursion in LLVMIRGeneration Timer.

This can happen when emitting a local decl, which triggers
loading a decl imported from an AST file, which we then
hand to the AST consumer. Timer is not allowed to recurse
so an assertion fire. Keep a reference counter to avoid this
problem. LGTM'd by Richard Smith on IRC.

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

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

8 years ago[Sema] Fix PR28623.
George Burgess IV [Thu, 21 Jul 2016 03:28:13 +0000 (03:28 +0000)]
[Sema] Fix PR28623.

In atomic builtins, we assumed that the LValue conversion on the first
argument would succeed. So, we would crash given code like:

```
void ovl(char);
void ovl(int);
__atomic_store_n(ovl, 0, 0);
```

This patch makes us not assume that said conversion is successful. :)

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

8 years ago[Profile] Document new profile file name modifiers
Xinliang David Li [Wed, 20 Jul 2016 23:32:50 +0000 (23:32 +0000)]
[Profile] Document new profile file name modifiers

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

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

8 years ago[OpenMP] Sema and parsing for 'target simd' pragma
Kelvin Li [Wed, 20 Jul 2016 22:57:10 +0000 (22:57 +0000)]
[OpenMP] Sema and parsing for 'target simd' pragma

This patch is to implement sema and parsing for 'target simd' pragma.

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

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

8 years agoFix memory leak introduced in r276159.
Richard Smith [Wed, 20 Jul 2016 21:38:26 +0000 (21:38 +0000)]
Fix memory leak introduced in r276159.

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

8 years agoWhen copying an array into a lambda, destroy temporaries from
John McCall [Wed, 20 Jul 2016 21:02:43 +0000 (21:02 +0000)]
When copying an array into a lambda, destroy temporaries from
the copy-constructor immediately and enter a partial array
cleanup for previously-copied elements.

Fixes PR28595.

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

8 years ago[OpenMP] Allow negative lower bound in array sections based on pointers
Kelvin Li [Wed, 20 Jul 2016 20:45:29 +0000 (20:45 +0000)]
[OpenMP] Allow negative lower bound in array sections based on pointers

OpenMP 4.5 removed the restriction that array section lower bound must be non negative.
This change is to allow negative values for array section based on pointers.
For array section based on array type there is still a restriction: "The array section must be a subset of the original array."

Patch by David S.

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

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

8 years ago[OpenMP] Ignore parens in atomic capture
Kelvin Li [Wed, 20 Jul 2016 19:41:17 +0000 (19:41 +0000)]
[OpenMP] Ignore parens in atomic capture

Clang misdiagnoses atomic captures cases that contains parens.
i.e.

  int v, int *p;
#pragma omp atomic capture
{ v = (*p); (*p)++; }

Patch by David S.

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

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

8 years ago[OpenCL] AMDGCN target will generate images in constant address space
Yaxun Liu [Wed, 20 Jul 2016 19:21:11 +0000 (19:21 +0000)]
[OpenCL] AMDGCN target will generate images in constant address space

Allows AMDGCN target to generate images (such as %opencl.image2d_t) in constant address space.
Images will still be generated in global address space by default.

Added tests to existing opencl-types.cl in test\CodeGenOpenCL.

Patch by Aaron En Ye Shi.

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

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