]> granicus.if.org Git - clang/log
clang
7 years agoFix diagnostic format string for err_os_log_argument_to_big
Benjamin Kramer [Tue, 25 Oct 2016 12:39:28 +0000 (12:39 +0000)]
Fix diagnostic format string for err_os_log_argument_to_big

Patch by Sam McCall, test case by me.

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

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

7 years agoInclude full filename range for missing includes
Erik Verbruggen [Tue, 25 Oct 2016 10:13:10 +0000 (10:13 +0000)]
Include full filename range for missing includes

For the purpose of highlighting in an IDE.

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

7 years agoFix 'unknown documentation command' warning ranges
Erik Verbruggen [Tue, 25 Oct 2016 10:06:11 +0000 (10:06 +0000)]
Fix 'unknown documentation command' warning ranges

Warnings generated by -Wdocumentation-unknown-command did only have a
start location, not a full source range. This resulted in only the
"carret" being show in messages, and IDEs highlighting only the single
initial character.

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

7 years ago[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&...
Michael Zuckerman [Tue, 25 Oct 2016 07:56:04 +0000 (07:56 +0000)]
[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&&,||) intrinsics to Clang

Committed after LGTM and check-all

Vector-reduction arithmetic accepts vectors as inputs and produces scalars as outputs.
This class of vector operation forms the basis of many scientific computations.
In vector-reduction arithmetic, the evaluation off is independent of the order of the input elements of V.

Used bisection method. At each step, we partition the vector with previous
step in half, and the operation is performed on its two halves.
This takes log2(n) steps where n is the number of elements in the vector.

Reviwer: 1. igorb
         2. craig.topper
Differential Revision: https://reviews.llvm.org/D25527

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

7 years agoFix handling of %% format specifier in os_log builtins.
Mehdi Amini [Tue, 25 Oct 2016 00:48:48 +0000 (00:48 +0000)]
Fix handling of %% format specifier in os_log builtins.

Returning `false` was stopping the parsing of further arguments,
which wasn't intended.

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

7 years agoAdd dependency from clangCodeGen to clangAnalysis
Mehdi Amini [Mon, 24 Oct 2016 23:38:32 +0000 (23:38 +0000)]
Add dependency from clangCodeGen to clangAnalysis

This is unbreaking the build with shared library after r285019.

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

7 years agotest/CodeGen/builtins.c: reinstate #ifdef __x86_64__ around __builtin_longjmp
Mehdi Amini [Mon, 24 Oct 2016 23:38:24 +0000 (23:38 +0000)]
test/CodeGen/builtins.c: reinstate #ifdef __x86_64__ around __builtin_longjmp

Unadvertently removed in r285019

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

7 years ago[Basic] Support 32-bit x86 and ARM targets for Fuchsia
Petr Hosek [Mon, 24 Oct 2016 22:55:57 +0000 (22:55 +0000)]
[Basic] Support 32-bit x86 and ARM targets for Fuchsia

Fuchsia has experimental support for 32-bit x86 and ARM targets, add
them to the list of supported targets.

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

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

7 years agoLink clangCodeGen with clangAnalysis required after r284990.
Artem Belevich [Mon, 24 Oct 2016 22:52:39 +0000 (22:52 +0000)]
Link clangCodeGen with clangAnalysis required after r284990.

Fixes build break for configurations that use shared libraries.

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

7 years ago[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
Akira Hatanaka [Mon, 24 Oct 2016 21:45:54 +0000 (21:45 +0000)]
[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured
by blocks.

Add a new warning "-Wblock-capture-autoreleasing". The warning warns
about implicitly autoreleasing out-parameters captured by blocks which
can introduce use-after-free bugs that are hard to debug.

rdar://problem/15377548

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

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

7 years agoCodeGen: remove incorrect temporary Twine
Saleem Abdulrasool [Mon, 24 Oct 2016 21:25:57 +0000 (21:25 +0000)]
CodeGen: remove incorrect temporary Twine

Twines should not be stack allocated.  This somehow managed to get past me.

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

7 years agoFix test on non-X86 platforms
Mehdi Amini [Mon, 24 Oct 2016 21:22:01 +0000 (21:22 +0000)]
Fix test on non-X86 platforms

This is a fixup for r285019, adding an `#ifdef __x86_64__` since
the os_log builtin is platform specific.

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

7 years agoCodeGen: centralise label construction for method lists
Saleem Abdulrasool [Mon, 24 Oct 2016 20:47:58 +0000 (20:47 +0000)]
CodeGen: centralise label construction for method lists

Move all the label construction for the various method list emission into
EmitMethodList.  Rather than have all the names be constructed in pieces in all
of the callers of EmitMethodList, have this occur in one site.  This also makes
the calls much easier to understand as we simplify identify the type of the
method list being emitted and the interface name for which it is being emitted.
NFC.

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

7 years agoFix bug where one of the cases where we mangle a <bare-unresolved-name> failed
Richard Smith [Mon, 24 Oct 2016 20:47:04 +0000 (20:47 +0000)]
Fix bug where one of the cases where we mangle a <bare-unresolved-name> failed
to emit the <template-args> portion. Refactor so that mangleUnresolvedName
actually emits the entire <unresolved-name>, so this mistake is harder to make
again.

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

7 years agoAdd support for __builtin_os_log_format[_buffer_size]
Mehdi Amini [Mon, 24 Oct 2016 20:39:34 +0000 (20:39 +0000)]
Add support for __builtin_os_log_format[_buffer_size]

This reverts commit r285007 and reapply r284990, with a fix for the
opencl test that I broke. Original commit message follows:

These new builtins support a mechanism for logging OS events, using a
printf-like format string to specify the layout of data in a buffer.
The _buffer_size version of the builtin can be used to determine the size
of the buffer to allocate to hold the data, and then __builtin_os_log_format
can write data into that buffer. This implements format checking to report
mismatches between the format string and the data arguments. Most of this
code was written by Chris Willmore.

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

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

7 years agoFix mangling of implicit calls to operator-> to only include a single "pt",
Richard Smith [Mon, 24 Oct 2016 20:29:40 +0000 (20:29 +0000)]
Fix mangling of implicit calls to operator-> to only include a single "pt",
rather than including an extra one for each level of 'operator->()' invoked.

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

7 years agoRevert "Add support for __builtin_os_log_format[_buffer_size]"
Mehdi Amini [Mon, 24 Oct 2016 19:41:36 +0000 (19:41 +0000)]
Revert "Add support for __builtin_os_log_format[_buffer_size]"

This reverts commit r284990, two opencl test are broken

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

7 years ago[clang] Remove redundant --check-prefix=CHECK from tests
Mandeep Singh Grang [Mon, 24 Oct 2016 18:53:43 +0000 (18:53 +0000)]
[clang] Remove redundant --check-prefix=CHECK from tests

Reviewers: mkuper, rengolin, hans

Subscribers: cfe-commits

Tags: #clang-c

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

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

7 years ago[analyzer] Use unsigned integers to rely on well-defined overflow semantics.
Artem Dergachev [Mon, 24 Oct 2016 18:49:04 +0000 (18:49 +0000)]
[analyzer] Use unsigned integers to rely on well-defined overflow semantics.

Found by the UBSan buildbot.

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

7 years agoFix crash if StmtProfile finds a type-dependent member access for which we have
Richard Smith [Mon, 24 Oct 2016 18:47:04 +0000 (18:47 +0000)]
Fix crash if StmtProfile finds a type-dependent member access for which we have
resolved the -> to a call to a specific operator-> function. The particular
test case added here is actually being mishandled: the implicit member access
should not be type-dependent (because it's accessing a non-type-dependent
member of the current instantiation), but calls to a type-dependent operator->
that is a member of the current instantiation would be liable to hit the same
codepath.

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

7 years agoAdd support for __builtin_os_log_format[_buffer_size]
Mehdi Amini [Mon, 24 Oct 2016 16:56:23 +0000 (16:56 +0000)]
Add support for __builtin_os_log_format[_buffer_size]

These new builtins support a mechanism for logging OS events, using a
printf-like format string to specify the layout of data in a buffer.
The _buffer_size version of the builtin can be used to determine the size
of the buffer to allocate to hold the data, and then __builtin_os_log_format
can write data into that buffer. This implements format checking to report
mismatches between the format string and the data arguments. Most of this
code was written by Chris Willmore.

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

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

7 years agoFix clang-format vim integration issue with non-ascii characters
Alexander Kornienko [Mon, 24 Oct 2016 16:31:26 +0000 (16:31 +0000)]
Fix clang-format vim integration issue with non-ascii characters

clang-format.py currently seems to treat vim.current.buf as ascii-encoded data,
which leads to an UnicodeDecodeError when trying to format any text containing
non-ascii characters:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".../tools/clang/tools/clang-format/clang-format.py", line 110, in <module>
    main()
  File ".../tools/clang/tools/clang-format/clang-format.py", line 87, in main
    stdout, stderr = p.communicate(input=text.encode(encoding))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3996: ordinal not in range(128)

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

7 years ago[analyzer] Fix an ARM buildbot after r284960.
Artem Dergachev [Mon, 24 Oct 2016 12:54:27 +0000 (12:54 +0000)]
[analyzer] Fix an ARM buildbot after r284960.

I guess we should always specify triples in all analyzer tests, regardless.

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

7 years agorevert r284963
Michael Zuckerman [Mon, 24 Oct 2016 11:30:23 +0000 (11:30 +0000)]
revert r284963

because new test file is failing in some OS.
test/CodeGen/avx512-reduceIntrin.c

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

7 years agoAdjust for TimePoint interface change in llvm: D25730. NFC
Pavel Labath [Mon, 24 Oct 2016 10:59:13 +0000 (10:59 +0000)]
Adjust for TimePoint interface change in llvm: D25730. NFC

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

7 years ago[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&...
Michael Zuckerman [Mon, 24 Oct 2016 10:53:20 +0000 (10:53 +0000)]
[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (Operators: +,*,&&,||) intrinsics to Clang

Committed after LGTM and check-all

Vector-reduction arithmetic accepts vectors as inputs and produces scalars as outputs.
This class of vector operation forms the basis of many scientific computations.
In vector-reduction arithmetic, the evaluation off is independent of the order of the input elements of V.

Used bisection method. At each step, we partition the vector with previous
step in half, and the operation is performed on its two halves.
This takes log2(n) steps where n is the number of elements in the vector.

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

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

7 years ago[Sema] Formatting warnings should see through Objective-C message sends
Alex Lorenz [Mon, 24 Oct 2016 09:42:34 +0000 (09:42 +0000)]
[Sema] Formatting warnings should see through Objective-C message sends

This commit improves the '-Wformat' warnings by ensuring that the formatting
checker can see through Objective-C message sends when we are calling an
Objective-C method with an appropriate format_arg attribute.

rdar://23622446

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

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

7 years ago[analyzer] Add StdLibraryFunctions checker.
Artem Dergachev [Mon, 24 Oct 2016 09:41:38 +0000 (09:41 +0000)]
[analyzer] Add StdLibraryFunctions checker.

This checker does not emit reports, however it influences the analysis
by providing complete summaries for, or otherwise improving modeling of,
various standard library functions.

This should reduce the number of infeasible paths explored during analysis.
The custom function summary format used in this checker is superior to
body farms by causing less unnecessary state splits,
which would result in better analysis performance.

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

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

7 years ago[Sema][TreeTransform] Re-create DesignatedInitExpr when a field designator
Alex Lorenz [Mon, 24 Oct 2016 09:33:32 +0000 (09:33 +0000)]
[Sema][TreeTransform] Re-create DesignatedInitExpr when a field designator
has no field declaration.

This commit fixes an invalid Winitializer-overrides warning that's shown
when analyzing a second (or any after the first) instantiation of a designated
initializer. This invalid warning is fixed by making sure that a
DesignatedInitExpr is rebuilt by the tree transformer when it has a field
designator whose FieldDecl* hasn't been yet initialized. This ensures that a
different DesignatedInitExpr is processed by Sema for every instantiation, and
thus the invalid warning is avoided.

rdar://28768441

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

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

7 years agoFix myriad test with CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Mon, 24 Oct 2016 08:04:17 +0000 (08:04 +0000)]
Fix myriad test with CLANG_DEFAULT_CXX_STDLIB

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

7 years ago[AVX-512] Replace 64-bit element and 512-bit vector pmin/pmax builtins with native...
Craig Topper [Mon, 24 Oct 2016 04:04:24 +0000 (04:04 +0000)]
[AVX-512] Replace 64-bit element and 512-bit vector pmin/pmax builtins with native IR like we do for 128/256-bit, but with the addition of masking.

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

7 years ago[AVX-512] Replace masked 128/256-bit byte, word, and dword min/max builtins with...
Craig Topper [Sun, 23 Oct 2016 23:57:30 +0000 (23:57 +0000)]
[AVX-512] Replace masked 128/256-bit byte, word, and dword min/max builtins with selects and the older unmasked builtins.

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

7 years agoRemove LLVM_CONSTEXPR.
Justin Lebar [Sun, 23 Oct 2016 19:39:16 +0000 (19:39 +0000)]
Remove LLVM_CONSTEXPR.

Summary: With MSVC 2013 and GCC < 4.8 gone, we can use the "constexpr" keyword.

Reviewers: bkramer, mehdi_amini

Subscribers: llvm-commits

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

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

7 years ago[AVX-512] Replace 512-bit pmovzx/sx builtins with native IR.
Craig Topper [Sun, 23 Oct 2016 07:35:47 +0000 (07:35 +0000)]
[AVX-512] Replace 512-bit pmovzx/sx builtins with native IR.

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

7 years ago[AVX-512] Remove masked 128/256-bit packss/packus builtins and replace with selects...
Craig Topper [Sun, 23 Oct 2016 07:35:39 +0000 (07:35 +0000)]
[AVX-512] Remove masked 128/256-bit packss/packus builtins and replace with selects and the older unmasked builtins.

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

7 years agoAdd more doxygen comments to emmintrin.h's intrinsics.
Ekaterina Romanova [Sun, 23 Oct 2016 07:30:50 +0000 (07:30 +0000)]
Add more doxygen comments to emmintrin.h's intrinsics.

With this patch, all intrinsics in this file (with an exception of a handful of a recently added ones) will be documented. I will send out a patch for 4 missining intrisics later.

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

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

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

7 years agoFix mangling numbers for varargs lambdas; varargs and non-varargs lambdas get
Richard Smith [Sun, 23 Oct 2016 04:53:03 +0000 (04:53 +0000)]
Fix mangling numbers for varargs lambdas; varargs and non-varargs lambdas get
different lambda-sigs, so they should have different counters.

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

7 years ago[clang] Limit clang test to ARM and AArch64 only
Mandeep Singh Grang [Sun, 23 Oct 2016 00:53:03 +0000 (00:53 +0000)]
[clang] Limit clang test to ARM and AArch64 only

Summary: Limit clang/test/Frontend/gnu-mcount.c to ARM and AArch64 only.

Reviewers: abdulras, honggyu.kim, rengolin

Subscribers: aemerson, rengolin, cfe-commits

Tags: #clang-c

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

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

7 years ago[AVX-512] Replace masked 128/256-bit pavg builtins and replace with select and older...
Craig Topper [Sat, 22 Oct 2016 21:24:56 +0000 (21:24 +0000)]
[AVX-512] Replace masked 128/256-bit pavg builtins and replace with select and older unmasked builtins.

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

7 years ago[AVX-512] Replace masked 128/256-bit saturating add/sub builtins with select and...
Craig Topper [Sat, 22 Oct 2016 21:24:52 +0000 (21:24 +0000)]
[AVX-512] Replace masked 128/256-bit saturating add/sub builtins with select and older unmasked builtins.

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

7 years ago[AVX-512] Replace masked 128/256-bit vpmovzx/vpmovsx builtins with native IR.
Craig Topper [Sat, 22 Oct 2016 21:24:48 +0000 (21:24 +0000)]
[AVX-512] Replace masked 128/256-bit vpmovzx/vpmovsx builtins with native IR.

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

7 years ago[AVX-512] Remove duplicate test cases from the avx512vlbw intrinsic test. These tests...
Craig Topper [Sat, 22 Oct 2016 21:24:44 +0000 (21:24 +0000)]
[AVX-512] Remove duplicate test cases from the avx512vlbw intrinsic test. These tests already exist in the avx512vl test and represent avx512vl instructions.

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

7 years ago[AVX-512] Remove masked 128/256-bit pshufb builtins. Replace with a select and the...
Craig Topper [Sat, 22 Oct 2016 21:24:42 +0000 (21:24 +0000)]
[AVX-512] Remove masked 128/256-bit pshufb builtins. Replace with a select and the older unmaksed builtins.

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

7 years ago[AVX-512] Remove builtins for 128/256-bit pabsb/pabsw. We can use a select and the...
Craig Topper [Sat, 22 Oct 2016 21:24:38 +0000 (21:24 +0000)]
[AVX-512] Remove builtins for 128/256-bit pabsb/pabsw. We can use a select and the older non-masked versions instead.

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

7 years ago[AVX-512] Add typecasts to alignr intrinsics that were modified in r284920.
Craig Topper [Sat, 22 Oct 2016 21:24:34 +0000 (21:24 +0000)]
[AVX-512] Add typecasts to alignr intrinsics that were modified in r284920.

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

7 years ago[AVX-512] Remove masked 128/256-bit palignr builtins. We can just use a select in...
Craig Topper [Sat, 22 Oct 2016 18:32:33 +0000 (18:32 +0000)]
[AVX-512] Remove masked 128/256-bit palignr builtins. We can just use a select in the header file with the older unmasked versions instead.

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

7 years agoMark P0012R1 as "Partial" since it's now substantially complete.
Richard Smith [Sat, 22 Oct 2016 01:35:34 +0000 (01:35 +0000)]
Mark P0012R1 as "Partial" since it's now substantially complete.

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

7 years agoAdd another testcase missed from r284905.
Richard Smith [Sat, 22 Oct 2016 01:32:45 +0000 (01:32 +0000)]
Add another testcase missed from r284905.

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

7 years ago[c++1z] P0012R1: Implement a few remaining pieces: downgrade diagnostic for
Richard Smith [Sat, 22 Oct 2016 01:32:19 +0000 (01:32 +0000)]
[c++1z] P0012R1: Implement a few remaining pieces: downgrade diagnostic for
mismatched dynamic exception specifications in expressions from an error to a
warning, since this is no longer ill-formed in C++1z.

Allow reference binding of a reference-to-non-noexcept function to a noexcept
function lvalue. As defect resolutions, also allow a conditional between
noexcept and non-noexcept function lvalues to produce a non-noexcept function
lvalue (rather than decaying to a function pointer), and allow function
template argument deduction to deduce a reference to non-noexcept function when
binding to a noexcept function type.

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

7 years agoModule: correctly set the module file kind when emitting file_modified.
Manman Ren [Fri, 21 Oct 2016 23:35:03 +0000 (23:35 +0000)]
Module: correctly set the module file kind when emitting file_modified.

rdar://28503343

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

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

7 years agoModule: improve the diagnostic message for include of non-modular header.
Manman Ren [Fri, 21 Oct 2016 23:27:37 +0000 (23:27 +0000)]
Module: improve the diagnostic message for include of non-modular header.

Emit the actual path to the non-modular include.

rdar://28897010

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

7 years agoRemove unnecessary distinction between Ref_Compatible and
Richard Smith [Fri, 21 Oct 2016 23:01:55 +0000 (23:01 +0000)]
Remove unnecessary distinction between Ref_Compatible and
Ref_Compatible_With_Added_Qualification. We always treated these two values the
same way.

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

7 years agoDR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
Richard Smith [Fri, 21 Oct 2016 22:00:42 +0000 (22:00 +0000)]
DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
This has two significant effects:

1) Direct relational comparisons between null pointer constants (0 and nullopt)
   and pointers are now ill-formed. This was always the case for C, and it
   appears that C++ only ever permitted by accident. For instance, cases like
     nullptr < &a
   are now rejected.

2) Comparisons and conditional operators between differently-cv-qualified
   pointer types now work, and produce a composite type that both source
   pointer types can convert to (when possible). For instance, comparison
   between 'int **' and 'const int **' is now valid, and uses an intermediate
   type of 'const int *const *'.

Clang previously supported #2 as an extension.

We do not accept the cases in #1 as an extension. I've tested a fair amount of
code to check that this doesn't break it, but if it turns out that someone is
relying on this, we can easily add it back as an extension.

This is a re-commit of r284800.

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

7 years agoSwitch SmallSetVector to use DenseSet when it overflows its inline space.
Justin Lebar [Fri, 21 Oct 2016 21:45:01 +0000 (21:45 +0000)]
Switch SmallSetVector to use DenseSet when it overflows its inline space.

Summary:
SetVector already used DenseSet, but SmallSetVector used std::set.  This
leads to surprising performance differences.  Moreover, it means that
the set of key types accepted by SetVector and SmallSetVector are
quite different!

In order to make this change, we had to convert some callsites that used
SmallSetVector<std::string, N> to use SmallSetVector<CachedHashString, N>
instead.

Reviewers: timshen

Subscribers: llvm-commits

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

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

7 years ago[Sema] Store a SourceRange for multi-token builtin types
Malcolm Parsons [Fri, 21 Oct 2016 21:13:56 +0000 (21:13 +0000)]
[Sema] Store a SourceRange for multi-token builtin types

Summary:
clang-tidy's modernize-use-auto check uses the SourceRange of a
TypeLoc when replacing the type with auto.
This was producing the wrong result for multi-token builtin types
like long long:

-long long *ll = new long long();
+auto long *ll = new long long();

Reviewers: alexfh, hokein, rsmith, Prazek, aaron.ballman

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Simplify some repeated diagnostic expectations in CUDA tests.
Justin Lebar [Fri, 21 Oct 2016 20:50:47 +0000 (20:50 +0000)]
[CUDA] Simplify some repeated diagnostic expectations in CUDA tests.

Instead of repeating the diagnostic, use "expected-note N".

Test-only change.

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

7 years agoDeclare H and H new/delete.
Artem Belevich [Fri, 21 Oct 2016 20:34:05 +0000 (20:34 +0000)]
Declare H and H new/delete.

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

7 years agoRemove accidentally checked in assert.
Vassil Vassilev [Fri, 21 Oct 2016 20:30:30 +0000 (20:30 +0000)]
Remove accidentally checked in assert.

Thanks to Manman for spotting this.

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

7 years ago[CUDA] Use FunctionDeclAndLoc for the Sema::LocsWithCUDACallDiags hashtable.
Justin Lebar [Fri, 21 Oct 2016 20:08:52 +0000 (20:08 +0000)]
[CUDA] Use FunctionDeclAndLoc for the Sema::LocsWithCUDACallDiags hashtable.

Summary: NFC

Reviewers: rnk

Subscribers: cfe-commits

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

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

7 years agoRemove move constructors that are identical to the generated default move ctor.
Benjamin Kramer [Fri, 21 Oct 2016 18:55:07 +0000 (18:55 +0000)]
Remove move constructors that are identical to the generated default move ctor.

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

7 years agoRemoved unused function argument. NFC.
Artem Belevich [Fri, 21 Oct 2016 17:15:46 +0000 (17:15 +0000)]
Removed unused function argument. NFC.

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

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

7 years agoRemove unnecessary x86 backend requirements from OpenMP tests
Reid Kleckner [Fri, 21 Oct 2016 16:09:20 +0000 (16:09 +0000)]
Remove unnecessary x86 backend requirements from OpenMP tests

Clang can generate LLVM IR for x86 without a registered x86 backend.

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

7 years agoRemove non-existing file from modulemap.
Benjamin Kramer [Fri, 21 Oct 2016 10:19:37 +0000 (10:19 +0000)]
Remove non-existing file from modulemap.

This picked up a builtin header if it happened to be available.

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

7 years agoRevert "DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules."
Renato Golin [Fri, 21 Oct 2016 08:03:49 +0000 (08:03 +0000)]
Revert "DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules."

This reverts commit r284800, as it failed all ARM/AArch64 bots.

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

7 years agoclang-format: [JS] Fix template string ASI.
Martin Probst [Fri, 21 Oct 2016 05:11:38 +0000 (05:11 +0000)]
clang-format: [JS] Fix template string ASI.

Summary:
Previously, automatic semicolon insertion would add an unwrapped line
when a template string contained a line break.

    var x = `foo${
        bar}`;

Would be formatted with `bar...` on a separate line and no indent.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years agoDon't try to use !Previous.empty() as a proxy for "Is this a redeclaration?" --
Richard Smith [Fri, 21 Oct 2016 03:15:03 +0000 (03:15 +0000)]
Don't try to use !Previous.empty() as a proxy for "Is this a redeclaration?" --
we don't collapse that down to a single entry if it's not a redeclaration.
Instead, set the Redeclaration bit on the Declarator to indicate whether a
function is a redeclaration (which may not have been linked into the
redeclaration chain if it's a dependent context friend).

Fixes a rejects-valid; see testcase.

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

7 years agoDR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
Richard Smith [Fri, 21 Oct 2016 02:36:37 +0000 (02:36 +0000)]
DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.
This has two significant effects:

1) Direct relational comparisons between null pointer constants (0 and nullopt)
   and pointers are now ill-formed. This was always the case for C, and it
   appears that C++ only ever permitted by accident. For instance, cases like
     nullptr < &a
   are now rejected.

2) Comparisons and conditional operators between differently-cv-qualified
   pointer types now work, and produce a composite type that both source
   pointer types can convert to (when possible). For instance, comparison
   between 'int **' and 'const int **' is now valid, and uses an intermediate
   type of 'const int *const *'.

Clang previously supported #2 as an extension.

We do not accept the cases in #1 as an extension. I've tested a fair amount of
code to check that this doesn't break it, but if it turns out that someone is
relying on this, we can easily add it back as an extension.

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

7 years ago[Driver][Darwin] Pass -no_deduplicate to ld64
Bruno Cardoso Lopes [Fri, 21 Oct 2016 01:49:14 +0000 (01:49 +0000)]
[Driver][Darwin] Pass -no_deduplicate to ld64

Recent versions of ld64 run a deduplicate pass, which is on by default.
Disable the pass by using -no_deduplicate in certain condition and
enhance total compile time.

rdar://problem/25455336

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

7 years ago[Modules] Add 'no_undeclared_includes' module map attribute
Bruno Cardoso Lopes [Fri, 21 Oct 2016 01:41:56 +0000 (01:41 +0000)]
[Modules] Add 'no_undeclared_includes' module map attribute

The 'no_undeclared_includes' attribute should be used in a module to
tell that only non-modular headers and headers from used modules are
accepted.

The main motivation behind this is to prevent dep cycles between system
libraries (such as darwin) and libc++.

Patch by Richard Smith!

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

7 years agoRevert 9 changes from r284793, they still fail on some bots
Reid Kleckner [Thu, 20 Oct 2016 23:30:39 +0000 (23:30 +0000)]
Revert 9 changes from r284793, they still fail on some bots

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

7 years agoRemove 24 instances of 'REQUIRES: shell'
Reid Kleckner [Thu, 20 Oct 2016 23:11:45 +0000 (23:11 +0000)]
Remove 24 instances of 'REQUIRES: shell'

Tests fall into one of the following categories:

- The requirement was unnecessary

- Additional quoting was required for backslashes in paths (see "sed -e
  's/\\/\\\\/g'") in the sanitizer tests.

- OpenMP used 'REQUIRES: shell' as a proxy for the test failing on
  Windows. Those tests fail there reliably, so use XFAIL instead.

I tried not to remove shell requirements that were added to suppress
flaky test failures, but if I screwed up, we can add it back as needed.

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

7 years agoRe-commit r284753, reverted in r284778, with a fix for PR30749.
Richard Smith [Thu, 20 Oct 2016 21:53:09 +0000 (21:53 +0000)]
Re-commit r284753, reverted in r284778, with a fix for PR30749.

Original commit message:

[c++1z] Teach composite pointer type computation how to compute the composite
pointer type of two function pointers with different noexcept specifications.
While I'm here, also teach it how to merge dynamic exception specifications.

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

7 years ago[clang] Remove FileEntry copy-constructor
Alexander Shaposhnikov [Thu, 20 Oct 2016 21:20:35 +0000 (21:20 +0000)]
[clang] Remove FileEntry copy-constructor

Code cleanup: address FIXME in the file
include/clang/Basic/FileManager.h and remove
copy-constructor of the class FileEntry.

Test plan: make check-clang

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

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

7 years agoRevert "Disable swiftcall test on windows: More brutal way to appease windows bots"
Reid Kleckner [Thu, 20 Oct 2016 21:17:28 +0000 (21:17 +0000)]
Revert "Disable swiftcall test on windows: More brutal way to appease windows bots"

This reverts commit r284174. The tests pass for me locally. It must have
been a 2015 only crash.

Fixes PR30699

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

7 years agoRevert r284753 "[c++1z] Teach composite pointer type computation how to compute the...
Hans Wennborg [Thu, 20 Oct 2016 20:54:32 +0000 (20:54 +0000)]
Revert r284753 "[c++1z] Teach composite pointer type computation how to compute the composite"

It caused PR30749.

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

7 years agoFix off-by-one error in PPCaching.cpp token annotation assertion
Reid Kleckner [Thu, 20 Oct 2016 20:53:20 +0000 (20:53 +0000)]
Fix off-by-one error in PPCaching.cpp token annotation assertion

This assert is intended to defend against backtracking into the middle
of a sequence of tokens that is being replaced with an annotation, but
it's OK if we backtrack to the exact position of the start of the
annotation sequence. Use a <= comparison instead of <.

Fixes PR25946

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

7 years ago[Driver] Refactor DetectDistro() parameters to take VFS ref only. NFC
Michal Gorny [Thu, 20 Oct 2016 20:45:40 +0000 (20:45 +0000)]
[Driver] Refactor DetectDistro() parameters to take VFS ref only. NFC

Refactor the DetectDistro() function to take a single vfs::FileSystem
reference only, instead of Driver and llvm::Triple::ArchType.
The ArchType parameter was not used anyway, and Driver was only used to
obtain the VFS.

Aside to making the API simpler and more transparent, it makes it
easier to add unit tests for the function in the future -- since
the tests would need only to provide an appropriate VFS.

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

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

7 years ago[Driver] Parse Debian version as integer when possible. NFC
Michal Gorny [Thu, 20 Oct 2016 20:13:35 +0000 (20:13 +0000)]
[Driver] Parse Debian version as integer when possible. NFC

Replace the string matching for /etc/debian_version with split
integer/string matching algorithm. When the file contains 'major.minor'
version number, parse the major version as integer and use a switch
clause to match it. Otherwise, attempt 'codename/sid' matching using
a StringSwitch.

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

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

7 years ago[CodeGen] Devirtualize calls to methods marked final in a derived class
Vedant Kumar [Thu, 20 Oct 2016 18:44:14 +0000 (18:44 +0000)]
[CodeGen] Devirtualize calls to methods marked final in a derived class

If we see a virtual method call to Base::foo() but can infer that the
object is an instance of Derived, and that 'foo' is marked 'final' in
Derived, we can devirtualize the call to Derived::foo().

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

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

7 years ago[c++1z] Fix assertion failure when using the wrong number of bindings for a
Richard Smith [Thu, 20 Oct 2016 18:29:25 +0000 (18:29 +0000)]
[c++1z] Fix assertion failure when using the wrong number of bindings for a
struct with unnamed bitfields.

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

7 years agoAdd more doxygen comments to emmintrin.h's intrinsics.
Ekaterina Romanova [Thu, 20 Oct 2016 17:59:15 +0000 (17:59 +0000)]
Add more doxygen comments to emmintrin.h's intrinsics.

With this patch, 75% of the intrinsics in this file will be documented now. The patches for the rest of the intrisics in this file will be send out later.

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

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

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

7 years ago[c++1z] Teach composite pointer type computation how to compute the composite
Richard Smith [Thu, 20 Oct 2016 17:57:33 +0000 (17:57 +0000)]
[c++1z] Teach composite pointer type computation how to compute the composite
pointer type of two function pointers with different noexcept specifications.
While I'm here, also teach it how to merge dynamic exception specifications.

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

7 years ago[clang-cl] Fix test that shouldn't be running on non-x86
Renato Golin [Thu, 20 Oct 2016 17:41:08 +0000 (17:41 +0000)]
[clang-cl] Fix test that shouldn't be running on non-x86

The clang-cl test required x86-registered-target but it defaulted to the
host's triple and AArch64 still doesn't support COFF, so the test failed.

The triple was "aarch64-pc-windows-msvc18.0.0" with ObjectFormat equals
llvm::Triple::COFF, failing assertion:

Assertion `(TT.isOSBinFormatELF() || TT.isOSBinFormatMachO()) &&
          "Only expect Darwin and ELF targets"

in AArch64MCTargetDesc.cpp:78.

Making the test only run on Windows hosts obviously fixes the problem.

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

7 years ago[Format] Cleanup after replacing constructor body with = default
Malcolm Parsons [Thu, 20 Oct 2016 14:58:45 +0000 (14:58 +0000)]
[Format] Cleanup after replacing constructor body with = default

Summary:
Remove colon and commas after replacing constructor body with = default.
Fix annotation of TT_CtorInitializerColon when preceded by a comment.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years agoRetire llvm::alignOf in favor of C++11 alignof.
Benjamin Kramer [Thu, 20 Oct 2016 14:27:22 +0000 (14:27 +0000)]
Retire llvm::alignOf in favor of C++11 alignof.

No functionality change intended.

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

7 years agoClean up alignment hacks now that MSVC 2013 and GCC 4.7 are gone.
Benjamin Kramer [Thu, 20 Oct 2016 13:52:26 +0000 (13:52 +0000)]
Clean up alignment hacks now that MSVC 2013 and GCC 4.7 are gone.

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

7 years agoWork around MSVC rejects-valid. Apparenty (some versions of) MSVC will check
Richard Smith [Thu, 20 Oct 2016 07:53:17 +0000 (07:53 +0000)]
Work around MSVC rejects-valid. Apparenty (some versions of) MSVC will check
that a member is default-initializable even if it's initialized by a default
member initializer.

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

7 years agoReplace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed from...
Erik Pilkington [Thu, 20 Oct 2016 02:46:22 +0000 (02:46 +0000)]
Replace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed from llvm/Support in r284681

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

7 years agoRefactor and simplify Sema::FindCompositePointerType. No functionality change intended.
Richard Smith [Thu, 20 Oct 2016 01:20:00 +0000 (01:20 +0000)]
Refactor and simplify Sema::FindCompositePointerType. No functionality change intended.

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

7 years agoPR26276: Fix detection of non-cast-expressions as operands of fold-expressions.
Richard Smith [Thu, 20 Oct 2016 00:55:15 +0000 (00:55 +0000)]
PR26276: Fix detection of non-cast-expressions as operands of fold-expressions.

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

7 years agoUpgrade debug-info-vla test: we do not pass default alignment now
Victor Leschuk [Thu, 20 Oct 2016 00:37:07 +0000 (00:37 +0000)]
Upgrade debug-info-vla test: we do not pass default alignment now

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

7 years agoDebugInfo: pass alignment value only if it was forced
Victor Leschuk [Thu, 20 Oct 2016 00:13:19 +0000 (00:13 +0000)]
DebugInfo: pass alignment value only if it was forced

Preparation to implement DW_AT_alignment support:
 - We pass non-zero align value to DIBuilder only when alignment was forced
 - Modify tests to match this change

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

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

7 years agoFix crash on noreturn conversion in unprototyped function type. Thanks to Keith
Richard Smith [Thu, 20 Oct 2016 00:01:36 +0000 (00:01 +0000)]
Fix crash on noreturn conversion in unprototyped function type. Thanks to Keith
Walker for spotting the bug.

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

7 years agoExtend hack to work around bad exception specifications for 'swap' members to
Richard Smith [Wed, 19 Oct 2016 23:47:37 +0000 (23:47 +0000)]
Extend hack to work around bad exception specifications for 'swap' members to
also cover libstdc++'s std::__debug::array and std::__profile::array.

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

7 years agoUse noexcept instead of LLVM_NOEXCEPT now that all compilers support it
Reid Kleckner [Wed, 19 Oct 2016 23:39:55 +0000 (23:39 +0000)]
Use noexcept instead of LLVM_NOEXCEPT now that all compilers support it

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

7 years ago[cmake] Follow LLVM's lead in creating exported tool targets for clang tools.
Michael Gottesman [Wed, 19 Oct 2016 22:46:06 +0000 (22:46 +0000)]
[cmake] Follow LLVM's lead in creating exported tool targets for clang tools.

This is needed by downstream projects such as swift to get proper cmake
dependency information for LLVM/Clang targets.

A few months ago I added support for exporting this information for Clang
libraries. In order to be incremental, I did not add support for exporting clang
tools as well at that time. Now such support is needed, so I am committing this
incremental code.

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

7 years agoAdd optimization to sizeof...(X) handling: if none of parameter pack X's
Richard Smith [Wed, 19 Oct 2016 22:18:42 +0000 (22:18 +0000)]
Add optimization to sizeof...(X) handling: if none of parameter pack X's
corresponding arguments are unexpanded pack expansions, we can compute the
result without substituting them. This significantly improves the memory usage
and performance of make_integer_sequence implementations that do this kind of
thing:

  using result = integer_sequence<T, Ns ..., sizeof...(Ns) + Ns ...>;

... but note that such an implementation will still perform O(sizeof...(Ns)^2)
work while building the second pack expansion (we just have a somewhat lower
constant now).

In principle we could get this down to linear time by caching whether the
number of expansions of a pack is constant, or checking whether we're within an
alias template before scanning the pack for pack expansions (since that's the
only case in which we do substitutions within a dependent context at the
moment), but this patch doesn't attempt that.

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

7 years agoDon't crash generating debug info for VLA in function prototype.
Eli Friedman [Wed, 19 Oct 2016 22:16:32 +0000 (22:16 +0000)]
Don't crash generating debug info for VLA in function prototype.

Fixes regression from r279445.

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

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

7 years agoDebugInfo: use uint32_t for alignment variables.
Victor Leschuk [Wed, 19 Oct 2016 22:11:07 +0000 (22:11 +0000)]
DebugInfo: use uint32_t for alignment variables.

LLVM now uses uint32_t for DebugInfo alignment for space efficiency,
in this patch we change frontend DebugInfo-related variables to uint32_t too.

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

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

7 years ago[CMake] Add clang-bootstrap-deps target
Chris Bieneman [Wed, 19 Oct 2016 21:18:48 +0000 (21:18 +0000)]
[CMake] Add clang-bootstrap-deps target

Having this target allows other parts of the build system to add to the bootstrap dependencies without needing to be defined before the bootstrap targets are created.

This will specifically be used connect the builtins build from the LLVM runtimes directory as a dependency of the next build stage.

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