]> granicus.if.org Git - clang/log
clang
8 years agoRevert "Re-apply r259977 - [OpenMP] Reorganize code to allow specialized code generat...
Renato Golin [Sun, 7 Feb 2016 15:43:09 +0000 (15:43 +0000)]
Revert "Re-apply r259977 - [OpenMP] Reorganize code to allow specialized code generation for different devices."

This reverts commit r259985, as it still fails one buildbot.

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

8 years agoUse CodeGenModule::addReplacement() instead of directly accessing Replacements[].
Yaron Keren [Sun, 7 Feb 2016 12:44:35 +0000 (12:44 +0000)]
Use CodeGenModule::addReplacement() instead of directly accessing Replacements[].
This helps when trying to debug who inserted into Replacements.

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

8 years agoFix test case problem(caused by clang-format
Xinliang David Li [Sun, 7 Feb 2016 07:13:18 +0000 (07:13 +0000)]
Fix test case problem(caused by clang-format

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

8 years ago[PGO] add profile/coverage test cases for defaulted ctor/ctors
Xinliang David Li [Sun, 7 Feb 2016 06:57:29 +0000 (06:57 +0000)]
[PGO] add profile/coverage test cases for defaulted ctor/ctors

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

8 years agoFix typo in comment. NFC
Craig Topper [Sun, 7 Feb 2016 06:39:23 +0000 (06:39 +0000)]
Fix typo in comment. NFC

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

8 years agoDriver: adjust linker invocation for GNUTools
Saleem Abdulrasool [Sun, 7 Feb 2016 06:03:38 +0000 (06:03 +0000)]
Driver: adjust linker invocation for GNUTools

Adjust the driver to invoke the linker more similar to gcc.  -dynamic-linker is
only passed if -static and -shared are not part of the compiler (driver)
invocation.  Replicate the passing of -export-rdynamic as per the GCC link spec:

  %{!static: %{rdynamic:-export-dynamic} %{!shared:-dynamic-linker ...}}

This behaviour is consistent across all the targets that are supported, so no
need to conditionalise it on the target.

Resolves PR24245.

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

8 years agoSema: handle typo correction on ARC'ed ivar
Saleem Abdulrasool [Sun, 7 Feb 2016 02:30:59 +0000 (02:30 +0000)]
Sema: handle typo correction on ARC'ed ivar

The ivar ref would be transformed by the Typo Correction TreeTransform, but not
be owned, resulting in the source location being invalid.  This would eventually
lead to an assertion in findCapturingExpr.  Prevent this assertion from
triggering.

Resolves PR25113.

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

8 years agoSema: handle typo correction with ARC'ed objc properties
Saleem Abdulrasool [Sun, 7 Feb 2016 02:30:55 +0000 (02:30 +0000)]
Sema: handle typo correction with ARC'ed objc properties

We would previously assert in findCapturingExpr when performing a typo
correction resulting in an assignment of an ObjC property with a strong lifetype
specifier due to the expression not being rooted in the file (invalid SLoc)
during the retain cycle check on the typo-corrected expression.  Handle the
expression type appropriately during the TreeTransform to ensure that we have a
source location associated with the expression.

Fixes PR26486.

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

8 years agoIndex: provide adjustment thunk information for C++ manglings
Saleem Abdulrasool [Sat, 6 Feb 2016 22:36:34 +0000 (22:36 +0000)]
Index: provide adjustment thunk information for C++ manglings

Add support for exposing the adjustment thunk for virtual methods as
appropriate.

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

8 years agoAdd a missing call to MDNode::deleteTemporary().
Adrian Prantl [Sat, 6 Feb 2016 18:39:34 +0000 (18:39 +0000)]
Add a missing call to MDNode::deleteTemporary().
Follow-up to r259975. Kudos to the ASAN bots!

<rdar://problem/24493203>

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

8 years ago[analyzer] DeallocChecker: Don't warn on release of readonly assign property in dealloc.
Devin Coughlin [Sat, 6 Feb 2016 17:17:32 +0000 (17:17 +0000)]
[analyzer] DeallocChecker: Don't warn on release of readonly assign property in dealloc.

It is common for the ivars for read-only assign properties to always be stored retained,
so don't warn for a release in dealloc for the ivar backing these properties.

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

8 years agoRe-apply r259977 - [OpenMP] Reorganize code to allow specialized code generation...
Samuel Antao [Sat, 6 Feb 2016 06:52:48 +0000 (06:52 +0000)]
Re-apply r259977 - [OpenMP] Reorganize code to allow specialized code generation for different devices.

This was reverted due to a failure in a buildbot, but it turned out the failure was unrelated.

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

8 years agoRevert r259977 - [OpenMP] Reorganize code to allow specialized code generation for...
Samuel Antao [Sat, 6 Feb 2016 06:22:46 +0000 (06:22 +0000)]
Revert r259977 - [OpenMP] Reorganize code to allow specialized code generation for different devices.

It triggered some problem in the configuration related with zlib and exposed in the driver.

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

8 years ago[OpenMP] Reorganize code to allow specialized code generation for different devices.
Samuel Antao [Sat, 6 Feb 2016 02:12:34 +0000 (02:12 +0000)]
[OpenMP] Reorganize code to allow specialized code generation for different devices.

Summary:
Different devices may in some cases require different code generation schemes in order to implement OpenMP. This is required not only for performance reasons, but also because it may not be possible to have the current (default) implementation working for these devices. E.g. GPU's cannot implement the same scheme a target such as powerpc or x86b would use, in the sense that it does not have the ability to fork threads, instead all the threads are always executing and need to be managed by the implementation.

This patch proposes a reorganization of the code in the OpenMP code generation to pave the way to have specialized implementation of OpenMP support. More than a "real" patch this is more a request for comments in order to understand if what is proposed is acceptable or if there are better/easier ways to do it.

In this patch part of the common OpenMP codegen infrastructure is moved to a new file under a new namespace (CGOpenMPCommon) so it can be shared between the default implementation and the specialized one. When CGOpenMPRuntime is created, an attempt to select a specialized implementation is done.

In the patch a specialization for nvptx targets is done which currently checks if the target is an OpenMP device and trap if it is not.

Let me know comments suggestions you may have.

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

Subscribers: Hahnfeld, cfe-commits, fraggamuffin, caomhin, jholewinski

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

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

8 years ago[modules] Compress files embedded into a .pcm file, to reduce the disk usage of ...
Richard Smith [Sat, 6 Feb 2016 02:06:43 +0000 (02:06 +0000)]
[modules] Compress files embedded into a .pcm file, to reduce the disk usage of -fembed-all-files mode.

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

8 years agoFix a crash when emitting dbeug info for forward-declared scoped enums.
Adrian Prantl [Sat, 6 Feb 2016 01:59:09 +0000 (01:59 +0000)]
Fix a crash when emitting dbeug info for forward-declared scoped enums.
It is possible for enums to be created as part of their own
declcontext. We need to cache a placeholder to avoid the type being
created twice before hitting the cache.

<rdar://problem/24493203>

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

8 years ago[www] Update analyzer release notes to correct the checker-278 build date.
Devin Coughlin [Sat, 6 Feb 2016 00:59:14 +0000 (00:59 +0000)]
[www] Update analyzer release notes to correct the checker-278 build date.

This is not the future.

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

8 years ago[www] Update analyzer website for checker-278.
Devin Coughlin [Sat, 6 Feb 2016 00:53:33 +0000 (00:53 +0000)]
[www] Update analyzer website for checker-278.

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

8 years ago[PGO] Test case update
Xinliang David Li [Fri, 5 Feb 2016 23:36:08 +0000 (23:36 +0000)]
[PGO] Test case update

  Temporarily relax check in test to avoid
  breakage for format change in LLVM side. Once that is
  done, the test case will be retightened.

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

8 years agoEliminate an unnecessary enum, use the LLVM version. NFC
Paul Robinson [Fri, 5 Feb 2016 23:23:25 +0000 (23:23 +0000)]
Eliminate an unnecessary enum, use the LLVM version. NFC

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

8 years agoExempt char array initializers from -Wconstant-converion.
Richard Trieu [Fri, 5 Feb 2016 23:02:38 +0000 (23:02 +0000)]
Exempt char array initializers from -Wconstant-converion.

Sometimes, char arrays are used as bit storage, with no difference made between
signed and unsigned char.  Thus, it is reasonable to use 0 to 255 instead of
-128 to 127 and not trigger this warning.

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

8 years ago[CUDA] Bug 26497 : Remove wrappers for variants provided by CUDA headers.
Artem Belevich [Fri, 5 Feb 2016 22:54:05 +0000 (22:54 +0000)]
[CUDA] Bug 26497 : Remove wrappers for variants provided by CUDA headers.

... and pull global-scope ones into std namespace with using-declaration.

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

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

8 years agoMove DebugInfoKind enum from Driver to Basic. NFC
Paul Robinson [Fri, 5 Feb 2016 21:54:42 +0000 (21:54 +0000)]
Move DebugInfoKind enum from Driver to Basic. NFC

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

8 years agoAdd an ARC autoreleased-return-value caller marker on i386.
John McCall [Fri, 5 Feb 2016 21:37:38 +0000 (21:37 +0000)]
Add an ARC autoreleased-return-value caller marker on i386.

rdar://24531556

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

8 years ago[SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros
Ulrich Weigand [Fri, 5 Feb 2016 21:34:28 +0000 (21:34 +0000)]
[SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros

Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248] macros on SystemZ.

This fixes a miscompile of GCC C++11 standard library headers
due to use of those macros in an ABI-changing manner.

See e.g. /usr/include/c++/4.8.5/ext/concurrence.h:

  // Compile time constant that indicates prefered locking policy in
  // the current configuration.
  static const _Lock_policy __default_lock_policy =
#ifdef __GTHREADS
#if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \
     && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4))
  _S_atomic;
#else
  _S_mutex;
#endif
#else
  _S_single;
#endif

A different choice of __default_lock_policy causes different
sizes of several of the C++11 data structures, which are then
incompatible when inlined in clang-compiled code with what the
(GCC-compiled) external library expects.

This in turn leads to various crashes when using std::thread
in code compiled with clang, as see e.g. via the ThreadPool
unit tests.  See PR 26473 for an example.

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

8 years agoDo not honor explicit alignment attribute on fields for PS4.
Sunil Srivastava [Fri, 5 Feb 2016 20:50:02 +0000 (20:50 +0000)]
Do not honor explicit alignment attribute on fields for PS4.
This change reverts r257462 for PS4 triple.

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

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

8 years ago[Parser] Perform CachedTokens update dependent on token consumption
Bruno Cardoso Lopes [Fri, 5 Feb 2016 19:36:39 +0000 (19:36 +0000)]
[Parser] Perform CachedTokens update dependent on token consumption

In the context where we break one tok::greatergreater into two
tok::greater in order to correctly update the cached tokens; update the
CachedTokens with two tok::greater only if ParseGreaterThanInTemplateList
clients asks to consume the last token. Otherwise we only need to add
one because the second is already added later on, as a not yet cached token.

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

rdar://problem/24488367

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

8 years ago[modules] Separately track whether an identifier's preprocessor information and
Richard Smith [Fri, 5 Feb 2016 19:03:40 +0000 (19:03 +0000)]
[modules] Separately track whether an identifier's preprocessor information and
name lookup information have changed since deserialization. For a C++ modules
build, we do not need to re-emit the identifier into the serialized identifier
table if only the name lookup information has changed (and in all cases, we
don't need to re-emit the macro information if only the name lookup information
has changed).

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

8 years ago[ASTMatchers] Allow hasName() to look through inline namespaces
Samuel Benzaquen [Fri, 5 Feb 2016 18:29:24 +0000 (18:29 +0000)]
[ASTMatchers] Allow hasName() to look through inline namespaces

Summary:
Allow hasName() to look through inline namespaces.
This will fix the interaction between some clang-tidy checks and libc++.

libc++ defines names in an inline namespace named std::<version_#>.
When we try to match a name using hasName("std::xxx") it fails to match and the clang-tidy check does not work.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

8 years agoclang-format: Fix corner case in template detection.
Daniel Jasper [Fri, 5 Feb 2016 14:17:16 +0000 (14:17 +0000)]
clang-format: Fix corner case in template detection.

Before:
  f(a.operator() < A > ());

After:
  f(a.operator()<A>());

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

8 years ago[analyzer] Suppress localization diagnostics in debug classes and methods.
Devin Coughlin [Fri, 5 Feb 2016 04:22:15 +0000 (04:22 +0000)]
[analyzer] Suppress localization diagnostics in debug classes and methods.

If the class or method name case-insensitively contains the term "debug",
suppress warnings about string constants flowing to user-facing UI APIs.

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

8 years agoCodeGen: correct Windows ARM C++ assertion
Saleem Abdulrasool [Fri, 5 Feb 2016 04:12:40 +0000 (04:12 +0000)]
CodeGen: correct Windows ARM C++ assertion

Because the Decl is explicitly passed as nullptr further up the call chain, it
is possible to invoke isa on a nullptr, which will assert.  Guard against the
nullptr.

Take the opportunity to reuse the helper method rather than re-implementing this
logic.

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

8 years ago[CMake] One more try to make CMake clean up after itself
Chris Bieneman [Fri, 5 Feb 2016 03:59:08 +0000 (03:59 +0000)]
[CMake] One more try to make CMake clean up after itself

Seriously... CMake... You're on my list...

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

8 years agoRevert "[CMake] Improve the clang order-file generation workflow"
Chris Bieneman [Fri, 5 Feb 2016 03:40:37 +0000 (03:40 +0000)]
Revert "[CMake] Improve the clang order-file generation workflow"

This reverts commit r259862, and attempts to fix builder CMakeCaches.

Will try this again some other time...

Conflicts:

CMakeLists.txt
tools/driver/CMakeLists.txt

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

8 years ago[CMake] One more try to fix this.
Chris Bieneman [Fri, 5 Feb 2016 03:02:40 +0000 (03:02 +0000)]
[CMake] One more try to fix this.

This change will catch any bots that generated the order file that GNU ld doesn't like and delete it before trying to generate one that I think GNU ld will deal with.

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

8 years ago[CMake] Speculative fix for linker error on Linux
Chris Bieneman [Fri, 5 Feb 2016 02:51:33 +0000 (02:51 +0000)]
[CMake] Speculative fix for linker error on Linux

I can't reproduce this locally, but I think this may fix it.

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

8 years ago[modules] Factor out common code to mark identifier being "from AST", and add a
Richard Smith [Fri, 5 Feb 2016 01:40:54 +0000 (01:40 +0000)]
[modules] Factor out common code to mark identifier being "from AST", and add a
call in one more place to reduce the size of identifier tables in non-leaf
modules. No behavior change.

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

8 years ago[CMake] Trying to fix a bot failure I introduced in r259862
Chris Bieneman [Fri, 5 Feb 2016 01:27:31 +0000 (01:27 +0000)]
[CMake] Trying to fix a bot failure I introduced in r259862

CMake caching behavior makes me sad.

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

8 years ago[CMake] Improve the clang order-file generation workflow
Chris Bieneman [Fri, 5 Feb 2016 01:22:03 +0000 (01:22 +0000)]
[CMake] Improve the clang order-file generation workflow

Summary:
With this change generating clang order files using dtrace uses the following workflow:

cmake <whatever options you want>

ninja generate-order-file

ninja clang

This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.

CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.

Reviewers: bogner

Subscribers: cfe-commits

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

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

8 years agoDon't synthesize an ImportDecl for a module named in -fmodule-implementation-of
Ben Langmuir [Fri, 5 Feb 2016 01:10:05 +0000 (01:10 +0000)]
Don't synthesize an ImportDecl for a module named in -fmodule-implementation-of

When building a PCH with modules enabled this import would assert in the
ASTWriter and (if assertions were disabled) sometimes crash the compiler
that loaded the resulting PCH when trying to lookup the submodule ID.

rdar://problem/24137448

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

8 years agoPR25271: When attaching default template arguments to redeclarations of a
Richard Smith [Thu, 4 Feb 2016 22:54:41 +0000 (22:54 +0000)]
PR25271: When attaching default template arguments to redeclarations of a
template, keep looking for default arguments if we see a template parameter
pack. There may be default arguments preceding a pack with no default argument.

Patch by Jannis Harder!

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

8 years agoInstall cmake files to lib/cmake/clang
Niels Ole Salscheider [Thu, 4 Feb 2016 20:08:27 +0000 (20:08 +0000)]
Install cmake files to lib/cmake/clang

This is the right location for platform-specific files.

Also, search for LLVM's CMake files in this directory.

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

8 years agoFix a crash when there is a typo in the return statement.
Manman Ren [Thu, 4 Feb 2016 20:05:40 +0000 (20:05 +0000)]
Fix a crash when there is a typo in the return statement.

If the typo happens after a successful deduction for an earlier
return statement, we should check if the deduced type is null
before using it.

The typo correction happens after we try to deduce the return
type and we ignore the deduction from the typo and continue
to typo correction.

rdar://24342247

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

8 years ago[PGO] code simplification: use existing VP annotation API /NFC
Xinliang David Li [Thu, 4 Feb 2016 19:54:17 +0000 (19:54 +0000)]
[PGO] code simplification: use existing VP annotation API /NFC

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

8 years ago[PGO] cc1 option name change for profile instrumentation
Rong Xu [Thu, 4 Feb 2016 18:39:09 +0000 (18:39 +0000)]
[PGO] cc1 option name change for profile instrumentation

This patch changes cc1 option -fprofile-instr-generate to an enum option
-fprofile-instrument={clang|none}. It also changes cc1 options
-fprofile-instr-generate= to -fprofile-instrument-path=.
The driver level option -fprofile-instr-generate and -fprofile-instr-generate=
remain intact. This change will pave the way to integrate new PGO
instrumentation in IR level.

Review: http://reviews.llvm.org/D16730

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

8 years ago[x86] Correct setting of WIntType for MCU target
Andrey Bokhanko [Thu, 4 Feb 2016 11:54:45 +0000 (11:54 +0000)]
[x86] Correct setting of WIntType for MCU target

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

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

8 years ago[OPENMP 4.0] Fixed support of array sections/array subscripts.
Alexey Bataev [Thu, 4 Feb 2016 11:27:03 +0000 (11:27 +0000)]
[OPENMP 4.0] Fixed support of array sections/array subscripts.
Codegen for array sections/array subscripts worked only for expressions with arrays as base. Patch fixes codegen for bases with pointer/reference types.

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

8 years agoAdd -nocudainc option to CUDA preprocessor test.
Samuel Antao [Thu, 4 Feb 2016 08:13:16 +0000 (08:13 +0000)]
Add -nocudainc option to CUDA preprocessor test.

If include files are used in the CUDA preprocessor tests it will cause a
failure due to a missing header file in hosts that do not match the triple
in the test. E.g. powerpc64le have CUDA support but the include files
cannot be used for an x86 target.

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

8 years agoBasic: mark TLS as supported on Windows on ARM
Saleem Abdulrasool [Thu, 4 Feb 2016 05:05:23 +0000 (05:05 +0000)]
Basic: mark TLS as supported on Windows on ARM

LLVM can now lower TLS access as per the MS ABI on ARM.  This enables the
generation of TLS access for Windows on ARM.

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

8 years agoPR23057: fix use-after-free due to local token buffer in ParseCXXAmbiguousParenExpres...
Alexey Bataev [Thu, 4 Feb 2016 04:22:09 +0000 (04:22 +0000)]
PR23057: fix use-after-free due to local token buffer in ParseCXXAmbiguousParenExpression, by Dmitry Polukhin
Differential Revision: http://reviews.llvm.org/D16572
A    test/Parser/cxx-ambig-paren-expr-asan.cpp
M    lib/Parse/ParseExprCXX.cpp

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

8 years agoFix predefine for __NSConstantString struct type
Ben Langmuir [Thu, 4 Feb 2016 00:55:24 +0000 (00:55 +0000)]
Fix predefine for __NSConstantString struct type

Per review feedback the name was wrong and it can be used outside
Objective-C.

Unfortunately, making the internal struct visible broke some ASTMatchers
tests that assumed that the first record decl would be from user code,
rather than a builtin type.  I'm worried that this will also affect
users' code.  So this patch adds a typedef to wrap the internal struct
and only makes the typedef visible to namelookup.  This is sufficient to
allow the ASTReader to merge the decls we need without making the struct
itself visible.

rdar://problem/24425801

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

8 years agoBump DiagnosticSemaKinds count; we're close to hitting it.
Manman Ren [Wed, 3 Feb 2016 23:35:29 +0000 (23:35 +0000)]
Bump DiagnosticSemaKinds count; we're close to hitting it.

 $ grep '= DIAG_START_SEMA' include/clang/Basic/DiagnosticIDs.h
       DIAG_START_ANALYSIS      = DIAG_START_SEMA            + 3000
 $ grep 'def ' include/clang/Basic/DiagnosticSemaKinds.td | wc -l
       2994

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

8 years agoReapply r259624, it is likely not the commit causing the bot failures.
Quentin Colombet [Wed, 3 Feb 2016 22:41:00 +0000 (22:41 +0000)]
Reapply r259624, it is likely not the commit causing the bot failures.
Original message:
Make CF constant string decl visible to name lookup to fix module errors

The return type of the __builtin___*StringMakeConstantString functions
is a pointer to a struct, so we need that struct to be visible to name
lookup so that we will correctly merge multiple declarations of that
type if they come from different modules.

Incidentally, to make this visible to name lookup we need to rename the
type to __NSConstantString, since the real NSConstantString is an
Objective-C interface type.  This shouldn't affect anyone outside the
compiler since users of the constant string builtins cast the result
immediately to CFStringRef.

Since this struct type is otherwise implicitly created by the AST
context and cannot access namelookup, we make this a predefined type
and initialize it in Sema.

Note: this issue of builtins that refer to types not visible to name
lookup technically also affects other builtins (e.g. objc_msgSendSuper),
but in all other cases the builtin is a library builtin and the issue
goes away if you include the library that defines the types it uses,
unlike for these constant string builtins.

rdar://problem/24425801

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

8 years ago[cfi] Safe handling of unaddressable vtable pointers (clang).
Evgeniy Stepanov [Wed, 3 Feb 2016 22:18:55 +0000 (22:18 +0000)]
[cfi] Safe handling of unaddressable vtable pointers (clang).

Avoid crashing when printing diagnostics for vtable-related CFI
errors. In diagnostic mode, the frontend does an additional check of
the vtable pointer against the set of all known vtable addresses and
lets the runtime handler know if it is safe to inspect the vtable.

http://reviews.llvm.org/D16823

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

8 years agoRevert r259624 - Make CF constant string decl visible to name lookup to fix module...
Quentin Colombet [Wed, 3 Feb 2016 22:14:53 +0000 (22:14 +0000)]
Revert r259624 - Make CF constant string decl visible to name lookup to fix module errors.

This breaks some internal bots in stage2: clang seg fault.
Looking with Ben to see what is going on.

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

8 years ago[CUDA] added declarations for device-side system calls
Artem Belevich [Wed, 3 Feb 2016 20:53:58 +0000 (20:53 +0000)]
[CUDA] added declarations for device-side system calls

...and std:: wrappers for free/malloc.

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

8 years agoEnsure that we substitute into the declaration of a template parameter pack
Richard Smith [Wed, 3 Feb 2016 20:40:30 +0000 (20:40 +0000)]
Ensure that we substitute into the declaration of a template parameter pack
(that is not a pack expansion) during template argument deduction, even if we
deduced that the pack would be empty.

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

8 years agoRefactor conversion of deduced template arguments to reduce repetition.
Richard Smith [Wed, 3 Feb 2016 20:15:01 +0000 (20:15 +0000)]
Refactor conversion of deduced template arguments to reduce repetition.

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

8 years ago[Sema debugger support] Require non-void types to be complete in unknown-anytype...
Douglas Gregor [Wed, 3 Feb 2016 19:13:08 +0000 (19:13 +0000)]
[Sema debugger support] Require non-void types to be complete in unknown-anytype casts.

When performing a cast from an __unknown_anytype function call to a
non-void type, we need to make sure that type is complete. Fixes
rdar://problem/23959960.

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

8 years agoAdded Anastasia Stulova as a code owner for OpenCL
Anastasia Stulova [Wed, 3 Feb 2016 18:51:19 +0000 (18:51 +0000)]
Added Anastasia Stulova as a code owner for OpenCL

Reviewers: Chris Lattner

Subscribers: cfe-dev

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

8 years agoFix regression from r259622: the operand of an increment that is the operand of
Richard Smith [Wed, 3 Feb 2016 18:48:43 +0000 (18:48 +0000)]
Fix regression from r259622: the operand of an increment that is the operand of
a cast expression is not the operand of a cast expression itself, so if it's
parenthesized we need to form a ParenExpr not a ParenListExpr.

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

8 years agoAdd builtins for bitreverse intrinsic
Matt Arsenault [Wed, 3 Feb 2016 17:49:38 +0000 (17:49 +0000)]
Add builtins for bitreverse intrinsic

Follow the naming convention that bswap uses since it's a
similar sort of operation.

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

8 years agoclang-format: Fix formatting of ternary expressions with comments.
Daniel Jasper [Wed, 3 Feb 2016 17:27:10 +0000 (17:27 +0000)]
clang-format: Fix formatting of ternary expressions with comments.

Before:
  int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
      /*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb :
       ccccccccccccccccccccccccccc;

After:
  int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
      /*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb :
              ccccccccccccccccccccccccccc;

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

8 years agoAdd back the ABITest makefiles
Chris Bieneman [Wed, 3 Feb 2016 17:16:01 +0000 (17:16 +0000)]
Add back the ABITest makefiles

These files are standalone and not integrated with CMake, so we probably want them.

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

8 years ago[OpenMP] Parsing + sema for target parallel for directive.
Arpith Chacko Jacob [Wed, 3 Feb 2016 15:46:42 +0000 (15:46 +0000)]
[OpenMP] Parsing + sema for target parallel for directive.

Summary:
This patch adds parsing + sema for the target parallel for directive along with testcases.

Reviewers: ABataev

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

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

8 years agoMinor cleanup to remove casts and improve some const correctness. NFC.
Aaron Ballman [Wed, 3 Feb 2016 15:20:51 +0000 (15:20 +0000)]
Minor cleanup to remove casts and improve some const correctness. NFC.

Patch by Alexander Riccio.

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

8 years ago[OpenCL] Adding reserved operator logical xor for OpenCL
Anastasia Stulova [Wed, 3 Feb 2016 15:17:14 +0000 (15:17 +0000)]
[OpenCL] Adding reserved operator logical xor for OpenCL

This patch adds the reserved operator ^^ when compiling for OpenCL (spec v1.1 s6.3.g),
which results in a more meaningful error message.

Patch by Neil Hickey!

Review: http://reviews.llvm.org/D13280

M    test/SemaOpenCL/unsupported.cl
M    include/clang/Basic/TokenKinds.def
M    include/clang/Basic/DiagnosticParseKinds.td
M    lib/Basic/OperatorPrecedence.cpp
M    lib/Lex/Lexer.cpp
M    lib/Parse/ParseExpr.cpp

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

8 years agoProvide match function to look over an entire TU again.
Daniel Jasper [Wed, 3 Feb 2016 14:29:55 +0000 (14:29 +0000)]
Provide match function to look over an entire TU again.

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

8 years agoForgot to remove file in previous commit.
Yury Gribov [Wed, 3 Feb 2016 13:36:31 +0000 (13:36 +0000)]
Forgot to remove file in previous commit.

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

8 years ago[analyzer] AnalysisConsumer: print fully-qualified function name while displaying...
Yury Gribov [Wed, 3 Feb 2016 13:35:33 +0000 (13:35 +0000)]
[analyzer] AnalysisConsumer: print fully-qualified function name while displaying progress

-analyzer-display progress option prints only function names which may be ambiguous. This patch forces AnalysisConsumer to print fully-qualified function names.
Patch by Alex Sidorin!

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

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

8 years ago-inline-asm][X86] Add ability to use AVX512 in MS inline asm
Marina Yatsina [Wed, 3 Feb 2016 11:32:08 +0000 (11:32 +0000)]
-inline-asm][X86] Add ability to use AVX512 in MS inline asm

Defined the new AVX512 registers in clang inline asm.
Fixed a bug in the MC subtarget info creation during the parsing of MS asm statement - now it receives the actual CPU and target features information.

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

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

8 years agoReduce initial Sema memory consumption by 400KB. By Elisavet Sakellari.
Axel Naumann [Wed, 3 Feb 2016 10:45:22 +0000 (10:45 +0000)]
Reduce initial Sema memory consumption by 400KB. By Elisavet Sakellari.

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

8 years agoclang-format: [JS/TypeScript] Support "enum" as an optional property name, too.
Daniel Jasper [Wed, 3 Feb 2016 05:33:44 +0000 (05:33 +0000)]
clang-format: [JS/TypeScript] Support "enum" as an optional property name, too.

Before:
  enum?: string
  [];

After:
  enum?: string[];

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

8 years agoMake CF constant string decl visible to name lookup to fix module errors
Ben Langmuir [Wed, 3 Feb 2016 03:26:19 +0000 (03:26 +0000)]
Make CF constant string decl visible to name lookup to fix module errors

The return type of the __builtin___*StringMakeConstantString functions
is a pointer to a struct, so we need that struct to be visible to name
lookup so that we will correctly merge multiple declarations of that
type if they come from different modules.

Incidentally, to make this visible to name lookup we need to rename the
type to __NSConstantString, since the real NSConstantString is an
Objective-C interface type.  This shouldn't affect anyone outside the
compiler since users of the constant string builtins cast the result
immediately to CFStringRef.

Since this struct type is otherwise implicitly created by the AST
context and cannot access namelookup, we make this a predefined type
and initialize it in Sema.

Note: this issue of builtins that refer to types not visible to name
lookup technically also affects other builtins (e.g. objc_msgSendSuper),
but in all other cases the builtin is a library builtin and the issue
goes away if you include the library that defines the types it uses,
unlike for these constant string builtins.

rdar://problem/24425801

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

8 years agoFix miscompile and rejects-valids when disambiguating after an ambiguous
Richard Smith [Wed, 3 Feb 2016 02:58:20 +0000 (02:58 +0000)]
Fix miscompile and rejects-valids when disambiguating after an ambiguous
C-style-cast to function/array type or parenthesized function-style cast/array
indexing.

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

8 years agoFix typo in OpenCL type mangling. This is still bogus (we should either use the
Richard Smith [Wed, 3 Feb 2016 01:43:59 +0000 (01:43 +0000)]
Fix typo in OpenCL type mangling. This is still bogus (we should either use the
actual source name of the typedef or a vendor mangling) but at least it stands
a chance of demangling now.

We would also benefit from some test coverage of this (OpenCL +
__attribute__((overloadable)) is probably required to reach this).

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

8 years agoFix Itanium RTTI emission so that we emit fundamental type information into the
Richard Smith [Wed, 3 Feb 2016 01:32:42 +0000 (01:32 +0000)]
Fix Itanium RTTI emission so that we emit fundamental type information into the
C++ ABI library for the same set of types for which we expect the C++ ABI
library to provide the RTTI.

Specifically:
 1) __int128 and unsigned __int128 are now emitted into the ABI library. We
    always expected them to be there but never actually made sure to emit them.
 2) Do not expect OpenCL builtin types to have type info in the C++ ABI library.
    Neither libc++abi nor libstdc++ puts them there when built with either GCC
    or Clang.

This matches GCC's behavior.

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

8 years agoPR24989: Stop trying to use the C++11 rules for lambda return type inference in
Richard Smith [Tue, 2 Feb 2016 23:58:56 +0000 (23:58 +0000)]
PR24989: Stop trying to use the C++11 rules for lambda return type inference in
C++14 generic lambdas. It conflicts with the C++14 return type deduction
mechanism, and results in us failing to actually deduce the lambda's return
type in some cases.

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

8 years agoFix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.
Richard Smith [Tue, 2 Feb 2016 23:34:49 +0000 (23:34 +0000)]
Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.

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

8 years agoWork around build failure due to GCC 4.8.1 bug. We don't completely understand
Richard Smith [Tue, 2 Feb 2016 23:11:49 +0000 (23:11 +0000)]
Work around build failure due to GCC 4.8.1 bug. We don't completely understand
the details of the bug, but avoiding overloading llvm::cast with another
function template sidesteps it.

See gcc.gnu.org/PR58022 for details of the bug, and llvm.org/PR26362 for more
backgound on how it manifested in Clang. Patch by Igor Sugak!

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

8 years ago[CUDA] Do not allow dynamic initialization of global device side variables.
Artem Belevich [Tue, 2 Feb 2016 22:29:48 +0000 (22:29 +0000)]
[CUDA] Do not allow dynamic initialization of global device side variables.

In general CUDA does not allow dynamic initialization of
global device-side variables. One exception is that CUDA allows
records with empty constructors as described in section E2.2.1 of
CUDA 7.5 Programming guide.

This patch applies initializer checks for all device-side variables.
Empty constructors are accepted, but no code is generated for them.

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

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

8 years agoObjCXX: fix a crash during typo correction.
Manman Ren [Tue, 2 Feb 2016 22:23:03 +0000 (22:23 +0000)]
ObjCXX: fix a crash during typo correction.

For ObjCXX, we can create a CastExpr with Kind being CK_UserDefinedConversion
and SubExpr being BlockExpr. Specifically one can return BlockExpr from
BuildCXXMemberCallExpr and the result can be used to build a CastExpr.

Fix the assumption in CastExpr::getSubExprAsWritten that SubExpr can only
be CXXMemberCallExpr.

rdar://problem/24364077

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

8 years agoARM: allow both vfma and vfms intrinsics on v7.
Tim Northover [Tue, 2 Feb 2016 18:02:10 +0000 (18:02 +0000)]
ARM: allow both vfma and vfms intrinsics on v7.

The main purpose here is that vfma/vfms should be symmetric, and they are
supported on most v7 cores.

The new ArchGuard is suggested by ACLE but prophylactic for us. Almost all CPUs
with NEON *will* have vfma, and the few exceptions I know of (e.g. Cortex-A8)
are incorrectly modelled by Clang so can't trigger a test.

Fortunately, they're getting rarer. But if we ever do support them properly
arm_neon.h should now do the right thing.

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

8 years agoPR23057: Fix assertion `Val && "isa<> used on a null pointer"' on invalid for-range...
Denis Zobnin [Tue, 2 Feb 2016 17:33:09 +0000 (17:33 +0000)]
PR23057: Fix assertion `Val && "isa<> used on a null pointer"' on invalid for-range expression.

Fix the issue discovered by fuzzing (PR23057, comment 18) by handling nullptr in Sema::ActOnCXXForRangeDecl
and correct delayed typos in for-range expression before calling Sema::ActOnCXXForRangeStmt. Also fixes PR26288.

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

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

8 years agoMake CodeGen headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 16:05:18 +0000 (16:05 +0000)]
Make CodeGen headers self-contained.

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

8 years agoMake the remaining headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 14:24:21 +0000 (14:24 +0000)]
Make the remaining headers self-contained.

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

8 years ago[StaticAnalyzer] Pull SymExpr and SymbolData into its own header to avoid cyclic...
Benjamin Kramer [Tue, 2 Feb 2016 14:24:11 +0000 (14:24 +0000)]
[StaticAnalyzer] Pull SymExpr and SymbolData into its own header to avoid cyclic includes.

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

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Tue, 2 Feb 2016 13:52:52 +0000 (13:52 +0000)]
Add backend dignostic printer for unsupported features

Re-commit of r258950 after fixing layering violation.

The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

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

8 years agoFix for PR8901: attribute "mode" rejected for enums and dependent types.
Denis Zobnin [Tue, 2 Feb 2016 13:50:39 +0000 (13:50 +0000)]
Fix for PR8901: attribute "mode" rejected for enums and dependent types.

Allow "mode" attribute for enum types, except for vector modes, for compatibility with GCC.
Support "mode" attribute with dependent types.

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

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

8 years agoTest commit (NFC).
Denis Zobnin [Tue, 2 Feb 2016 12:39:08 +0000 (12:39 +0000)]
Test commit (NFC).

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

8 years ago[OpenCL] Eliminate warning when declaring OpenCL builtin functions.
Anastasia Stulova [Tue, 2 Feb 2016 11:29:43 +0000 (11:29 +0000)]
[OpenCL] Eliminate warning when declaring OpenCL builtin functions.

OpenCL builtin functions are usually declared in header files.
Currently clang emits warning for OpenCL builtin functions
which have the same name as standard C library functions.

This commit eliminates such warnings by not adding the C standard
includes following the restriction from OpenCL v1.2 s6.9.f.

Patch by Liu Yaxun (Sam)!

Review: http://reviews.llvm.org/D16692

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

8 years agoMake headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 11:06:57 +0000 (11:06 +0000)]
Make headers self-contained.

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

8 years agoMove DebugInfoKind into its own header to cut the cyclic dependency edge from Driver...
Benjamin Kramer [Tue, 2 Feb 2016 11:06:51 +0000 (11:06 +0000)]
Move DebugInfoKind into its own header to cut the cyclic dependency edge from Driver to Frontend.

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

8 years agoclang-format: Make AlignAfterOpenBracket also affect angle brackets.
Daniel Jasper [Tue, 2 Feb 2016 10:28:11 +0000 (10:28 +0000)]
clang-format: Make AlignAfterOpenBracket also affect angle brackets.

Patch by Matthew Whitehead, thank you.

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

8 years ago[OPENMP 4.0] Allow to use 'omp simd' directive inside other simd-regions.
Alexey Bataev [Tue, 2 Feb 2016 04:59:52 +0000 (04:59 +0000)]
[OPENMP 4.0] Allow to use 'omp simd' directive inside other simd-regions.

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

8 years ago[OpenMP] Prevent nesting of target constructs within target code execution regions.
Arpith Chacko Jacob [Tue, 2 Feb 2016 04:00:47 +0000 (04:00 +0000)]
[OpenMP] Prevent nesting of target constructs within target code execution regions.

Summary:
This patch enhances Sema to check for the following restriction:

OpenMP 4.5 [2.17 Nesting of Regions]
If a target, target update, target data, target enter data, or
target exit data construct is encountered during execution of a
target region, the behavior is unspecified.

Reviewers: ABataev

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

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

8 years ago[asan] Add iOS support for Address Sanitizer
Anna Zaks [Tue, 2 Feb 2016 02:04:48 +0000 (02:04 +0000)]
[asan] Add iOS support for Address Sanitizer

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

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

8 years agoTemplate Type Diffing change
Richard Trieu [Tue, 2 Feb 2016 00:36:59 +0000 (00:36 +0000)]
Template Type Diffing change

When all the arguments of a template are elided, print "A<...>" instead of
"A<[2 * ...]>".  Also remove comment fragment that means nothing.

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

8 years agoAlways build a new TypeSourceInfo for function templates with parameters
Nico Weber [Mon, 1 Feb 2016 22:31:51 +0000 (22:31 +0000)]
Always build a new TypeSourceInfo for function templates with parameters

RecursiveASTVisitor::TraverseFunctionHelper() traverses a function's
ParmVarDecls by going to the function's getTypeSourceInfo if it exists, and
`DEF_TRAVERSE_TYPELOC(FunctionProtoType` then goes to the function's
ParmVarDecls.

For a function template that doesn't have parameters that explicitly depend on
the template parameter, we used to be clever and not build a new
TypeSourceInfo. That meant that when an instantiation of such a template is
visited, its TypeSourceInfo would point to the ParmVarDecls of the template,
not of the instantiation, which then confused clients of RecursiveASTVisitor.

So don't be clever for function templates that have parameters, even if none of
the parameters depend on the type.

Fixes PR26257.
http://reviews.llvm.org/D16478

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

8 years agoUndoing commit r259366 to debug buildbot failure.
Arpith Chacko Jacob [Mon, 1 Feb 2016 22:02:05 +0000 (22:02 +0000)]
Undoing commit r259366 to debug buildbot failure.
> http://reviews.llvm.org/D16758

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