]> granicus.if.org Git - clang/log
clang
6 years agoMerging r309523:
Hans Wennborg [Wed, 2 Aug 2017 17:42:08 +0000 (17:42 +0000)]
Merging r309523:
------------------------------------------------------------------------
r309523 | brad | 2017-07-30 14:13:59 -0700 (Sun, 30 Jul 2017) | 2 lines

Also pass -pie back to the linker when linking on OpenBSD.

------------------------------------------------------------------------

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

6 years agoMerging r309722:
Hans Wennborg [Tue, 1 Aug 2017 23:54:32 +0000 (23:54 +0000)]
Merging r309722:
------------------------------------------------------------------------
r309722 | bruno | 2017-08-01 12:05:25 -0700 (Tue, 01 Aug 2017) | 7 lines

[Sema] Fix lax conversion between non ext vectors

r282968 introduced a regression due to the lack of proper testing.
Re-add lax conversion support between non ext vectors for compound
assignments and add a test for that.

rdar://problem/28639467
------------------------------------------------------------------------

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

6 years agoMerging r309752:
Hans Wennborg [Tue, 1 Aug 2017 23:32:23 +0000 (23:32 +0000)]
Merging r309752:
------------------------------------------------------------------------
r309752 | bruno | 2017-08-01 15:10:36 -0700 (Tue, 01 Aug 2017) | 6 lines

[Headers][Darwin] Allow #include_next<float.h> to work on Darwin prior to 10.7

This fixes PR31504 and it's a follow up from adding #include_next<float.h>
for Darwin in r289018.

rdar://problem/29856682
------------------------------------------------------------------------

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

6 years agoMerging r309382:
Hans Wennborg [Mon, 31 Jul 2017 17:29:29 +0000 (17:29 +0000)]
Merging r309382:
------------------------------------------------------------------------
r309382 | rksimon | 2017-07-28 06:47:02 -0700 (Fri, 28 Jul 2017) | 3 lines

[X86] Add tests showing inability of vector non-temporal load/store intrinsic to force pointer alignment (PR33830)

Clang specifies a max type alignment of 16 bytes on darwin targets, meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores.
------------------------------------------------------------------------
Merging r309383:
------------------------------------------------------------------------
r309383 | rksimon | 2017-07-28 07:01:51 -0700 (Fri, 28 Jul 2017) | 1 line

Strip trailing whitespace. NFCI.
------------------------------------------------------------------------
Merging r309488:
------------------------------------------------------------------------
r309488 | rksimon | 2017-07-29 08:33:34 -0700 (Sat, 29 Jul 2017) | 7 lines

[X86][AVX] Ensure vector non-temporal load/store intrinsics force pointer alignment (PR33830)

Clang specifies a max type alignment of 16 bytes on darwin targets (annoyingly in the driver not via cc1), meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores.

This patch casts the vectors to explicitly aligned types prior to the load/store to ensure that the require alignment is respected.

Differential Revision: https://reviews.llvm.org/D35996
------------------------------------------------------------------------

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

6 years agoMerging r309503:
Hans Wennborg [Mon, 31 Jul 2017 17:00:55 +0000 (17:00 +0000)]
Merging r309503:
------------------------------------------------------------------------
r309503 | rsmith | 2017-07-29 23:31:29 -0700 (Sat, 29 Jul 2017) | 6 lines

PR33902: Invalidate line number cache when adding more text to existing buffer.

This led to crashes as the line number cache would report a bogus line number
for a line of code, and we'd try to find a nonexistent column within the line
when printing diagnostics.

------------------------------------------------------------------------

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

6 years agoMerging r309113:
Hans Wennborg [Fri, 28 Jul 2017 21:31:07 +0000 (21:31 +0000)]
Merging r309113:
------------------------------------------------------------------------
r309113 | yamaguchi | 2017-07-26 06:36:58 -0700 (Wed, 26 Jul 2017) | 19 lines

[Bash-autocompletion] Show HelpText with possible flags

Summary:
`clang --autocomplete=-std` will show
```
-std:   Language standard to compile for
-std=   Language standard to compile for
-stdlib=        C++ standard library to use
```
after this change.

However, showing HelpText with completion in bash seems super tricky, so
this feature will be used in other shells (fish, zsh...).

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D35759
------------------------------------------------------------------------

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

6 years agoMerging r309112:
Hans Wennborg [Fri, 28 Jul 2017 21:25:21 +0000 (21:25 +0000)]
Merging r309112:
------------------------------------------------------------------------
r309112 | yamaguchi | 2017-07-26 06:30:36 -0700 (Wed, 26 Jul 2017) | 7 lines

[Bash-completion] Fixed a bug that file doesn't autocompleted after =

Summary:
File path wasn't autocompleted after `-fmodule-cache-path=[tab]`, so
fixed this bug by checking if $flags contains only a newline or not.

Differential Revision: https://reviews.llvm.org/D35763
------------------------------------------------------------------------

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

6 years agoMerging r309327:
Hans Wennborg [Thu, 27 Jul 2017 22:08:00 +0000 (22:08 +0000)]
Merging r309327:
------------------------------------------------------------------------
r309327 | compnerd | 2017-07-27 14:56:25 -0700 (Thu, 27 Jul 2017) | 5 lines

Headers: fix _Unwind_{G,S}etGR for non-EHABI targets

The EHABI definition was being inlined into the users even when EHABI
was not in use.  Adjust the condition to ensure that the right version
is defined.
------------------------------------------------------------------------

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

6 years agoMerging r309226:
Hans Wennborg [Thu, 27 Jul 2017 16:45:43 +0000 (16:45 +0000)]
Merging r309226:
------------------------------------------------------------------------
r309226 | compnerd | 2017-07-26 15:55:23 -0700 (Wed, 26 Jul 2017) | 13 lines

Headers: improve ARM EHABI coverage of unwind.h

Ensure that we define the `_Unwind_Control_Block` structure used on ARM
EHABI targets.  This is needed for building libc++abi with the unwind.h
from the resource dir.  A minor fallout of this is that we needed to
create a typedef for _Unwind_Exception to work across ARM EHABI and
non-EHABI targets.  The structure definitions here are based originally
on the documentation from ARM under the "Exception Handling ABI for the
ARMĀ® Architecture" Section 7.2.  They are then adjusted to more closely
reflect the definition in libunwind from LLVM.  Those changes are
compatible in layout but permit easier use in libc++abi and help
maintain compatibility between libunwind and the compiler provided
definition.
------------------------------------------------------------------------

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

6 years agoRevert r304899 and r304836: It's not clear printing all targets with --version is...
Hans Wennborg [Thu, 27 Jul 2017 16:20:45 +0000 (16:20 +0000)]
Revert r304899 and r304836: It's not clear printing all targets with --version is the right thing to do (see discussion on D33900)

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

6 years agoMerging r309058:
Hans Wennborg [Wed, 26 Jul 2017 16:35:53 +0000 (16:35 +0000)]
Merging r309058:
------------------------------------------------------------------------
r309058 | majnemer | 2017-07-25 16:33:58 -0700 (Tue, 25 Jul 2017) | 9 lines

[CodeGen] Correctly model std::byte's aliasing properties

std::byte, when defined as an enum, needs to be given special treatment
with regards to its aliasing properties. An array of std::byte is
allowed to be used as storage for other types.

This fixes PR33916.

Differential Revision: https://reviews.llvm.org/D35824
------------------------------------------------------------------------

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

6 years agoMerging r308824:
Hans Wennborg [Wed, 26 Jul 2017 16:15:18 +0000 (16:15 +0000)]
Merging r308824:
------------------------------------------------------------------------
r308824 | yamaguchi | 2017-07-22 05:35:15 -0700 (Sat, 22 Jul 2017) | 5 lines

[Bash-autocompletion] Fixed typo and add '-' after -Wno

Summary: -Wno-<warning> was autocompleted as -Wno<warning>, so fixed this typo.

Differential Revision: https://reviews.llvm.org/D35762
------------------------------------------------------------------------

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

6 years agoMerging r308897:
Hans Wennborg [Tue, 25 Jul 2017 17:10:17 +0000 (17:10 +0000)]
Merging r308897:
------------------------------------------------------------------------
r308897 | nico | 2017-07-24 09:54:11 -0700 (Mon, 24 Jul 2017) | 9 lines

Work around an MSVC2017 update 3 codegen bug.

C2017 update 3 produces a clang that crashes when compiling clang. Disabling
optimizations for StmtProfiler::VisitCXXOperatorCallExpr() makes the crash go
away.

Patch from Bruce Dawson <brucedawson@chromium.org>!
https://reviews.llvm.org/D35757

------------------------------------------------------------------------

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

6 years agoRegenerate ClangCommandLineReference.rst
Hans Wennborg [Fri, 21 Jul 2017 08:17:53 +0000 (08:17 +0000)]
Regenerate ClangCommandLineReference.rst

I ran:

$ bin/clang-tblgen -gen-opt-docs -I../cfe.src/include \
    -I../cfe.src/include/clang/Driver -I../llvm.src/include \
    ../cfe.src/include/clang/Driver/ClangOptionDocs.td \
    -o ../cfe.src/docs/ClangCommandLineReference.rst

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

6 years agoGenerate docs/AttributeReference.rst
Hans Wennborg [Wed, 19 Jul 2017 14:44:30 +0000 (14:44 +0000)]
Generate docs/AttributeReference.rst

$ bin/clang-tblgen -gen-attr-docs -I../cfe.src/include \
    ../cfe.src/include/clang/Basic/Attr.td \
    -o ../cfe.src/docs/AttributeReference.rst

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

6 years agoMerging r308455:
Hans Wennborg [Wed, 19 Jul 2017 13:02:51 +0000 (13:02 +0000)]
Merging r308455:
------------------------------------------------------------------------
r308455 | hans | 2017-07-19 05:31:01 -0700 (Wed, 19 Jul 2017) | 16 lines

Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files"

This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until
it's fixed, especially since this landed just before the 5.0 branch.

> This commit adds a new -Wpragma-pack warning. It warns in the following cases:
>
> - When a translation unit is missing terminating #pragma pack (pop) directives.
> - When entering an included file if the current alignment value as determined
>   by '#pragma pack' directives is different from the default alignment value.
> - When leaving an included file that changed the state of the current alignment
>   value.
>
> rdar://10184173
>
> Differential Revision: https://reviews.llvm.org/D35484
------------------------------------------------------------------------

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

6 years agoCreating release_50 branch off revision 308441
Hans Wennborg [Wed, 19 Jul 2017 12:20:43 +0000 (12:20 +0000)]
Creating release_50 branch off revision 308441

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

6 years agoRecommit r308327: Add a warning for missing '#pragma pack (pop)'
Alex Lorenz [Wed, 19 Jul 2017 11:30:41 +0000 (11:30 +0000)]
Recommit r308327: Add a warning for missing '#pragma pack (pop)'
and suspicious uses of '#pragma pack' in included files

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

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

6 years agoFix compilation problem introduced in r308433
Erik Verbruggen [Wed, 19 Jul 2017 11:15:36 +0000 (11:15 +0000)]
Fix compilation problem introduced in r308433

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

6 years agoRevert "[mips] Teach the driver to accept -m(no-)gpopt."
Simon Dardis [Wed, 19 Jul 2017 11:11:02 +0000 (11:11 +0000)]
Revert "[mips] Teach the driver to accept -m(no-)gpopt."

Revert r308431 and r308432, these caused broke some buildbots.

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

6 years agoAdd default values for function parameter chunks
Erik Verbruggen [Wed, 19 Jul 2017 10:45:40 +0000 (10:45 +0000)]
Add default values for function parameter chunks

Append optional chunks with their default values. For example:
before - "int i", after - "int i = 10"

Patch by Ivan Donchevskii!

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

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

6 years ago[mips] Add warning test for -mgpopt option.
Simon Dardis [Wed, 19 Jul 2017 10:39:15 +0000 (10:39 +0000)]
[mips] Add warning test for -mgpopt option.

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

6 years ago[mips] Teach the driver to accept -m(no-)gpopt.
Simon Dardis [Wed, 19 Jul 2017 10:38:03 +0000 (10:38 +0000)]
[mips] Teach the driver to accept -m(no-)gpopt.

This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

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

6 years agoUpdate clang-cl options in the users manual
Hans Wennborg [Wed, 19 Jul 2017 09:52:24 +0000 (09:52 +0000)]
Update clang-cl options in the users manual

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

6 years ago[analyzer] Add annotation attribute to trust retain count implementation
Devin Coughlin [Wed, 19 Jul 2017 04:10:44 +0000 (04:10 +0000)]
[analyzer] Add annotation attribute to trust retain count implementation

Add support to the retain-count checker for an annotation indicating that a
function's implementation should be trusted by the retain count checker.
Functions with these attributes will not be inlined and the arguments will
be treating as escaping.

Adding this annotation avoids spurious diagnostics when the implementation of
a reference counting operation is visible but the analyzer can't reason
precisely about the ref count.

Patch by Malhar Thakkar!

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

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

6 years ago[CMake] Build runtimes for Fuchsia targets
Petr Hosek [Wed, 19 Jul 2017 02:57:47 +0000 (02:57 +0000)]
[CMake] Build runtimes for Fuchsia targets

This relies on the multi-target runtimes build support.

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

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

6 years ago[scan-build-py] Patch to fix "-analyzer-config" option
Petr Hosek [Wed, 19 Jul 2017 00:29:41 +0000 (00:29 +0000)]
[scan-build-py] Patch to fix "-analyzer-config" option

I noticed that when I use "-analyze-config" option in scan-build-py, it
behaves differently from original perl based scan-build.

For example, command:

$ scan-build -analyzer-config ipa=basic-inlining make

Will work without any issues on perl version of scan-build. But on
scan-build-py it will throw an error message "error reading
'ipa=basic-inlining'".

After debugging, it turns out that the scan-build-py does not put
"-analyzer-config" flag in front of the analyzer config flags (in this
case is the "ipa=basic-inlining") in the final clang command line. This
patch fixes this issue.

Patch by Haowei Wu

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

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

6 years agoUpdate for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).
Adrian Prantl [Wed, 19 Jul 2017 00:09:58 +0000 (00:09 +0000)]
Update for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).

<rdar://problem/33357889>
https://bugs.llvm.org/show_bug.cgi?id=33822

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

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

6 years agoDebug Info: Set the MainFileName when generating -gmodules debug info for PCM.
Adrian Prantl [Tue, 18 Jul 2017 23:58:34 +0000 (23:58 +0000)]
Debug Info: Set the MainFileName when generating -gmodules debug info for PCM.

Previously it was uninitialized and thus always defaulted to "<stdin>".
This is mostly a cosmetic change that helps making the debug info more readable.

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

6 years ago[Driver] Always use -z rodynamic for Fuchsia
Petr Hosek [Tue, 18 Jul 2017 23:23:16 +0000 (23:23 +0000)]
[Driver] Always use -z rodynamic for Fuchsia

Fuchsia uses read-only .dynamic section.

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

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

6 years agoConvert attribute 'target' parsing from a 'pair' to a 'struct' to make further improv...
Erich Keane [Tue, 18 Jul 2017 20:41:02 +0000 (20:41 +0000)]
Convert attribute 'target' parsing from a 'pair' to a 'struct' to make further improvements easier

Convert attribute 'target' parsing from a 'pair' to a 'struct' to make further
improvements easier

The attribute 'target' parse function previously returned a pair. Convert
this to a 'pair' in order to add more functionality, and improve usability.

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

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

6 years ago[Sema] NFC: Move all availability checking code to SemaDeclAttr.cpp
Erik Pilkington [Tue, 18 Jul 2017 20:32:07 +0000 (20:32 +0000)]
[Sema] NFC: Move all availability checking code to SemaDeclAttr.cpp

Previously, this was awkwardly split up between SemaExpr.cpp.

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

6 years ago[OPENMP] Initial support for 'task_reduction' clause.
Alexey Bataev [Tue, 18 Jul 2017 20:17:46 +0000 (20:17 +0000)]
[OPENMP] Initial support for 'task_reduction' clause.

Parsing/sema analysis of the 'task_reduction' clause.

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

6 years agoAdd GCC's noexcept-type alias for c++1z-compat-mangling
Raphael Isemann [Tue, 18 Jul 2017 18:52:58 +0000 (18:52 +0000)]
Add GCC's noexcept-type alias for c++1z-compat-mangling

Summary: GCC has named this `-Wnoexcept-type`, so let's add an alias to stay compatible with the GCC flags.

Reviewers: rsmith, dexonsmith

Reviewed By: dexonsmith

Subscribers: cfe-commits, karies, v.g.vassilev, ahatanak

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

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

6 years agoDon't set TUScope to null when generating a module in incremental processing mode.
Raphael Isemann [Tue, 18 Jul 2017 18:24:42 +0000 (18:24 +0000)]
Don't set TUScope to null when generating a module in incremental processing mode.

Summary: When in incremental processing mode, we should never set `TUScope` to a nullptr otherwise any future lookups fail. We already have similar checks in the rest of the code, but we never hit this one because so far we didn't try to generate a module from the AST that Cling generates.

Reviewers: rsmith, v.g.vassilev

Reviewed By: v.g.vassilev

Subscribers: cfe-commits, v.g.vassilev

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

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

6 years agoRevert r308327
Alex Lorenz [Tue, 18 Jul 2017 17:36:42 +0000 (17:36 +0000)]
Revert r308327

I forgot to test clang-tools-extra which is now failing.

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

6 years agoAdd a warning for missing '#pragma pack (pop)' and suspicious uses
Alex Lorenz [Tue, 18 Jul 2017 17:23:51 +0000 (17:23 +0000)]
Add a warning for missing '#pragma pack (pop)' and suspicious uses
of '#pragma pack' in included files

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

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

6 years ago[OPENMP] Generalization of sema analysis of reduction-based clauses,
Alexey Bataev [Tue, 18 Jul 2017 15:32:58 +0000 (15:32 +0000)]
[OPENMP] Generalization of sema analysis of reduction-based clauses,
NFC.

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

6 years agoCodeGen: Insert addr space cast for automatic/temp var at right position
Yaxun Liu [Tue, 18 Jul 2017 14:46:03 +0000 (14:46 +0000)]
CodeGen: Insert addr space cast for automatic/temp var at right position

The uses of alloca may be in different blocks other than the block containing the alloca.
Therefore if the alloca addr space is non-zero and it needs to be casted to default
address space, the cast needs to be inserted in the same BB as the alloca insted of
the current builder insert point since the current insert point may be in a different BB.

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

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

6 years agoclang-format: [JS] Correctly format JavaScript imports with long module paths
Martin Probst [Tue, 18 Jul 2017 14:00:19 +0000 (14:00 +0000)]
clang-format: [JS] Correctly format JavaScript imports with long module paths

Currently the `UnwrappedLineParser` fails to correctly unwrap JavaScript
imports where the module path is not on the same line as the `from` keyword.
For example:

    import {A} from
    'some/path/longer/than/column/limit/module.js';```

This causes issues when in the middle a list of imports because the formatter
thinks it has reached the end of the imports, and therefore will not sort any
imports lower in the list.

The formatter will, however, split the `from` keyword and the module path if
the path exceeds the column limit, which triggers the issue the next time the
file is formatted.

Patch originally by Jared Neil - thanks!

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

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

6 years ago[CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into clang/Config...
NAKAMURA Takumi [Tue, 18 Jul 2017 08:55:03 +0000 (08:55 +0000)]
[CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into clang/Config/config.h.

LLVM_ENABLE_MODULES is sensitive of -D. Move them into config.h.

FIXME: It'd be better that they are #cmakedefine01 rather than #cmakedefine.
(#if FOO rather than #if defined(FOO))
Then we can find missing #include "clang/Config/config.h" in the future.

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

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

6 years ago[Index] Prevent canonical decl becoming nullptr
Krasimir Georgiev [Tue, 18 Jul 2017 07:20:53 +0000 (07:20 +0000)]
[Index] Prevent canonical decl becoming nullptr

Summary:
This patch prevents getCanonicalDecl returning nullptr in case it finds
a canonical TemplateDeclaration with no attached TemplatedDecl.
Found by running the indexer over a version of the standard library deep inside
a template metaprogramming mess.

Reviewers: klimek, vsk

Reviewed By: vsk

Subscribers: vsk, arphaman, cfe-commits

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

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

6 years agoAlso add the option -no-pie (like -nopie)
Sylvestre Ledru [Tue, 18 Jul 2017 06:54:54 +0000 (06:54 +0000)]
Also add the option -no-pie (like -nopie)

Summary:
For example, this option is expected by ghc (haskell compiler). Currently, building with ghc will fail with:

```
clang: error: unknown argument: '-no-pie'
`gcc' failed in phase `Linker'. (Exit code: 1)
. /usr/share/haskell-devscripts/Dh_Haskell.sh && \
configure_recipe
```

This won't do anything (but won't fail with an error)

Reviewers: rafael, joerg

Reviewed By: joerg

Subscribers: joerg, cfe-commits

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

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

6 years ago[OpenCL] Added extended tests on metadata generation for half data type and arrays.
Egor Churaev [Tue, 18 Jul 2017 06:04:01 +0000 (06:04 +0000)]
[OpenCL] Added extended tests on metadata generation for half data type and arrays.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: bader, cfe-commits, yaxunl

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

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

6 years ago[OPENMP] Pacify windows buildbots, NFC.
Alexey Bataev [Tue, 18 Jul 2017 00:42:35 +0000 (00:42 +0000)]
[OPENMP] Pacify windows buildbots, NFC.

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

6 years ago[analyzer] Add missing documentation for static analyzer checkers
Devin Coughlin [Tue, 18 Jul 2017 00:34:57 +0000 (00:34 +0000)]
[analyzer] Add missing documentation for static analyzer checkers

Some checks did not have documentation in the www/analyzer/ folder and also
some alpha checks became non-alpha.

Patch by Dominik SzabĆ³!

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

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

6 years ago[COFF, ARM64] Set the data type widths and the data layout string
Mandeep Singh Grang [Mon, 17 Jul 2017 21:10:45 +0000 (21:10 +0000)]
[COFF, ARM64] Set the data type widths and the data layout string

Summary: COFF ARM64 is LLP64 platform. So int is 4 bytes, long is 4 bytes and long long is 8 bytes.

Reviewers: compnerd, ruiu, rnk, efriedma

Reviewed By: compnerd, efriedma

Subscribers: efriedma, javed.absar, cfe-commits, aemerson, llvm-commits, kristof.beyls

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

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

6 years ago[AArch64] Add support for __builtin_ms_va_list on aarch64
Martin Storsjo [Mon, 17 Jul 2017 20:49:45 +0000 (20:49 +0000)]
[AArch64] Add support for __builtin_ms_va_list on aarch64

Move builtins from the x86 specific scope into the global
scope. Their use is still limited to x86_64 and aarch64 though.

This allows wine on aarch64 to properly handle variadic functions.

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

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

6 years agoUpdate use of llvm::CallingConv:X86_64_Win64 after LLVM commit r308208
Martin Storsjo [Mon, 17 Jul 2017 20:05:56 +0000 (20:05 +0000)]
Update use of llvm::CallingConv:X86_64_Win64 after LLVM commit r308208

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

6 years ago[Basic] Detect Git submodule version in CMake
Brian Gesiak [Mon, 17 Jul 2017 19:22:57 +0000 (19:22 +0000)]
[Basic] Detect Git submodule version in CMake

Summary:
When searching for Git version control information, libBasic's CMake
checks for the path '.git/logs/HEAD'. However, when LLVM is included as
a Git submodule, this path does not exist. Instead, it contains a '.git'
file with the following:

```
gitdir: ../../.git/modules/external/llvm
```

Where '../..' is the relative path to the root repository that contains
the LLVM Git submodule.

Because of this discrepancy, `clang --version` does not output source
control information if built from a Git submodule.

To fix, check whether '.git' is a directory or a file. If it's a
directory, simply use the '.git/logs/HEAD' path. If it's a file, read it
and check for the tell-tale sign of a Git submodule: the text "gitdir:".
If it exists, follow that path and use the 'logs/HEAD' at that location
instead. This allows not only the correct revision information to be
retrieved, but also uses a file that will change with each source
control revision.

Test Plan:
1. Before applying this change, build Clang as a Git submodule in a repository
   that places it in external/clang, and confirm no revision information
   is output when `clang --version` is invoked (just "clang 5.0.0" is
   output, no Git hashes).
2. Apply these changes and build Clang as a Git repository nested under
   llvm/tools/clang, and confirm that `clang --version` displays correct
   version information.
3. Apply these changes and build Clang as a Git submodule using the
   structure described in (1), and confirm version control information
   is output as in (2).

Reviewers: jordan_rose, beanz, probinson

Reviewed By: jordan_rose

Subscribers: chapuni, mgorny, cfe-commits

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

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

6 years ago[SystemZ] Add support for IBM z14 processor (3/3)
Ulrich Weigand [Mon, 17 Jul 2017 17:47:35 +0000 (17:47 +0000)]
[SystemZ] Add support for IBM z14 processor (3/3)

This patch updates the vecintrin.h header file to provide the new
set of high-level vector built-in functions.  This matches the
updated definition implemented by other compilers for the platform,
indicated by the pre-defined macro __VEC__ == 10302.

Note that some of the new functions (notably those involving the
vector float data type) are only available with -march=z14
(indicated by __ARCH__ == 12).

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

6 years ago[SystemZ] Add support for IBM z14 processor (2/3)
Ulrich Weigand [Mon, 17 Jul 2017 17:46:47 +0000 (17:46 +0000)]
[SystemZ] Add support for IBM z14 processor (2/3)

This patch extends the -fzvector language feature to enable the new
"vector float" data type when compiling at -march=z14.  This matches
the updated extension definition implemented by other compilers for
the platform, which is indicated to applications by pre-defining
__VEC__ to 10302 (instead of 10301).

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

6 years ago[SystemZ] Add support for IBM z14 processor (1/3)
Ulrich Weigand [Mon, 17 Jul 2017 17:45:57 +0000 (17:45 +0000)]
[SystemZ] Add support for IBM z14 processor (1/3)

This patch series adds support for the IBM z14 processor.  This part includes:
- Basic support for the new processor and its features.
- Support for low-level builtins mapped to new LLVM intrinsics.

Support for the -fzvector extension to vector float and the new
high-level vector intrinsics is provided by separate patches.

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

6 years ago[clang] Remove redundant check-prefix=CHECK from tests. NFC.
Mandeep Singh Grang [Mon, 17 Jul 2017 17:31:44 +0000 (17:31 +0000)]
[clang] Remove redundant check-prefix=CHECK from tests. NFC.

Reviewers: t.p.northover, mstorsjo, rsmith, mcrosier

Reviewed By: mstorsjo, mcrosier

Subscribers: mcrosier, javed.absar, cfe-commits

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

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

6 years ago[NFC] Refactor the Preprocessor function that handles Macro definitions and rename...
Faisal Vali [Mon, 17 Jul 2017 17:18:43 +0000 (17:18 +0000)]
[NFC] Refactor the Preprocessor function that handles Macro definitions and rename Arguments to Parameters in Macro Definitions.
  - Extracted the reading of the tokens out into a separate function.
  - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation).

This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible.

I will also directly update some extra clang tooling that is broken by the change from Argument to Parameter.

Hopefully the bots will stay appeased.

Thanks!

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

6 years agoFix dereference of pointers in throw statements.
Manuel Klimek [Mon, 17 Jul 2017 15:27:53 +0000 (15:27 +0000)]
Fix dereference of pointers in throw statements.

Before:
  throw * x;

After:
  throw *x;

Patch by Erik Uhlmann.

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

6 years ago[OPENMP] Fix reduction combiner test
Alexey Bataev [Mon, 17 Jul 2017 14:53:02 +0000 (14:53 +0000)]
[OPENMP] Fix reduction combiner test

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

6 years ago[OPENMP] Further fixes of the reduction codegen tests
Alexey Bataev [Mon, 17 Jul 2017 14:47:59 +0000 (14:47 +0000)]
[OPENMP] Further fixes of the reduction codegen tests

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

6 years ago[OPENMP] Further test fixes.
Alexey Bataev [Mon, 17 Jul 2017 14:22:34 +0000 (14:22 +0000)]
[OPENMP] Further test fixes.

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

6 years ago[OPENMP] Rework tests to pacify buildbots.
Alexey Bataev [Mon, 17 Jul 2017 14:06:41 +0000 (14:06 +0000)]
[OPENMP] Rework tests to pacify buildbots.

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

6 years ago[OPENMP] Codegen for reduction clauses in 'taskloop' directives.
Alexey Bataev [Mon, 17 Jul 2017 13:30:36 +0000 (13:30 +0000)]
[OPENMP] Codegen for reduction clauses in 'taskloop' directives.

Adds codegen for taskloop-based directives.

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

6 years agoRevert changes from my previous refactoring - will need to fix dependencies in clang...
Faisal Vali [Mon, 17 Jul 2017 02:03:21 +0000 (02:03 +0000)]
Revert changes from my previous refactoring - will need to fix dependencies in clang's extra tooling (such as clang-tidy etc.).

Sorry about that.

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

6 years ago[NFC] Refactor the Preprocessor function that handles Macro definitions and rename...
Faisal Vali [Mon, 17 Jul 2017 01:27:53 +0000 (01:27 +0000)]
[NFC] Refactor the Preprocessor function that handles Macro definitions and rename Arguments to Parameters in Macro Definitions.
  - Extracted the reading of the tokens out into a separate function.
  - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation).

This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible.

Thanks!

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

6 years agoEnable TLS support on OpenBSD.
Brad Smith [Mon, 17 Jul 2017 01:06:46 +0000 (01:06 +0000)]
Enable TLS support on OpenBSD.

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

6 years agoEnable TLS support on OpenBSD, but default to the emulatated TLS model.
Brad Smith [Mon, 17 Jul 2017 00:49:31 +0000 (00:49 +0000)]
Enable TLS support on OpenBSD, but default to the emulatated TLS model.

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

6 years ago[Bash-autocompletion] Add support for -W<warning> and -Wno<warning>
Yuka Takahashi [Sun, 16 Jul 2017 15:07:20 +0000 (15:07 +0000)]
[Bash-autocompletion] Add support for -W<warning> and -Wno<warning>

Summary:
`-W[tab]` will autocomplete warnings defined in this link:
https://clang.llvm.org/docs/DiagnosticsReference.html#wweak-vtables

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

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

6 years ago[c++2a] Add option -std=c++2a to enable support for potential/transitional C++2a...
Faisal Vali [Sun, 16 Jul 2017 00:23:04 +0000 (00:23 +0000)]
[c++2a] Add option -std=c++2a to enable support for potential/transitional C++2a features

- as usual C++2a implies all the C++'s that came before it.

Thank you Aaron for the feedback here: https://reviews.llvm.org/D35454

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

6 years ago[cxx_status] Fix typos.
Richard Smith [Sat, 15 Jul 2017 15:51:59 +0000 (15:51 +0000)]
[cxx_status] Fix typos.

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

6 years ago[cxx_status] Add approved Toronto WG21 motions.
Richard Smith [Sat, 15 Jul 2017 15:42:36 +0000 (15:42 +0000)]
[cxx_status] Add approved Toronto WG21 motions.

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

6 years agoUse ARC parsing rules for ns_returns_retained in MRC so that code can
John McCall [Sat, 15 Jul 2017 11:06:46 +0000 (11:06 +0000)]
Use ARC parsing rules for ns_returns_retained in MRC so that code can
be shared without warnings.  Build AttributedTypes to leave breadcrumbs
for tools like the static analyzer.  Warn about attempting to use the
attribute with incompatible return types.

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

6 years ago[Bash-autocompletion] Fixed a bug on bash
Yuka Takahashi [Sat, 15 Jul 2017 09:09:51 +0000 (09:09 +0000)]
[Bash-autocompletion] Fixed a bug on bash

Summary: Maybe I mismerged when merging previous commits by hand.

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

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

6 years agoclang/test/FixIt/format.m: Tweak for i686, where ssize_t is int. (r308067)
NAKAMURA Takumi [Sat, 15 Jul 2017 06:14:47 +0000 (06:14 +0000)]
clang/test/FixIt/format.m: Tweak for i686, where ssize_t is int. (r308067)

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

6 years ago[ODRHash] Revert r307743 which reverted r307720
Richard Trieu [Sat, 15 Jul 2017 02:55:13 +0000 (02:55 +0000)]
[ODRHash] Revert r307743 which reverted r307720

Reapply r307720 to allow processing of constructors and destructors.  Reuse
the diagnostics for CXXMethodDecl for them.

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

6 years ago[clang] Fix format test
Alexander Shaposhnikov [Sat, 15 Jul 2017 01:06:59 +0000 (01:06 +0000)]
[clang] Fix format test

This diff makes the test FixIt/format.m more robust.
The issue was caught by the build bot clang-cmake-thumbv7-a15.

Test plan: make check-all

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

6 years agoTry to fix modules build
Matthias Braun [Sat, 15 Jul 2017 00:29:25 +0000 (00:29 +0000)]
Try to fix modules build

Module builds somehow report an ambiguity between clang::Diagnostic and
clang::Tooling::Diagnostic. It seems as if one of the additional headers
brought in by the module brings the clang namespace to the toplevel. I
could not find out the reason for that, so for now I go with the simple
fix to bring the build back to green.

rdar://33321397

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

6 years ago[clang] Fix handling of "%zd" format specifier
Alexander Shaposhnikov [Fri, 14 Jul 2017 22:57:00 +0000 (22:57 +0000)]
[clang] Fix handling of "%zd" format specifier

This diff addresses FIXME in lib/Analysis/PrintfFormatString.cpp
and makes PrintfSpecifier::getArgType return the correct type.
In particular, this change enables Clang to emit a warning on
incorrect using of "%zd"/"%zn" format specifiers.

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

Test plan: make check-all

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

6 years agoFix flag names in @available docs.
Nico Weber [Fri, 14 Jul 2017 18:52:30 +0000 (18:52 +0000)]
Fix flag names in @available docs.

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

6 years agoFix link in docs.
Nico Weber [Fri, 14 Jul 2017 18:45:36 +0000 (18:45 +0000)]
Fix link in docs.

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

6 years agodo more processing in clang-fuzzer (use EmitAssemblyAction)
Kostya Serebryany [Fri, 14 Jul 2017 18:42:07 +0000 (18:42 +0000)]
do more processing in clang-fuzzer (use EmitAssemblyAction)

Summary: use EmitAssemblyAction in clang-fuzzer

Reviewers: klimek, rsmith

Reviewed By: klimek

Subscribers: cfe-commits, mgorny

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

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

6 years agoAdd documentation for @available
Nico Weber [Fri, 14 Jul 2017 18:40:52 +0000 (18:40 +0000)]
Add documentation for @available

https://reviews.llvm.org/D35379

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

6 years agoPrevent ClangTools from generating dependency files.
Sterling Augustine [Fri, 14 Jul 2017 18:33:30 +0000 (18:33 +0000)]
Prevent ClangTools from generating dependency files.

D34304 created a way for ToolInvocations to conditionally generate
dependency files, and updated call sites to preserve the old behavior
of not generating them by default. CompilerInvocations...

Summary:
...are yet another
call-path that needs updating to preserve the old behavior.

Reviewers: klimek, echristo

Reviewed By: echristo

Subscribers: echristo, cfe-commits

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

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

6 years ago[Dominators] Update Clang's DominatorTree to use the new template argument
Jakub Kuderski [Fri, 14 Jul 2017 18:26:21 +0000 (18:26 +0000)]
[Dominators] Update Clang's DominatorTree to use the new template argument

Summary: This patch makes the Clang's DominatorTree use the new IsPostDom template argument for DominatorTreeBase.

Reviewers: dberlin, sanjoy, davide, grosser

Reviewed By: dberlin

Subscribers: llvm-commits

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

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

6 years agoUnconditionally use .init_array instead of .ctors on Solaris.
Aaron Ballman [Fri, 14 Jul 2017 17:49:52 +0000 (17:49 +0000)]
Unconditionally use .init_array instead of .ctors on Solaris.

Patch by Fedor Sergeev

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

6 years ago[clang] Add getSignedSizeType method
Alexander Shaposhnikov [Fri, 14 Jul 2017 17:30:14 +0000 (17:30 +0000)]
[clang] Add getSignedSizeType method

C11 standard refers to the signed counterpart of the type size_t in
the paragraph 7.21.6.1 where it defines d, i, o, u, x, or x conversion specifiers
(in printf format string).
In Clang there is a FIXME (in lib/Analysis/PrintfFormatString.cpp) for this case
(which is not handled correctly at the moment).
This diff adds getSignedSizeType method to TargetInfo and exposes it
in ASTContext similarly to how it is done for getSizeType.
lib/Analysis/PrintfFormatString.cpp will be changed in a separate commit.

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

Test plan: make check-all

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

6 years ago[Hexagon] Add intrinsics for data cache operations
Krzysztof Parzyszek [Fri, 14 Jul 2017 16:01:24 +0000 (16:01 +0000)]
[Hexagon] Add intrinsics for data cache operations

This is the clang part, adding support for
  void __builtin_HEXAGON_Y2_dccleana(void*);
  void __builtin_HEXAGON_Y2_dccleaninva(void*);
  void __builtin_HEXAGON_Y2_dcinva(void*);
  void __builtin_HEXAGON_Y2_dczeroa(void*);
  void __builtin_HEXAGON_Y4_l2fetch(void*, unsigned);
  void __builtin_HEXAGON_Y5_l2fetch(void*, unsigned long long);
Requires r308032.

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

6 years ago[index] Added a method indexTopLevelDecls to run indexing on a list of Decls.
Ilya Biryukov [Fri, 14 Jul 2017 10:47:45 +0000 (10:47 +0000)]
[index] Added a method indexTopLevelDecls to run indexing on a list of Decls.

Summary:
We need it in clangd for refactoring that replaces ASTUnit
with manual AST management.

Reviewers: akyrtzi, benlangmuir, arphaman, klimek

Reviewed By: arphaman

Subscribers: cfe-commits

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

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

6 years ago[Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output
Alexander Kornienko [Fri, 14 Jul 2017 10:37:44 +0000 (10:37 +0000)]
[Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

Summary:
To get properly integration Clang-Tidy with CLion IDE, next things were implemented:
1) Preserve `Message`, `FileOffset`, `FilePath` in the clang-tidy output.
2) Export all diagnostics, not just the ones with fixes
3) Test-cases

Reviewers: klimek, ilya-biryukov, alexfh

Reviewed By: alexfh

Subscribers: alexfh, JDevlieghere, mgorny, xazax.hun, cfe-commits, klimek

Tags: #clang-tools-extra

Patch by Vladimir Plyashkun!

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

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

6 years ago[analyzer] Add annotation for functions taking user-facing strings
Erik Verbruggen [Fri, 14 Jul 2017 10:24:36 +0000 (10:24 +0000)]
[analyzer] Add annotation for functions taking user-facing strings

There was already a returns_localized_nsstring annotation to indicate
that the return value could be passed to UIKit methods that would
display them. However, those UIKit methods were hard-coded, and it was
not possible to indicate that other classes/methods in a code-base would
do the same.

The takes_localized_nsstring annotation can be put on function
parameters and selector parameters to indicate that those will also show
the string to the user.

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

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

6 years agoKeep the IdentifierInfo in the Token for alternative operator keyword
Olivier Goffart [Fri, 14 Jul 2017 09:23:40 +0000 (09:23 +0000)]
Keep the IdentifierInfo in the Token for alternative operator keyword

The goal of this commit is to fix clang-format so it does not merge tokens when
using the alternative spelling keywords. (eg: "not foo" should not become "notfoo")

The problem is that Preprocessor::HandleIdentifier used to drop the identifier info
from the token for these keyword. This means the first condition of
TokenAnnotator::spaceRequiredBefore is not met. We could add explicit check for
the spelling in that condition, but I think it is better to keep the IdentifierInfo
and handle the operator keyword explicitly when needed. That actually leads to simpler
code, and probably slightly more efficient as well.

Another side effect of this change is that __identifier(and) will now work as
one would expect, removing a FIXME from the MicrosoftExtensions.cpp test

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

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

6 years ago[X86] Add 'movbe' to btver2 CPU.
Craig Topper [Fri, 14 Jul 2017 06:36:17 +0000 (06:36 +0000)]
[X86] Add 'movbe' to btver2 CPU.

This probably doesn't change anything because the frotend doesn't do anything with this feature and the backend will infer from the cpu string. So this is just for consistency with other cpus that support movbe.

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

6 years agoAdd release notes for the overloadable attribute
George Burgess IV [Fri, 14 Jul 2017 03:23:57 +0000 (03:23 +0000)]
Add release notes for the overloadable attribute

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

6 years agoUse EXPECT_TRUE rather than EXPECT_EQ(true, ...) to clean up the code and silence...
Eric Christopher [Fri, 14 Jul 2017 02:03:03 +0000 (02:03 +0000)]
Use EXPECT_TRUE rather than EXPECT_EQ(true, ...) to clean up the code and silence a null conversion warning.

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

6 years agoChange dyn_casts with unused variables to isa statements to avoid unused variables.
Eric Christopher [Fri, 14 Jul 2017 01:42:57 +0000 (01:42 +0000)]
Change dyn_casts with unused variables to isa statements to avoid unused variables.

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

6 years ago[ODRHash] Avoid taking the types of FunctionDecl's
Richard Trieu [Fri, 14 Jul 2017 01:36:41 +0000 (01:36 +0000)]
[ODRHash] Avoid taking the types of FunctionDecl's

FunctionDecl already hashes most of the information in the function's type.
Add hashing of the return type, and skip hashing the function's type to avoid
redundancy and extra work when computing the hash.

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

6 years ago[Driver] Respect -target when determining target platform on Apple
Akira Hatanaka [Fri, 14 Jul 2017 00:21:32 +0000 (00:21 +0000)]
[Driver] Respect -target when determining target platform on Apple
platforms.

Set the target OS based on -target if it is present on the command
line and -arch is not.

With this commit, "-target x86_64-apple-ios8.0" does the same thing as
"-arch x86_64 -mios-version-min=8.0".

rdar://problem/21012522

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

6 years ago[PS4] Disable LTO unit features under ThinLTO, like for Darwin.
Paul Robinson [Thu, 13 Jul 2017 21:25:47 +0000 (21:25 +0000)]
[PS4] Disable LTO unit features under ThinLTO, like for Darwin.

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

6 years agoUse getNameAsString instead of getName to get method names when dumping
Lang Hames [Thu, 13 Jul 2017 21:08:29 +0000 (21:08 +0000)]
Use getNameAsString instead of getName to get method names when dumping
overrides:  getName can fail if the decl's name isn't a simple identifier.

This is a more general replacement for the fix in r305860.

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

6 years ago[ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" (PR33430)
Vedant Kumar [Thu, 13 Jul 2017 20:55:26 +0000 (20:55 +0000)]
[ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" (PR33430)

The pointer overflow check gives false negatives when dealing with
expressions in which an unsigned value is subtracted from a pointer.
This is summarized in PR33430 [1]: ubsan permits the result of the
subtraction to be greater than "p", but it should not.

To fix the issue, we should track whether or not the pointer expression
is a subtraction. If it is, and the indices are unsigned, we know to
expect "p - <unsigned> <= p".

I've tested this by running check-{llvm,clang} with a stage2
ubsan-enabled build. I've also added some tests to compiler-rt, which
are in D34122.

[1] https://bugs.llvm.org/show_bug.cgi?id=33430

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

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

6 years ago[AArch64] Produce the right kind of va_arg for windows
Martin Storsjo [Thu, 13 Jul 2017 17:59:14 +0000 (17:59 +0000)]
[AArch64] Produce the right kind of va_arg for windows

On windows on arm64, the va_list is a plain pointer.

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

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

6 years agoFix spelling mistakes in comments. NFCI.
Simon Pilgrim [Thu, 13 Jul 2017 17:34:44 +0000 (17:34 +0000)]
Fix spelling mistakes in comments. NFCI.

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