]> granicus.if.org Git - clang/log
clang
8 years ago[clang-format] Detect constructor initializers preceded by `noexcept`.
Daniel Jasper [Tue, 1 Mar 2016 21:41:58 +0000 (21:41 +0000)]
[clang-format] Detect constructor initializers preceded by `noexcept`.

Patch by Erik Kessler, thank you.

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

8 years agoThis patch adds doxygen comments for the intrinsincs in the header file popcntintrin.h.
Ekaterina Romanova [Tue, 1 Mar 2016 20:04:57 +0000 (20:04 +0000)]
This patch adds doxygen comments for the intrinsincs in the header file popcntintrin.h.

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

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

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

8 years agoReword a misleading comment discussing landingpads and SEH
Reid Kleckner [Tue, 1 Mar 2016 19:51:48 +0000 (19:51 +0000)]
Reword a misleading comment discussing landingpads and SEH

SEH doesn't use landingpads anymore.

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

8 years ago[MSVC Compat] Correctly handle finallys nested within finallys
David Majnemer [Tue, 1 Mar 2016 19:42:53 +0000 (19:42 +0000)]
[MSVC Compat] Correctly handle finallys nested within finallys

We'd lose track of the parent CodeGenFunction, leading us to get
confused with regard to which function a nested finally belonged to.

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

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

8 years ago[PPC64][VSX] Add short, char, and bool data type for vec_vsx_ld and vec_vsx_st intrinsics
Kit Barton [Tue, 1 Mar 2016 18:11:28 +0000 (18:11 +0000)]
[PPC64][VSX] Add short, char, and bool data type for vec_vsx_ld and vec_vsx_st intrinsics

Issue: https://llvm.org/bugs/show_bug.cgi?id=26720

Fix compile error when building ffmpeg for PowerPC64LE because of some
vec_vsx_ld/vec_vsx_st intrinsics are not supported by current clang.

New added intrinsics:

(vector) {signed|unsigned} {short|char} vec_vsx_ld: (total: 8)
bool vec_vsx_ld: (total: 1)
(vector) {signed|unsigned} {short|char} vec_vsx_st: (total: 8)
bool vec_vsx_st: (total: 1)
Total: 18 intrinsics

Phabricator: http://reviews.llvm.org/D17637

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

8 years ago[CLANG][AVX512][BUILTIN] Adding PSRL{DI|QI}{128|256|512} builtin
Michael Zuckerman [Tue, 1 Mar 2016 17:49:03 +0000 (17:49 +0000)]
[CLANG][AVX512][BUILTIN] Adding PSRL{DI|QI}{128|256|512} builtin

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

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

8 years agoExplicitly select IAS in new embed-bitcode.c test.
Daniel Sanders [Tue, 1 Mar 2016 17:15:11 +0000 (17:15 +0000)]
Explicitly select IAS in new embed-bitcode.c test.

This should fix clang-cmake-mips builder since MIPS does not have IAS enabled
by default (yet).

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

8 years ago[cmake] Add a few more compiler-rt check-* targets for EXTERNAL_COMPILER_RT
Filipe Cabecinhas [Tue, 1 Mar 2016 15:33:52 +0000 (15:33 +0000)]
[cmake] Add a few more compiler-rt check-* targets for EXTERNAL_COMPILER_RT

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

8 years ago[cmake] Try to appease the buildbots.
Filipe Cabecinhas [Tue, 1 Mar 2016 15:07:19 +0000 (15:07 +0000)]
[cmake] Try to appease the buildbots.

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

8 years ago[cmake] Pass through the cmake_3_2_USES_TERMINAL variable so we get progress bars...
Filipe Cabecinhas [Tue, 1 Mar 2016 14:10:38 +0000 (14:10 +0000)]
[cmake] Pass through the cmake_3_2_USES_TERMINAL variable so we get progress bars on an external compiler-rt build

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

8 years ago[cmake] Use CMake's USES_TERMINAL for the test targets.
Filipe Cabecinhas [Tue, 1 Mar 2016 14:08:18 +0000 (14:08 +0000)]
[cmake] Use CMake's USES_TERMINAL for the test targets.

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

8 years ago[cmake] Fallback to LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR if COMPILER_RT_SRC_ROOT...
Filipe Cabecinhas [Tue, 1 Mar 2016 14:08:13 +0000 (14:08 +0000)]
[cmake] Fallback to LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR if COMPILER_RT_SRC_ROOT doesn't exist.

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

8 years agoFormatTests: Update libdeps corresponding to r262323.
NAKAMURA Takumi [Tue, 1 Mar 2016 13:11:36 +0000 (13:11 +0000)]
FormatTests: Update libdeps corresponding to r262323.

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

8 years ago[CLANG][AVX512][BUILTIN] Adding PSRLV builtin
Michael Zuckerman [Tue, 1 Mar 2016 13:03:45 +0000 (13:03 +0000)]
[CLANG][AVX512][BUILTIN] Adding PSRLV builtin

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

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

8 years agoFix test breakage on windows where the default std is c++11 by forcing c++03 in the...
Manuel Klimek [Tue, 1 Mar 2016 12:53:18 +0000 (12:53 +0000)]
Fix test breakage on windows where the default std is c++11 by forcing c++03 in the test.

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

8 years agoFix DLL build by adding required dependency.
Manuel Klimek [Tue, 1 Mar 2016 12:47:30 +0000 (12:47 +0000)]
Fix DLL build by adding required dependency.

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

8 years agoAdd functions to apply replacements and reformat them.
Manuel Klimek [Tue, 1 Mar 2016 12:37:30 +0000 (12:37 +0000)]
Add functions to apply replacements and reformat them.

This is a commonly useful feature to have, and we have implemented it
multiple times with different kinds of bugs. This implementation
centralizes the idea in a set of functions that we can then use from the various
tools.

Reverts r262234, which is a revert of r262232, and puts the functions
into FOrmat.h, as they are closely coupled to clang-format, and we
otherwise introduce a cyclic dependency between libFormat and
libTooling.

Patch by Eric Liu.

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding PSRA{Q|D|QI|DI}{128|256|512} builtin
Michael Zuckerman [Tue, 1 Mar 2016 11:38:16 +0000 (11:38 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding PSRA{Q|D|QI|DI}{128|256|512} builtin

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

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

8 years agoOptionally demote fatal errors to non-fatal errors.
Manuel Klimek [Tue, 1 Mar 2016 10:56:19 +0000 (10:56 +0000)]
Optionally demote fatal errors to non-fatal errors.

This behavior is enabled when the new CXTranslationUnit_KeepGoing
option is passed to clang_parseTranslationUnit{,2}. It is geared
towards use by IDEs and similar consumers of the clang-c API where
fatal errors may arise when parsing incomplete code mid-edit, or
when include paths are not properly configured yet. In such situations
one still wants to get as much information as possible about a TU.
Previously, the semantic analysis would not instantiate templates
or report additional fatal errors after the first fatal error was
encountered.

Fixes PR24268.

Patch by Milian Wolff.

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

8 years agoTest template instantiation of ns_consumed and ns_returns_retained.
John McCall [Tue, 1 Mar 2016 06:54:30 +0000 (06:54 +0000)]
Test template instantiation of ns_consumed and ns_returns_retained.

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

8 years agoBetter comments for ExtParameterInfo.
John McCall [Tue, 1 Mar 2016 06:27:40 +0000 (06:27 +0000)]
Better comments for ExtParameterInfo.

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

8 years ago[test] After r262290 reducing stack usage, try re-enabling asan on the related test.
Argyrios Kyrtzidis [Tue, 1 Mar 2016 04:40:20 +0000 (04:40 +0000)]
[test] After r262290 reducing stack usage, try re-enabling asan on the related test.

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

8 years agoclang-format: Correctly apply wrap before multi-line RHS rule to
Daniel Jasper [Tue, 1 Mar 2016 04:19:59 +0000 (04:19 +0000)]
clang-format: Correctly apply wrap before multi-line RHS rule to
ternary expressions.

Before:
  return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb +
     cccccccccccccccc;

After:
  return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
     aaaaa :
     bbbbbbbbbbbbbbb + cccccccccccccccc;

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

8 years agoclang-format: Increase the penalty for breaking between array subscripts.
Daniel Jasper [Tue, 1 Mar 2016 04:19:55 +0000 (04:19 +0000)]
clang-format: Increase the penalty for breaking between array subscripts.

Before:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa]
                                    [a].aaaaaaaaaaaaaaaaaaaaaa();

After:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa][a]
      .aaaaaaaaaaaaaaaaaaaaaa();

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

8 years agoclang-format: [JS] Support quoted object literal keys.
Daniel Jasper [Tue, 1 Mar 2016 04:19:47 +0000 (04:19 +0000)]
clang-format: [JS] Support quoted object literal keys.

Before:
  var x = {
    a: a,
    b: b, 'c': c,
  };

After:
  var x = {
    a: a,
    b: b,
    'c': c,
  };

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

8 years ago[index] Fix issue where data visitation was disabled with C++ operator call expressio...
Argyrios Kyrtzidis [Tue, 1 Mar 2016 02:46:32 +0000 (02:46 +0000)]
[index] Fix issue where data visitation was disabled with C++ operator call expressions, during indexing.

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

8 years agoFix the template instantiation of ExtParameterInfos; tests to follow.
John McCall [Tue, 1 Mar 2016 02:09:25 +0000 (02:09 +0000)]
Fix the template instantiation of ExtParameterInfos; tests to follow.

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

8 years agoAdd an llvm_unreachable back to the autogeneration of this covered switch.
John McCall [Tue, 1 Mar 2016 02:09:20 +0000 (02:09 +0000)]
Add an llvm_unreachable back to the autogeneration of this covered switch.

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

8 years agoFix the testcase in r262282
Steven Wu [Tue, 1 Mar 2016 01:24:54 +0000 (01:24 +0000)]
Fix the testcase in r262282

-bitcode_bundle is only passed to the darwin ld64 linker and it is only
implemented there. Remove the check on the linker flag.

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

8 years agoMake test more robust.
Sean Silva [Tue, 1 Mar 2016 01:20:15 +0000 (01:20 +0000)]
Make test more robust.

Really all these tests are checking is that we find a file path. The
behavior when we don't find one will have `"ps4-ld"` in it. We just need
a path separator to know that a path has been found.

The root cause of the flakiness of these tests is the same on Windows
and non-Windows: setting the PATH environment variable is not sufficient
to guarantee that a particular path is looked up first.
Driver::GetProgramPath checks some paths before deferring to PATH
(in particular, the directory containing the clang binary itself).

I initally ran into this on Windows when putting a PS4 linker in
build-dir/bin/ps4-ld for testing.
After digging for a while thinking that it was some windows path search
oddity (the Windows SearchPathW documentation indicates that its
behavior varies depending on a registry setting...).
I eventually tried reproducing the issue on Mac and to my surprise found
the same issue.
Ultimately I traced it down to the extra lookups in
Driver::GetProgramPath.

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

8 years agoIntroduce -fembed-bitcode driver option
Steven Wu [Tue, 1 Mar 2016 01:07:58 +0000 (01:07 +0000)]
Introduce -fembed-bitcode driver option

Summary:
This is the clang driver part of the change to embedded bitcode. This
includes:
1. -fembed-bitcode option which breaks down the compilation into two
stages. The first stage emits optimized bitcode and the second stage
compiles bitcode into object file.
2. -fembed-bitcode-marker option which doesn't really break down to
two stages to speedup the compilation flow.
3. pass the correct linker flag to darwin linker if tool chains supports
embedded bitcode.

Reviewers: rsmith, thakis

Subscribers: thakis, cfe-commits

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

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

8 years agoGeneralize the consumed-parameter array on FunctionProtoType
John McCall [Tue, 1 Mar 2016 00:49:02 +0000 (00:49 +0000)]
Generalize the consumed-parameter array on FunctionProtoType
to allow arbitrary data to be associated with a parameter.

Also, fix a bug where we apparently haven't been serializing
this information for the last N years.

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

8 years ago[analyzer] Update CheckObjCDealloc diagnostic for missing -dealloc.
Devin Coughlin [Tue, 1 Mar 2016 00:39:04 +0000 (00:39 +0000)]
[analyzer] Update CheckObjCDealloc diagnostic for missing -dealloc.

Update the diagnostic for classes missing -dealloc to mention an instance
variable that needs to be released.

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

8 years agoInfrastructure improvements to Clang attribute TableGen.
John McCall [Tue, 1 Mar 2016 00:18:05 +0000 (00:18 +0000)]
Infrastructure improvements to Clang attribute TableGen.

This should make it easier to add new Attr subclasses.

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

8 years ago[analyzer] Teach CheckObjCDealloc about Block_release().
Devin Coughlin [Mon, 29 Feb 2016 23:57:10 +0000 (23:57 +0000)]
[analyzer] Teach CheckObjCDealloc about Block_release().

It now treats Block_release(b) as a release in addition to [b release].

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

8 years ago[analyzer] Don't treat calls to system headers as escaping in CheckObjCDealloc.
Devin Coughlin [Mon, 29 Feb 2016 21:44:08 +0000 (21:44 +0000)]
[analyzer] Don't treat calls to system headers as escaping in CheckObjCDealloc.

This prevents false negatives when a -dealloc method, for example, removes itself as
as an observer with [[NSNotificationCenter defaultCenter] removeObserver:self]. It is
unlikely that passing 'self' to a system header method will release 'self''s instance
variables, so this is unlikely to produce false positives.

A challenge here is that while CheckObjCDealloc no longer treats these calls as
escaping, the rest of the analyzer still does. In particular, this means that loads
from the same instance variable before and after a call to a system header will
result in different symbols being loaded by the region store. To account for this,
the checker now treats different ivar symbols with the same instance and ivar decl as
the same for the purpose of release checking and more eagerly removes a release
requirement when an instance variable is assumed to be nil. This was not needed before
because when an ivar escaped its release requirement was always removed -- now the
requirement is not removed for calls to system headers.

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

8 years ago[PGO] clang cc1 option change to enable IR level instrumentation
Rong Xu [Mon, 29 Feb 2016 18:54:59 +0000 (18:54 +0000)]
[PGO] clang cc1 option change to enable IR level instrumentation

This patch expands cc1 option -fprofile-instrument= with a new value: -fprofile-instrument=llvm
which enables IR level PGO instrumentation.

Reviewers: davidxl, silvas

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

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

8 years agoRevert "Implement new interfaces for code-formatting when applying replacements."
Manuel Klimek [Mon, 29 Feb 2016 16:44:16 +0000 (16:44 +0000)]
Revert "Implement new interfaces for code-formatting when applying replacements."

This reverts commit r262232.

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

8 years agoImplement new interfaces for code-formatting when applying replacements.
Manuel Klimek [Mon, 29 Feb 2016 16:27:41 +0000 (16:27 +0000)]
Implement new interfaces for code-formatting when applying replacements.

Patch by Eric Liu.

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

8 years agoAMDGPU: Add missing Volcanic Islands targets
Tom Stellard [Mon, 29 Feb 2016 15:08:56 +0000 (15:08 +0000)]
AMDGPU: Add missing Volcanic Islands targets

Reviewers: arsenm

Subscribers: cfe-commits

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

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

8 years agoclang-format: Don't format unrelated nested blocks.
Daniel Jasper [Mon, 29 Feb 2016 12:26:20 +0000 (12:26 +0000)]
clang-format: Don't format unrelated nested blocks.

With this change:

  SomeFunction(
      [] {
int i;
 return i;  // Format this line.
      },
      [] {
 return 2;  // Don't "fix" this.
      });

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

8 years ago[index] Print and test module import references.
Argyrios Kyrtzidis [Mon, 29 Feb 2016 07:56:07 +0000 (07:56 +0000)]
[index] Print and test module import references.

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

8 years ago[index] Add a caller relation for a call reference.
Argyrios Kyrtzidis [Mon, 29 Feb 2016 07:56:00 +0000 (07:56 +0000)]
[index] Add a caller relation for a call reference.

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

8 years ago[AST/RecursiveASTVisitor] Correction so that dataTraverseStmtPost will get called...
Argyrios Kyrtzidis [Mon, 29 Feb 2016 07:55:55 +0000 (07:55 +0000)]
[AST/RecursiveASTVisitor] Correction so that dataTraverseStmtPost will get called after the statement has been visited.

Fixes the indexing client of this.

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

8 years ago[index] Use ',' to separate symbol roles when printing.
Argyrios Kyrtzidis [Mon, 29 Feb 2016 07:55:51 +0000 (07:55 +0000)]
[index] Use ',' to separate symbol roles when printing.

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

8 years ago[X86] Disabling avx512f should also disable avx512vbmi and avx512ifma. Enabling avx51...
Craig Topper [Mon, 29 Feb 2016 06:51:38 +0000 (06:51 +0000)]
[X86] Disabling avx512f should also disable avx512vbmi and avx512ifma. Enabling avx512vbmi or avx512ifma should enable avx512f. Add command line switches and header defines for avx512ifma and avx512vbmi.

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

8 years ago[X86] Enabling xsave should not enable AVX. I seem to have done this, but I don't...
Craig Topper [Mon, 29 Feb 2016 06:51:34 +0000 (06:51 +0000)]
[X86] Enabling xsave should not enable AVX. I seem to have done this, but I don't know why.

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

8 years ago[OPENMP 4.5] Initial support for data members in 'reduction' clauses.
Alexey Bataev [Mon, 29 Feb 2016 05:54:20 +0000 (05:54 +0000)]
[OPENMP 4.5] Initial support for data members in 'reduction' clauses.

OpenMP 4.5 allows to privatize non-static data members of current class
in non-static member functions. Patch adds initial parsing/semantic
analysis for data members support in 'reduction' clauses.

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

8 years ago[clang-cl] /EHc should not effect functions with explicit exception specifications
David Majnemer [Mon, 29 Feb 2016 01:40:36 +0000 (01:40 +0000)]
[clang-cl] /EHc should not effect functions with explicit exception specifications

Functions with an explicit exception specification have their behavior
dictated by the specification.  The additional /EHc behavior only comes
into play if no exception specification is given.

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

8 years ago[clang-cl] /EHc should not have an effect on /EHa
David Majnemer [Mon, 29 Feb 2016 01:40:30 +0000 (01:40 +0000)]
[clang-cl] /EHc should not have an effect on /EHa

This matches behavior with MSVC.

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

8 years ago[modules] Prefer more complete array types.
Vassil Vassilev [Sun, 28 Feb 2016 19:08:24 +0000 (19:08 +0000)]
[modules] Prefer more complete array types.

If we import a module that has a complete array type and one that has an
incomplete array type, the declaration found by name lookup might be the one with
the incomplete type, possibly resulting in rejects-valid.

Now, the name lookup prefers decls with a complete array types. Also,
diagnose cases when the redecl chain has array bound, different from the merge
candidate.

Reviewed by Richard Smith.

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

8 years agoAdd ARM EHABI-related constants to unwind.h.
Logan Chien [Sun, 28 Feb 2016 15:01:42 +0000 (15:01 +0000)]
Add ARM EHABI-related constants to unwind.h.

Adds a number of constants, defined in the ARM EHABI spec, to the Clang
lib/Headers/unwind.h header. This is prerequisite for landing
http://reviews.llvm.org/D15781, as previously discussed there.

Patch by Timon Van Overveldt.

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding PSLL{V|W|Wi}{128|256|512} builtin
Michael Zuckerman [Sun, 28 Feb 2016 07:39:34 +0000 (07:39 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding PSLL{V|W|Wi}{128|256|512} builtin

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

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

8 years agoWorkaround doxygen bug https://bugzilla.gnome.org/show_bug.cgi?id=506243
Alexander Kornienko [Sat, 27 Feb 2016 14:02:08 +0000 (14:02 +0000)]
Workaround doxygen bug https://bugzilla.gnome.org/show_bug.cgi?id=506243

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

8 years agoCorrecting indentation for an RST code block.
Aaron Ballman [Sat, 27 Feb 2016 13:13:16 +0000 (13:13 +0000)]
Correcting indentation for an RST code block.

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

8 years agoAMDGPU: Add builtins for recently added intrinsics
Matt Arsenault [Sat, 27 Feb 2016 09:54:43 +0000 (09:54 +0000)]
AMDGPU: Add builtins for recently added intrinsics

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

8 years agoAMDGPU: Fix broken/confusing predefined macro
Matt Arsenault [Sat, 27 Feb 2016 09:06:26 +0000 (09:06 +0000)]
AMDGPU: Fix broken/confusing predefined macro

amdgcn should not be defining __R600__

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

8 years agoAMDGPU: Fix inconsistent register name for flat_scratch
Matt Arsenault [Sat, 27 Feb 2016 09:06:22 +0000 (09:06 +0000)]
AMDGPU: Fix inconsistent register name for flat_scratch

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

8 years agoAdd __builtin_canonicalize
Matt Arsenault [Sat, 27 Feb 2016 09:06:18 +0000 (09:06 +0000)]
Add __builtin_canonicalize

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

8 years agoFix bug in using shadow decl checking: a using shadow decl should not conflict
Richard Smith [Sat, 27 Feb 2016 02:36:43 +0000 (02:36 +0000)]
Fix bug in using shadow decl checking: a using shadow decl should not conflict
with a prior UsingDecl -- those should not even really be found by the lookup
here, except that we use the same lookup results for two different checks, and
the other check needs them.

This happens to work in *almost all* cases, because either the lookup results
list the UsingDecl first (and the NonTag result gets replaced by something
else) or because the problematic declaration is a function (which causes us to
use different logic to detect conflicts). This can also be triggered from a
state only reachable through modules (where the name lookup results can contain
multiple UsingDecls in the same scope).

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

8 years ago[OpenMP] Fix parsing of delete map clause modifier in C++ mode.
Samuel Antao [Sat, 27 Feb 2016 00:01:58 +0000 (00:01 +0000)]
[OpenMP] Fix parsing of delete map clause modifier in C++ mode.

Summary: The map modifier 'delete' is parser in c++ mode as a delete keyword, which requires special handling in the map clause parsing.

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

Subscribers: cfe-commits, fraggamuffin, caomhin

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

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

8 years ago[CMake] Only configure Native target in stage 1, configure all in other stages
Chris Bieneman [Fri, 26 Feb 2016 21:23:59 +0000 (21:23 +0000)]
[CMake] Only configure Native target in stage 1, configure all in other stages

This patch causes the 3-stage build pipeline to only build a host compiler in the first stage, and to build all targets for subsequent stages. The host target is determined via the Native target specifier added in r262070.

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

8 years ago[CMake] Add BINUTILS_INCDIR to the default passthrough list for multi-stage builds
Chris Bieneman [Fri, 26 Feb 2016 21:04:41 +0000 (21:04 +0000)]
[CMake] Add BINUTILS_INCDIR to the default passthrough list for multi-stage builds

This is needed to build the gold plugin in multi-stage builds.

Patch by Mike Edwards

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

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

8 years ago[dllexport] Sort out emission order of delayed exported classes
Reid Kleckner [Fri, 26 Feb 2016 19:51:02 +0000 (19:51 +0000)]
[dllexport] Sort out emission order of delayed exported classes

Relands r260194 with a fix. If we have a template that transitions from
an extern template to an explicitly instantiated dllexport template, we
would add that class to the delayed exported class list without flushing
it.

For explicit instantiations, we can just flush the list of delayed
classes immediately. We don't have to worry about the bug fixed in
r260194 in this case because explicit instantiations can only occur at
file and namespace scope.

Fixes PR26490.

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

8 years agoFix Clang tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.
Paul Robinson [Fri, 26 Feb 2016 19:34:01 +0000 (19:34 +0000)]
Fix Clang tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.
FileCheck actually doesn't support combo suffixes.

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

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

8 years agoSemaCXX: Support templates in availability attributes
Duncan P. N. Exon Smith [Fri, 26 Feb 2016 19:27:00 +0000 (19:27 +0000)]
SemaCXX: Support templates in availability attributes

If the availability context is `FunctionTemplateDecl`, we should look
through it to the `FunctionDecl`.  This prevents a diagnostic in the
following case:

    class C __attribute__((unavailable));
    template <class T> void foo(C&) __attribute__((unavailable));

This adds tests for availability in templates in many other cases, but
that was the only case that failed before this patch.

I added a feature `__has_feature(attribute_availability_in_templates)`
so users can test for this.

rdar://problem/24561029

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

8 years agoMinor tweak to match the overall style.
Sunil Srivastava [Fri, 26 Feb 2016 18:01:12 +0000 (18:01 +0000)]
Minor tweak to match the overall style.

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

8 years agoBasic: fix __USER_LABEL_PREFIX__ on Cygwin
Saleem Abdulrasool [Fri, 26 Feb 2016 16:34:01 +0000 (16:34 +0000)]
Basic: fix __USER_LABEL_PREFIX__ on Cygwin

Adjust the user label prefix for cygwin x86_64.

Resolves PR26744.

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

8 years agoReduce false positives in printf/scanf format checker
Andy Gibbs [Fri, 26 Feb 2016 15:35:16 +0000 (15:35 +0000)]
Reduce false positives in printf/scanf format checker

Summary:
The printf/scanf format checker is a little over-zealous in handling the conditional operator.  This patch reduces work by not checking code-paths that are never used and reduces false positives regarding uncovered arguments, for example in the code fragment:

printf(minimal ? "%i\n" : "%i: %s\n", code, msg);

Reviewers: rtrieu

Subscribers: cfe-commits

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

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

8 years agoFixing an issue with the code block so that it does not appear as a list.
Aaron Ballman [Fri, 26 Feb 2016 13:39:38 +0000 (13:39 +0000)]
Fixing an issue with the code block so that it does not appear as a list.

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

8 years agoGiving this attribute documentation group a heading; fixes a documentation generation...
Aaron Ballman [Fri, 26 Feb 2016 13:30:58 +0000 (13:30 +0000)]
Giving this attribute documentation group a heading; fixes a documentation generation error.

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

8 years agoTest commit.
Vassil Vassilev [Fri, 26 Feb 2016 10:43:34 +0000 (10:43 +0000)]
Test commit.

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

8 years ago[Driver] Disable frame pointer elimination by default if target is
Akira Hatanaka [Fri, 26 Feb 2016 05:07:00 +0000 (05:07 +0000)]
[Driver] Disable frame pointer elimination by default if target is
x86_64-pc-win32-macho.

rdar://problem/24470634

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

8 years ago[MSVC Compat] Don't evaluate member base expressions w/o side effects
David Majnemer [Fri, 26 Feb 2016 04:23:19 +0000 (04:23 +0000)]
[MSVC Compat] Don't evaluate member base expressions w/o side effects

A member expression's base doesn't always have an impact on what the
member decl would evaluate to.  In such a case, the base is used as a
poor man's scope qualifier.

This fixes PR26738.

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

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

8 years ago[analyzer] Prune some incorrect \param doc comment annotations.
Devin Coughlin [Fri, 26 Feb 2016 03:41:31 +0000 (03:41 +0000)]
[analyzer] Prune some incorrect \param doc comment annotations.

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

8 years agoCheckers/CheckObjCDealloc.cpp: Prune "\param". [-Wdocumentation]
NAKAMURA Takumi [Fri, 26 Feb 2016 03:15:13 +0000 (03:15 +0000)]
Checkers/CheckObjCDealloc.cpp: Prune "\param". [-Wdocumentation]

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

8 years agoOpenMPClause.h: Fix typo in \param. [-Wdocumentation]
NAKAMURA Takumi [Fri, 26 Feb 2016 03:15:09 +0000 (03:15 +0000)]
OpenMPClause.h: Fix typo in \param. [-Wdocumentation]

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

8 years ago[OpenCL] Refine OpenCLImageAccessAttr to OpenCLAccessAttr
Xiuli Pan [Fri, 26 Feb 2016 03:13:03 +0000 (03:13 +0000)]
[OpenCL] Refine OpenCLImageAccessAttr to OpenCLAccessAttr

Summary:
OpenCL access qualifiers are now not only used for image types, refine it to avoid misleading,

Add semacheck for OpenCL access qualifier as well as test caees.

Reviewers: pekka.jaaskelainen, Anastasia, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

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

8 years agoMake vtables_blacklist dependency conditional on existence of clang target.
Peter Collingbourne [Fri, 26 Feb 2016 03:07:33 +0000 (03:07 +0000)]
Make vtables_blacklist dependency conditional on existence of clang target.

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

8 years ago[analyzer] Shorten ObjcSuperDeallocChecker diagnostics.
Devin Coughlin [Fri, 26 Feb 2016 00:47:42 +0000 (00:47 +0000)]
[analyzer] Shorten ObjcSuperDeallocChecker diagnostics.

Change "use of 'self' after it has been freed with call to [super dealloc]" to
"use of 'self' after it has been deallocated" and "use of instance variable
'_ivar' after the instance has been freed with call to [super dealloc]" to
"use of instance variable '_ivar' after 'self' has been deallocated".

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

8 years ago[analyzer] Fix a memory error in r261935 caught by the Windows bots.
Devin Coughlin [Fri, 26 Feb 2016 00:23:41 +0000 (00:23 +0000)]
[analyzer] Fix a memory error in r261935 caught by the Windows bots.

It was using a temporary StringRef after its underlying storage was freed.

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

8 years ago[analyzer] Warn on use of 'self' after call to to [super dealloc].
Devin Coughlin [Thu, 25 Feb 2016 23:36:52 +0000 (23:36 +0000)]
[analyzer] Warn on use of 'self' after call to to [super dealloc].

Referring to 'self' after a call to [super dealloc] is a use-after-free in
Objective-C because NSObject's -dealloc frees the memory pointed to by self.
This patch extends the ObjCSuperDeallocChecker to catch this error.

rdar://problem/6953275

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

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

8 years ago[analyzer] Reapply r261917 with a fix.
Devin Coughlin [Thu, 25 Feb 2016 21:15:16 +0000 (21:15 +0000)]
[analyzer] Reapply r261917 with a fix.

This reapplies "[analyzer] Make ObjCDeallocChecker path sensitive." (r261917)
with a fix for an error on some bots about specializing a template
from another namespace.

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

8 years agoRevert "[analyzer] Make ObjCDeallocChecker path sensitive."
Devin Coughlin [Thu, 25 Feb 2016 19:13:43 +0000 (19:13 +0000)]
Revert "[analyzer] Make ObjCDeallocChecker path sensitive."

This reverts commit r261917. It broke the bots.

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

8 years ago[analyzer] Make ObjCDeallocChecker path sensitive.
Devin Coughlin [Thu, 25 Feb 2016 18:55:24 +0000 (18:55 +0000)]
[analyzer] Make ObjCDeallocChecker path sensitive.

Convert the ObjCDeallocChecker to be path sensitive. The primary
motivation for this change is to prevent false positives when -dealloc calls
helper invalidation methods to release instance variables, but it additionally
improves precision when -dealloc contains control flow. It also reduces the need
for pattern matching. The check for missing -dealloc methods remains AST-based.

Part of rdar://problem/6927496

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

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

8 years ago[CMake] Fixing install-clang-headers dependencies to depend on generating the headers.
Chris Bieneman [Thu, 25 Feb 2016 18:39:19 +0000 (18:39 +0000)]
[CMake] Fixing install-clang-headers dependencies to depend on generating the headers.

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

8 years agoAdd FieldNames to __NSConstantString_tag
Ben Langmuir [Thu, 25 Feb 2016 16:36:26 +0000 (16:36 +0000)]
Add FieldNames to __NSConstantString_tag

Since consumers of the AST may expect fields to be named.

Patch by Brad King!

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

8 years agoReplace a compiler-specific approach to determining the presence of a getDecl() membe...
Aaron Ballman [Thu, 25 Feb 2016 15:14:09 +0000 (15:14 +0000)]
Replace a compiler-specific approach to determining the presence of a getDecl() member function with one that does not require compiler-specific workarounds; NFC.

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

8 years ago[Sema] Remove assert in TreeTransform<Derived>::TransformObjCObjectType.
Akira Hatanaka [Thu, 25 Feb 2016 07:08:33 +0000 (07:08 +0000)]
[Sema] Remove assert in TreeTransform<Derived>::TransformObjCObjectType.

The assert isn't correct since TypeLoc::ObjCObjectTypeLoc doesn't
indicate whether the type is a dependent type. The function returns
false for a type like "<SomeProtocol>" which is a synonym for
"id<SomeProtocol>".

rdar://problem/23838912

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

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

8 years ago[OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.
Alexey Bataev [Thu, 25 Feb 2016 05:25:57 +0000 (05:25 +0000)]
[OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.

OpenMP 4.5 allows to privatize non-static member decls in non-static
member functions. Patch captures such decls by reference in general (for
bitfields, by value) and then operates with this capture. For bitfields,
at the end of codegen for lastprivates original bitfield is updated with the value of captured copy.

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

8 years agoTwek fix for PR24473 (r261506) - Preserve the template arguments as written
Faisal Vali [Thu, 25 Feb 2016 05:09:30 +0000 (05:09 +0000)]
Twek fix for PR24473 (r261506) - Preserve the template arguments as written
(within the DeclRefExpr Node) when creating AST nodes that reference specializations of static data member templates.  While we pass the template args through for all non-instance members, they should only be relevant (i.e. non-null) for variable template ids (assertion added for that assumption)

Also preserve the FoundDecl that refers to the canonical Decl (the  primary VarTemplateDecl for a variable template specialization) that we are referencing in our DeclRefExpr. Not sure why this was not being done for non-variable template-ids.

No functionality change - so no tests added.

Thanks to Richard Smith for drawing my attention to this!

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

8 years ago[OPENMP 4.5] Support fielddecls in 'shared' clause.
Alexey Bataev [Thu, 25 Feb 2016 03:59:29 +0000 (03:59 +0000)]
[OPENMP 4.5] Support fielddecls in 'shared' clause.

OpenMP 4.5 allows to use non-static data members of current class in
non-static member functions in different kind of clauses. Patch adds
support for data members in 'shared' clause.

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

8 years ago[OpenCL] Add Sema checks for types
Xiuli Pan [Thu, 25 Feb 2016 03:34:20 +0000 (03:34 +0000)]
[OpenCL] Add Sema checks for types

Summary:
Add Sema checks for opencl type: image, pipe....
This patch is partitioned from http://reviews.llvm.org/D16047

Reviewers: Anastasia, yaxunl

Subscribers: pekka.jaaskelainen, cfe-commits

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

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

8 years agoFix assertion failure on MaybeODRUseExprs.
Manman Ren [Wed, 24 Feb 2016 23:05:43 +0000 (23:05 +0000)]
Fix assertion failure on MaybeODRUseExprs.

In VisitNonTypeTemplateParamDecl, before SubstExpr with the default argument,
we should create a ConstantEvaluated ExpressionEvaluationContext. Without this,
it is possible to use a PotentiallyEvaluated ExpressionEvaluationContext; and
MaybeODRUseExprs will not be cleared when popping the context, causing
assertion failure.

This is similar to how we handle the context before SubstExpr with the
default argument, in SubstDefaultTemplateArgument.

Part of PR13986.
rdar://24480205

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

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

8 years agoMinor cleanup of Sema::CheckEnableIf. NFC.
George Burgess IV [Wed, 24 Feb 2016 22:31:14 +0000 (22:31 +0000)]
Minor cleanup of Sema::CheckEnableIf. NFC.

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

8 years agoRevert "Don't convert a char to a const char *"
David Majnemer [Wed, 24 Feb 2016 22:07:26 +0000 (22:07 +0000)]
Revert "Don't convert a char to a const char *"

This reverts commit r261780.  It turns out the original code was just
fine.  An overload for ltrim which takes char was added but the Doxygen
docs haven't seemed to pick it up.

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

8 years agoFix build by using hasFlag instead of hasArg.
Peter Collingbourne [Wed, 24 Feb 2016 22:03:06 +0000 (22:03 +0000)]
Fix build by using hasFlag instead of hasArg.

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

8 years agoPR26237: Fix iterator invalidation bug that occurs if serializing
Richard Smith [Wed, 24 Feb 2016 21:59:10 +0000 (21:59 +0000)]
PR26237: Fix iterator invalidation bug that occurs if serializing
specializations of a template manages to trigger deserialization of more
specializations of the same template.

No test case provided: this is hard to reliably test due to standard library
differences.

Patch by Vassil Vassilev!

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

8 years agoDon't convert a char to a const char *
David Majnemer [Wed, 24 Feb 2016 21:55:58 +0000 (21:55 +0000)]
Don't convert a char to a const char *

This fixes PR26728.

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

8 years ago[CUDA] Mark all CUDA device-side function defs, decls, and calls as convergent.
Justin Lebar [Wed, 24 Feb 2016 21:55:11 +0000 (21:55 +0000)]
[CUDA] Mark all CUDA device-side function defs, decls, and calls as convergent.

Summary:
This is important for e.g. the following case:

  void sync() { __syncthreads(); }
  void foo() {
    do_something();
    sync();
    do_something_else():
  }

Without this change, if the optimizer does not inline sync() (which it
won't because __syncthreads is also marked as noduplicate, for now
anyway), it is free to perform optimizations on sync() that it would not
be able to perform on __syncthreads(), because sync() is not marked as
convergent.

Similarly, we need a notion of convergent calls, since in the case when
we can't statically determine a call's target(s), we need to know
whether it's safe to perform optimizations around the call.

This change is conservative; the optimizer will remove these attrs where
it can, see r260318, r260319.

Reviewers: majnemer

Subscribers: cfe-commits, jhen, echristo, tra

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

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