]> granicus.if.org Git - clang/log
clang
7 years agoRecommit r308327 3rd time: Add a warning for missing
Alex Lorenz [Fri, 28 Jul 2017 14:41:21 +0000 (14:41 +0000)]
Recommit r308327 3rd time: Add a warning for missing
'#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files

The second recommit (r309106) was reverted because the "non-default #pragma
pack value chages the alignment of struct or union members in the included file"
warning proved to be too aggressive for external projects like Chromium
(https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit
makes the problematic warning a non-default one, and gives it the
-Wpragma-pack-suspicious-include warning option.

The first recommit (r308441) caused a "non-default #pragma pack value might
change the alignment of struct or union members in the included file" warning
in LLVM itself. This recommit tweaks the added warning to avoid warnings for
#includes that don't have any records that are affected by the non-default
alignment. This tweak avoids the previously emitted warning in LLVM.

Original message:

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@309386 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoStrip trailing whitespace. NFCI.
Simon Pilgrim [Fri, 28 Jul 2017 14:01:51 +0000 (14:01 +0000)]
Strip trailing whitespace. NFCI.

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

7 years ago[X86] Add tests showing inability of vector non-temporal load/store intrinsic to...
Simon Pilgrim [Fri, 28 Jul 2017 13:47:02 +0000 (13:47 +0000)]
[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.

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

7 years agoclang-format: merge short case labels with trailing comments
Francois Ferrand [Fri, 28 Jul 2017 07:56:18 +0000 (07:56 +0000)]
clang-format: merge short case labels with trailing comments

Summary:
Allow merging short case labels when they actually end with a comment
(like a comment after the ``break``) and when followed by switch-level
comments (e.g. aligned with next case):

  switch(a) {
  case 0: break; // comment at end of case
  case 1: return value;
  // comment related to next case
  // comment related to next case
  case 2:
  }

Reviewers: krasimir, djasper

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

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

7 years agoclang-format: fix block OpeningLineIndex around preprocessor
Francois Ferrand [Fri, 28 Jul 2017 07:56:14 +0000 (07:56 +0000)]
clang-format: fix block OpeningLineIndex around preprocessor

Summary:
The current code would return an incorrect value when a preprocessor
directive is present immediately after the opening brace: this causes
the nanespace end comment fixer to break in some places, for exemple it
would not add the comment in this case:

  namespace a {
  #define FOO
  }

Fixing the computation is simple enough, but it was breaking a feature,
as it would cause comments to be added also when the namespace
declaration was dependant on conditional compilation.

To fix this, a hash of the current preprocessor stack/branches is
computed at the beginning of parseBlock(), so that we explicitely do not
store the OpeningLineIndex when the beginning and end of the block are
not in the same preprocessor conditions.

Tthe hash is computed based on the line, but this could propbably be
improved by using the actual condition, so that clang-format would be
able to match multiple identical #ifdef blocks.

Reviewers: krasimir, djasper

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

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

7 years agoUpdate comment in test case after r309308.
Akira Hatanaka [Fri, 28 Jul 2017 01:58:14 +0000 (01:58 +0000)]
Update comment in test case after r309308.

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

7 years ago[sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-table
Kostya Serebryany [Fri, 28 Jul 2017 00:10:10 +0000 (00:10 +0000)]
[sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-table

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

7 years agoHeaders: fix _Unwind_{G,S}etGR for non-EHABI targets
Saleem Abdulrasool [Thu, 27 Jul 2017 21:56:25 +0000 (21:56 +0000)]
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/trunk@309327 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Headers] Add a test for arm64intr.h
Martin Storsjo [Thu, 27 Jul 2017 19:45:13 +0000 (19:45 +0000)]
[Headers] Add a test for arm64intr.h

This tests the ARM64 specific constants added in SVN r309081,
similar to the one added in r277928 for armintr.h.

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

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

7 years ago[OPENMP] Allow all lvalues in 'depend' clause.
Alexey Bataev [Thu, 27 Jul 2017 19:15:30 +0000 (19:15 +0000)]
[OPENMP] Allow all lvalues in 'depend' clause.

According to upcoming OpenMP 5.0 all addressable lvalue expressions are
allowed in deoend clause.

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

7 years agoRevert r264998 and r265035.
Akira Hatanaka [Thu, 27 Jul 2017 18:52:44 +0000 (18:52 +0000)]
Revert r264998 and r265035.

r303175 made changes to have __cxa_allocate_exception return a 16-byte
aligned pointer, so it's no longer necessary to specify a lower
alignment (8-bytes) for exception objects on Darwin.

rdar://problem/32363695

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

7 years agoUpdate to use enum classes for various ARM *Kind enums
Florian Hahn [Thu, 27 Jul 2017 16:28:39 +0000 (16:28 +0000)]
Update to use enum classes for various ARM *Kind enums

Summary: This updates the relevant Clang parts for the LLVM change D35882.

Reviewers: rengolin, chandlerc, javed.absar, rovka

Reviewed By: rovka

Subscribers: aemerson, cfe-commits, kristof.beyls

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

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

7 years agoFix double destruction of objects when OpenMP construct is canceled
Erich Keane [Thu, 27 Jul 2017 16:28:20 +0000 (16:28 +0000)]
Fix double destruction of objects when OpenMP construct is canceled

When an omp for loop is canceled the constructed objects are being destructed
twice.

It looks like the desired code is:

{

  Obj o;
  If (cancelled) branch-through-cleanups to cancel.exit.

}
[cleanups]
cancel.exit:

__kmpc_for_static_fini
br cancel.cont (*)

cancel.cont:

__kmpc_barrier
return

The problem seems to be the branch to cancel.cont is currently also going
through the cleanups calling them again. This change just does a direct branch
instead.

Patch By: michael.p.rice@intel.com

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

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

7 years agoMake new PM honor -fdebug-info-for-profiling (clang side)
Dehao Chen [Thu, 27 Jul 2017 15:29:53 +0000 (15:29 +0000)]
Make new PM honor -fdebug-info-for-profiling (clang side)

Summary: The new PM needs to invoke add-discriminator pass when building with -fdebug-info-for-profiling.

Reviewers: chandlerc, davidxl

Reviewed By: chandlerc

Subscribers: sanjoy, cfe-commits

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

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

7 years ago[clang-diff] Rename, NFC
Johannes Altmanninger [Thu, 27 Jul 2017 15:04:44 +0000 (15:04 +0000)]
[clang-diff] Rename, NFC

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

7 years ago[OPENMP] Codegen for 'in_reduction' clause.
Alexey Bataev [Thu, 27 Jul 2017 13:20:36 +0000 (13:20 +0000)]
[OPENMP] Codegen for 'in_reduction' clause.

Added codegen for task-based directive with in_reduction clause.
```
<body>
```
The next code is emitted:
```
void *td;
...
td = call i8* @__kmpc_task_reduction_init();
...
<type> *priv = (<type> *)call i8* @__kmpc_task_reduction_get_th_data(i32
GTID, i8* td, i8* <orig>)
```

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

7 years ago[CodeGen][ARM] ARM runtime helper functions are not always soft-fp
Peter Smith [Thu, 27 Jul 2017 10:43:53 +0000 (10:43 +0000)]
[CodeGen][ARM] ARM runtime helper functions are not always soft-fp

Re-commit r309257 with less precise register checks in arm-float-helpers.c
test.

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

7 years ago[CodeGen][ARM] Revert r309257
Peter Smith [Thu, 27 Jul 2017 09:57:13 +0000 (09:57 +0000)]
[CodeGen][ARM] Revert r309257

The test arm-float-helpers.c appears to be failing on some builders and
needs some work to make it more robust.

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

7 years ago[CodeGen][ARM] ARM runtime helper functions are not always soft-fp
Peter Smith [Thu, 27 Jul 2017 09:21:41 +0000 (09:21 +0000)]
[CodeGen][ARM] ARM runtime helper functions are not always soft-fp

The ARM Runtime ABI document (IHI0043) defines the AEABI floating point
helper functions in 4.1.2 The floating-point helper functions. These
functions always use the base PCS (soft-fp). However helper functions
defined outside of this document such as the complex-number multiply and
divide helpers are not covered by this requirement and should use
hard-float PCS if the target is hard-float as both compiler-rt and libgcc
for a hard-float sysroot implement these functions with a hard-float PCS.

All of the floating point helper functions that are explicitly soft float
are expanded in the llvm ARM backend. This change makes clang not force the
BuiltinCC to AAPCS for AAPCS_VFP. With this change the ARM compiler-rt
tests involving _Complex pass with both hard-fp and soft-fp targets.

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

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

7 years ago[PowerPC] Pass CPU to assembler with -no-integrated-as
Nemanja Ivanovic [Thu, 27 Jul 2017 08:58:28 +0000 (08:58 +0000)]
[PowerPC] Pass CPU to assembler with -no-integrated-as

This just adds the CPU to a list of commands passed to GAS when not using the
integrated assembler.

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

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

7 years ago[Coverage] NFC: Simplify sanity checks with a SpellingRange utility
Vedant Kumar [Thu, 27 Jul 2017 02:20:25 +0000 (02:20 +0000)]
[Coverage] NFC: Simplify sanity checks with a SpellingRange utility

This should simplify D35925.

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

7 years ago[Coverage] NFC: Save a pair of calls to get{Start,End}
Vedant Kumar [Thu, 27 Jul 2017 02:20:20 +0000 (02:20 +0000)]
[Coverage] NFC: Save a pair of calls to get{Start,End}

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

7 years agoHeaders: improve ARM EHABI coverage of unwind.h
Saleem Abdulrasool [Wed, 26 Jul 2017 22:55:23 +0000 (22:55 +0000)]
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/trunk@309226 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd branch weights to branches for static initializers.
Richard Smith [Wed, 26 Jul 2017 22:01:09 +0000 (22:01 +0000)]
Add branch weights to branches for static initializers.

The initializer for a static local variable cannot be hot, because it runs at
most once per program. That's not quite the same thing as having a low branch
probability, but under the assumption that the function is invoked many times,
modeling this as a branch probability seems reasonable.

For TLS variables, the situation is less clear, since the initialization side
of the branch can run multiple times in a program execution, but we still
expect initialization to be rare relative to non-initialization uses. It would
seem worthwhile to add a PGO counter along this path to make this estimation
more accurate in future.

For globals with guarded initialization, we don't yet apply any branch weights.
Due to our use of COMDATs, the guard will be reached exactly once per DSO, but
we have no idea how many DSOs will define the variable.

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

7 years agoConvert mac file format to unix
Konstantin Zhuravlyov [Wed, 26 Jul 2017 21:59:45 +0000 (21:59 +0000)]
Convert mac file format to unix

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

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

7 years agoClang and LLVM search for different versions of libxml2, reset found
Eric Beckmann [Wed, 26 Jul 2017 21:47:17 +0000 (21:47 +0000)]
Clang and LLVM search for different versions of libxml2, reset found
variable before each search so that they don't conflict.

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

7 years agoRevert r309106 "Recommit r308327 2nd time: Add a warning for missing"
Hans Wennborg [Wed, 26 Jul 2017 21:29:24 +0000 (21:29 +0000)]
Revert r309106 "Recommit r308327 2nd time: Add a warning for missing"

The warning fires on non-suspicious code in Chromium. Reverting until a
solution is figured out.

> Recommit r308327 2nd time: Add a warning for missing
> '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files
>
> The first recommit (r308441) caused a "non-default #pragma pack value might
> change the alignment of struct or union members in the included file" warning
> in LLVM itself. This recommit tweaks the added warning to avoid warnings for
> #includes that don't have any records that are affected by the non-default
> alignment. This tweak avoids the previously emitted warning in LLVM.
>
> Original message:
>
> 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@309186 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenCL] Fix access qualifiers metadata for kernel arguments with typedef
Alexey Sotkin [Wed, 26 Jul 2017 18:49:54 +0000 (18:49 +0000)]
[OpenCL] Fix access qualifiers metadata for kernel arguments with typedef

Subscribers: cfe-commits, yaxunl, Anastasia

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

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

7 years agoAdd bitrig removal to release notes
Erich Keane [Wed, 26 Jul 2017 18:04:45 +0000 (18:04 +0000)]
Add bitrig removal to release notes

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

7 years agoRegression test for PR10856
Serge Pavlov [Wed, 26 Jul 2017 14:58:55 +0000 (14:58 +0000)]
Regression test for PR10856

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

7 years agounguarded availability: add a fixit for the "annotate '...'
Alex Lorenz [Wed, 26 Jul 2017 13:58:02 +0000 (13:58 +0000)]
unguarded availability: add a fixit for the "annotate '...'
with an availability attribute to silence" note

rdar://33539233

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

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

7 years ago[Bash-autocompletion] Show HelpText with possible flags
Yuka Takahashi [Wed, 26 Jul 2017 13:36:58 +0000 (13:36 +0000)]
[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/trunk@309113 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Bash-completion] Fixed a bug that file doesn't autocompleted after =
Yuka Takahashi [Wed, 26 Jul 2017 13:30:36 +0000 (13:30 +0000)]
[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/trunk@309112 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRecommit r308327 2nd time: Add a warning for missing
Alex Lorenz [Wed, 26 Jul 2017 12:20:57 +0000 (12:20 +0000)]
Recommit r308327 2nd time: Add a warning for missing
'#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files

The first recommit (r308441) caused a "non-default #pragma pack value might
change the alignment of struct or union members in the included file" warning
in LLVM itself. This recommit tweaks the added warning to avoid warnings for
#includes that don't have any records that are affected by the non-default
alignment. This tweak avoids the previously emitted warning in LLVM.

Original message:

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@309106 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate after LLVM change r309087
George Rimar [Wed, 26 Jul 2017 09:10:17 +0000 (09:10 +0000)]
Update after LLVM change r309087

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

7 years ago[clang] Add ARM64 support to armintr.h for MSVC compatibility
Mandeep Singh Grang [Wed, 26 Jul 2017 05:29:40 +0000 (05:29 +0000)]
[clang] Add ARM64 support to armintr.h for MSVC compatibility

Summary: This fixes compiling with headers from the Windows SDK for ARM64.

Reviewers: compnerd, ruiu, mstorsjo

Reviewed By: compnerd, mstorsjo

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

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

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

7 years ago[StaticAnalyzer] LoopUnrolling - Attempt #2 to fix a crash in r309006.
Peter Szecsi [Tue, 25 Jul 2017 23:49:16 +0000 (23:49 +0000)]
[StaticAnalyzer] LoopUnrolling - Attempt #2 to fix a crash in r309006.

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

7 years ago[CodeGen] Correctly model std::byte's aliasing properties
David Majnemer [Tue, 25 Jul 2017 23:33:58 +0000 (23:33 +0000)]
[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/trunk@309058 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReorder tests to match latest SD-6 draft.
Richard Smith [Tue, 25 Jul 2017 23:31:42 +0000 (23:31 +0000)]
Reorder tests to match latest SD-6 draft.

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

7 years agoclang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h: Add a forward decl AnalysisM...
NAKAMURA Takumi [Tue, 25 Jul 2017 23:23:17 +0000 (23:23 +0000)]
clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h: Add a forward decl AnalysisManager, to unbreak modules build.

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

7 years ago[clang] Add abi-breaking-checks support to clang
Mandeep Singh Grang [Tue, 25 Jul 2017 23:00:02 +0000 (23:00 +0000)]
[clang] Add abi-breaking-checks support to clang

Summary: You can now use REQUIRES:abi-breaking-checks in clang too

Reviewers: chapuni, probinson, ddunbar, jroelofs

Reviewed By: jroelofs

Subscribers: jroelofs, cfe-commits

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

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

7 years ago[StaticAnalyzer] LoopUnrolling - Attempt to fix a crash in r309006.
Peter Szecsi [Tue, 25 Jul 2017 21:54:58 +0000 (21:54 +0000)]
[StaticAnalyzer] LoopUnrolling - Attempt to fix a crash in r309006.

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

7 years agoFix a bot by linking clang-import-test against libclangDriver
Sean Callanan [Tue, 25 Jul 2017 20:09:30 +0000 (20:09 +0000)]
Fix a bot by linking clang-import-test against libclangDriver

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

7 years ago[ExternalASTMerger] Import Objective-C classes
Sean Callanan [Tue, 25 Jul 2017 19:54:22 +0000 (19:54 +0000)]
[ExternalASTMerger] Import Objective-C classes

This patch adds functionality and a test for importing Objective-C classes
and their methods.

It also adds a flag to clang-import-test to set the language used for
parsing. This takes the same argument format as the -x option to the
driver.

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

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

7 years ago[Frontend] Mark some ASTUnit methods as const. NFC.
Vedant Kumar [Tue, 25 Jul 2017 19:53:27 +0000 (19:53 +0000)]
[Frontend] Mark some ASTUnit methods as const. NFC.

Patch by Hamza Sood!

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

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

7 years ago[ubsan] Null-check pointers in -fsanitize=vptr (PR33881)
Vedant Kumar [Tue, 25 Jul 2017 19:34:23 +0000 (19:34 +0000)]
[ubsan] Null-check pointers in -fsanitize=vptr (PR33881)

The instrumentation generated by -fsanitize=vptr does not null check a
user pointer before loading from it. This causes crashes in the face of
UB member calls (this=nullptr), i.e it's causing user programs to crash
only after UBSan is turned on.

The fix is to make run-time null checking a prerequisite for enabling
-fsanitize=vptr, and to then teach UBSan to reuse these run-time null
checks to make -fsanitize=vptr safe.

Testing: check-clang, check-ubsan, a stage2 ubsan-enabled build

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

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

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

7 years ago[StaticAnalyzer] Completely unrolling specific loops with known bound option
Peter Szecsi [Tue, 25 Jul 2017 19:23:23 +0000 (19:23 +0000)]
[StaticAnalyzer] Completely unrolling specific loops with known bound option

This feature allows the analyzer to consider loops to completely unroll.
New requirements/rules (for unrolling) can be added easily via ASTMatchers.

Right now it is hidden behind a flag, the aim is to find the correct heuristic
and create a solution which results higher coverage % and more precise
analysis, thus can be enabled by default.

Right now the blocks which belong to an unrolled loop are marked by the
LoopVisitor which adds them to the ProgramState.
Then whenever we encounter a CFGBlock in the processCFGBlockEntrance which is
marked then we skip its investigating. That means, it won't be considered to
be visited more than the maximal bound for visiting since it won't be checked.

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

7 years agoRevert "This patch enables the usage of constant Enum identifiers within Microsoft...
Eric Christopher [Tue, 25 Jul 2017 19:17:32 +0000 (19:17 +0000)]
Revert "This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements." as it is causing msan failures.

This reverts commits r308985 and r308965

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

7 years agoIntroduce -nostdlib++ flag to disable linking the C++ standard library.
Nico Weber [Tue, 25 Jul 2017 18:02:57 +0000 (18:02 +0000)]
Introduce -nostdlib++ flag to disable linking the C++ standard library.

Projects that want to statically link their own C++ standard library currently
need to pass -nostdlib or -nodefaultlibs, which also disables linking of the
builtins library, -lm, and so on. Alternatively, they could use `clang` instead
of `clang++`, but that already disables implicit addition of -lm on some
toolchains.

Add a dedicated flag -nostdlib++ that disables just linking of libc++ /
libstdc++. This is analogous to -nostdinc++.

https://reviews.llvm.org/D35780

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

7 years ago[coroutines] Add serialization/deserialization of coroutines
Gor Nishanov [Tue, 25 Jul 2017 18:01:49 +0000 (18:01 +0000)]
[coroutines] Add serialization/deserialization of coroutines

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: EricWF, cfe-commits

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

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

7 years ago[analyzer] Add diagnostic text for generalized refcount annotations.
Devin Coughlin [Tue, 25 Jul 2017 17:17:09 +0000 (17:17 +0000)]
[analyzer] Add diagnostic text for generalized refcount annotations.

Add a 'Generalized' object kind to the retain-count checker and suitable
generic diagnostic text for retain-count diagnostics involving those objects.

For now the object kind is introduced in summaries by 'annotate' attributes.
Once we have more experience with these annotations we will propose explicit
attributes.

Patch by Malhar Thakkar!

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

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

7 years agoThis test case is causing all PPC and SystemZ bots to remain red.
Nemanja Ivanovic [Tue, 25 Jul 2017 17:04:12 +0000 (17:04 +0000)]
This test case is causing all PPC and SystemZ bots to remain red.

Notifying the author via Diffusion did not yield any answer. Therefore, I'm
adding the missing triple. I have no idea if this is the intended triple, but
it seems to fit the bill and should turn the bots back to green.
If the intended triple is a different one, please feel free to change it but I
need make this change to turn the bots back to green now.

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

7 years ago[OPENMP] Codegen for 'task_reduction' clause.
Alexey Bataev [Tue, 25 Jul 2017 15:53:26 +0000 (15:53 +0000)]
[OPENMP] Codegen for 'task_reduction' clause.

Added codegen for taskgroup directive with task_reduction clause.
```
<body>
```
The next code is emitted:
```
%struct.kmp_task_red_input_t red_init[n];
void *td;
call void @__kmpc_taskgroup(%ident_t id, i32 gtid)
...
red_init[i].shar = &<item>;
red_init[i].size = sizeof(<item>);
red_init[i].init = (void*)initializer_function;
red_init[i].fini = (void*)destructor_function;
red_init[i].comb = (void*)combiner_function;
red_init[i].flags = flags;
...
td = call i8* @__kmpc_task_reduction_init(i32 gtid, i32 n, i8*
(void*)red_init);
call void @__kmpc_end_taskgroup(%ident_t id, i32 gtid)

void initializer_function(i8* priv) {
  *(<type>*)priv = <red_init>;
  ret void;
}

void destructor_function(i8* priv) {
  (<type>*)priv->~();
  ret void;
}

void combiner_function(i8* inout, i8* in) {
  *(<type>*)inout = *(<type>*)inout <red_id> *(<type>*)in;
  ret void;
}
```

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

7 years agoFix spelling of FileCheck in test.
Manuel Klimek [Tue, 25 Jul 2017 11:34:55 +0000 (11:34 +0000)]
Fix spelling of FileCheck in test.

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

7 years ago[PM] Setup TargetLibraryInfo correctly for the new pass manager.
Chandler Carruth [Tue, 25 Jul 2017 10:46:07 +0000 (10:46 +0000)]
[PM] Setup TargetLibraryInfo correctly for the new pass manager.

Without this, -fno-builtin and friends doesn't work. Added the obvious
RUN lines to the test for -fno-builtin and they pass now.

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

7 years agoThis patch enables the usage of constant Enum identifiers within Microsoft style...
Matan Haroush [Tue, 25 Jul 2017 10:43:43 +0000 (10:43 +0000)]
This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements.

Differential Revision:
https://reviews.llvm.org/D33277
https://reviews.llvm.org/D33278

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

7 years agoFix incorrect use of current directory to find moved paths in ASTReader.
Manuel Klimek [Tue, 25 Jul 2017 10:22:06 +0000 (10:22 +0000)]
Fix incorrect use of current directory to find moved paths in ASTReader.

CurrentDir was set as the path of the current module, but that can change as
part of a chain of loaded modules.

When we try to locate a file mentioned in a module that does not exist, we use
a heuristic to look at the relative path between the original location of the
module and the file we look for, and use that relatively to the CurrentDir.

This only works if CurrentDir is the same as the (current) path of the module
file the file was mentioned in; if it is not, we look at the path relatively to
the wrong directory, and can end up reading random unrelated files that happen
to have the same name.

This patch fixes this by using the BaseDirectory of the module file the file
we look for was mentioned in instead of the CurrentDir heuristic.

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

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

7 years ago[analyzer] Treat throws as sinks for suppress-on-sink purposes.
Artem Dergachev [Tue, 25 Jul 2017 09:44:02 +0000 (09:44 +0000)]
[analyzer] Treat throws as sinks for suppress-on-sink purposes.

Because since r308957 the suppress-on-sink feature contains its own
mini-analysis, it also needs to become aware that C++ unhandled exceptions
cause sinks. Unfortunately, for now we treat all exceptions as unhandled in
the analyzer, so suppress-on-sink needs to do the same.

rdar://problem/28157554

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

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

7 years ago[analyzer] Further improve suppress-on-sink behavior in incomplete analyses.
Artem Dergachev [Tue, 25 Jul 2017 09:25:10 +0000 (09:25 +0000)]
[analyzer] Further improve suppress-on-sink behavior in incomplete analyses.

If a certain memory leak (or other similar bug) found by the analyzer is known
to be happening only before abnormal termination of the program ("sink", eg.
assertion failure in the code under analysis, or another bug that introduces
undefined behavior), such leak warning is discarded. However, if the analysis
has never reaches completion (due to complexity of the code), it may be
failing to notice the sink.

This commit further extends the partial solution introduced in r290341 to cover
cases when a complicated control flow occurs before encountering a no-return
statement (which anyway inevitably leads to such statement(s)) by traversing
the respective section of the CFG in a depth-first manner. A complete solution
still seems elusive.

rdar://problem/28157554

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

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

7 years ago[NFC] Use RAII to un-poison and then re-poison __VA_ARGS__
Faisal Vali [Tue, 25 Jul 2017 03:15:36 +0000 (03:15 +0000)]
[NFC] Use RAII to un-poison and then re-poison __VA_ARGS__
  - This will also be used for the forthcoming __VA_OPT__ feature approved for C++2a.
  - recommended by rsmith during his review of the __VA_OPT__ patch (https://reviews.llvm.org/D35782)

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

7 years agoDebug Info: Avoid completing class types when a definition is in a module.
Adrian Prantl [Mon, 24 Jul 2017 23:48:51 +0000 (23:48 +0000)]
Debug Info: Avoid completing class types when a definition is in a module.

This patch adds an early exit to CGDebugInfo::completeClassData() when
compiling with -gmodules and the to-be-completed type is available in
a clang module.

rdar://problem/23599990

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

7 years agoRevert "[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when...
Reid Kleckner [Mon, 24 Jul 2017 20:48:15 +0000 (20:48 +0000)]
Revert "[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when the two collides"

This reverts r308867 and r308866.

It broke the sanitizer-windows buildbot on C++ code similar to the
following:

  namespace cl { }
  void f() {
    __asm {
      mov al, cl
    }
  }

t.cpp(4,13):  error: unexpected namespace name 'cl': expected expression
    mov al, cl
            ^

In this case, MSVC parses 'cl' as a register, not a namespace.

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

7 years ago[clang-format] Reorder assignments, NFC
Krasimir Georgiev [Mon, 24 Jul 2017 19:52:49 +0000 (19:52 +0000)]
[clang-format] Reorder assignments, NFC

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

7 years ago[CodeGen] Propagate dllexport to thunks
Shoaib Meenai [Mon, 24 Jul 2017 17:16:27 +0000 (17:16 +0000)]
[CodeGen] Propagate dllexport to thunks

Under Windows Itanium, we need to export virtual and non-virtual thunks
if the functions being thunked are exported. These thunks would
previously inherit their dllexport attribute from the declaration, but
r298330 changed declarations to not have dllexport attributes. We
therefore need to add the dllexport attribute to the definition
ourselves now. This is consistent with MinGW GCC's behavior.

This redoes r306770 but limits the logic to Itanium. MicrosoftCXXABI's
setThunkLinkage ensures that thunks aren't exported under that ABI, so
I'm handling this in ItaniumCXXABI's setThunkLinkage for symmetry.

We need to export these thunks because they can be referenced outside
the library they're defined in. For example, if a child class without a
key function inherits from a parent class with a key function, the
parent's thunks will only be defined in the library with the key
function, but the construction vtable for the parent in the child might
be emitted outside the library (since the child doesn't have a key
function), and it needs to reference the parent's thunks.

We don't need to mark these thunks as imported since any references to
them will occur in data, so the compiler can't generate the IAT load
sequence anyway. Instead, we rely on the linker generating import thunks
for the thunks.

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

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

7 years agoAArch64 & ARM: move TargetInfo functions from .h to .cpp file. NFC.
Tim Northover [Mon, 24 Jul 2017 17:06:23 +0000 (17:06 +0000)]
AArch64 & ARM: move TargetInfo functions from .h to .cpp file. NFC.

Most of them are virtual anyway, and the few remaining ones can move to the
.cpp for consistency.

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

7 years agoWork around an MSVC2017 update 3 codegen bug.
Nico Weber [Mon, 24 Jul 2017 16:54:11 +0000 (16:54 +0000)]
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/trunk@308897 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Fix the restrictions for in_reduction clause.
Alexey Bataev [Mon, 24 Jul 2017 14:52:13 +0000 (14:52 +0000)]
[OPENMP] Fix the restrictions for in_reduction clause.

This patch allows to use in_reduction clause even if the innermost
directive is not taskgroup.

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

7 years ago[clang-format] Fix comment levels between '} else {' and PPDirective.
Krasimir Georgiev [Mon, 24 Jul 2017 14:51:59 +0000 (14:51 +0000)]
[clang-format] Fix comment levels between '} else {' and PPDirective.

Summary:
This fixes a regression exposed by r307795 and rL308725 in which the level of a
comment line between '} else {' and a preprocessor directive is incorrectly set
as the level of the '} else {' line. For example, this :
```
int f(int i) {
  if (i) {
    ++i;
  } else {
    // comment
#ifdef A
    --i;
#endif
  }
}
```
was formatted as:
```
int f(int i) {
  if (i) {
    ++i;
  } else {
  // comment
#ifdef A
    --i;
#endif
  }
}
```

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

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

7 years ago[mips] Add support for -m(no-)extern-data.
Simon Dardis [Mon, 24 Jul 2017 14:02:09 +0000 (14:02 +0000)]
[mips] Add support for -m(no-)extern-data.

Add support for -m(no-)extern-data when using -mgpopt in the driver. It is
enabled by default in the backend.

Reviewers: atanasyan, slthakur

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

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

7 years ago[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when the two...
Coby Tayree [Mon, 24 Jul 2017 07:06:37 +0000 (07:06 +0000)]
[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when the two collides

On MS-style, the following snippet:

int eax;
__asm mov eax, ebx

should yield loading of ebx, into the location pointed by the variable eax

This patch sees to it.

Currently, a reg-to-reg move would have been invoked.

llvm: D34739

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

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

7 years ago[Driver] Fuchsia defaults to -fno-math-errno
Petr Hosek [Sun, 23 Jul 2017 22:30:13 +0000 (22:30 +0000)]
[Driver] Fuchsia defaults to -fno-math-errno

Patch by Roland McGrath

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

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

7 years agoRemove Driver::UseStdLib.
Nico Weber [Sun, 23 Jul 2017 16:31:47 +0000 (16:31 +0000)]
Remove Driver::UseStdLib.

All but one place are checking options::OPT_nostdlib instead of looking at
this field, so convert that one other place to doing that as well.

No behavior change.

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

7 years ago[Modules] Rework r274270. Let Clang targets depend on intrinsics_gen.
NAKAMURA Takumi [Sun, 23 Jul 2017 05:09:44 +0000 (05:09 +0000)]
[Modules] Rework r274270. Let Clang targets depend on intrinsics_gen.

This gets rid of almost LLVM targets unconditionally depending on intrinsic_gen.

Clang's modules still have weird dependencies and hard to remove intrinsics_gen in better way.
Then, it'd be better to give whole clang targets depend on intrinsic_gen.

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

7 years agoclang/module.modulemap: Split out Clang_ToolingCore from Clang_Tooling.
NAKAMURA Takumi [Sun, 23 Jul 2017 01:40:36 +0000 (01:40 +0000)]
clang/module.modulemap: Split out Clang_ToolingCore from Clang_Tooling.

It cuts clangFormat's dependencies out of;

  Clang_Analysis
  Clang_C
  Clang_Diagnostics
  Clang_Driver
  Clang_Frontend
  Clang_Sema
  Clang_Serialization
  Clang_StaticAnalyzer_Core
  Clang_Tooling -> Clang_ToolingCore

Now, the module Clang_Format depends on;

  Clang_AST
  Clang_Basic
  Clang_ToolingCore

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

7 years ago[Bash-autocompletion] Fixed typo and add '-' after -Wno
Yuka Takahashi [Sat, 22 Jul 2017 12:35:15 +0000 (12:35 +0000)]
[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/trunk@308824 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NFC, documentation] Prefer the term expansion instead of macro instantiation
Faisal Vali [Sat, 22 Jul 2017 12:04:37 +0000 (12:04 +0000)]
[NFC, documentation] Prefer the term expansion instead of macro instantiation

... in the few remaining places where this was not corrected.

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

7 years ago[index] Set SymbolSubKind::Accessor[GS]etter on class methods
Ben Langmuir [Fri, 21 Jul 2017 23:04:27 +0000 (23:04 +0000)]
[index] Set SymbolSubKind::Accessor[GS]etter on class methods

We have the same relation between class properties and getter/setters
that we have for instance properties, so set the same symbol sub-kind.

rdar://problem/32376404

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

7 years agoRemove Bitrig: Clang Changes
Erich Keane [Fri, 21 Jul 2017 22:46:31 +0000 (22:46 +0000)]
Remove Bitrig: Clang Changes

Bitrig code has been merged back to OpenBSD, thus the OS has been abandoned.

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

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

7 years agoBreak up Targets.cpp into a header/impl pair per target type[NFCI]
Erich Keane [Fri, 21 Jul 2017 22:37:03 +0000 (22:37 +0000)]
Break up Targets.cpp into a header/impl pair per target type[NFCI]

Targets.cpp is getting unwieldy, and even minor changes cause the entire thing
to cause recompilation for everyone. This patch bites the bullet and breaks
it up into a number of files.

I tended to keep function definitions in the class declaration unless it
caused additional includes to be necessary. In those cases, I pulled it
over into the .cpp file. Content is copy/paste for the most part,
besides includes/format/etc.

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

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

7 years agoInline variable into assert to fix unused warning.
Richard Trieu [Fri, 21 Jul 2017 21:29:35 +0000 (21:29 +0000)]
Inline variable into assert to fix unused warning.

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

7 years ago[Hexagon] Attempt to fix selfhost bots
Krzysztof Parzyszek [Fri, 21 Jul 2017 21:23:05 +0000 (21:23 +0000)]
[Hexagon] Attempt to fix selfhost bots

The codegen testcase was checking for specific value names. Make it
ignore the names instead as they are irrelevant.

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

7 years agoFix tblgen error
Richard Trieu [Fri, 21 Jul 2017 20:32:22 +0000 (20:32 +0000)]
Fix tblgen error

Add Heading string to attribute documentation.

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

7 years ago[OPENMP] Fix build problem, NFC.
Alexey Bataev [Fri, 21 Jul 2017 19:26:22 +0000 (19:26 +0000)]
[OPENMP] Fix build problem, NFC.

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

7 years ago[OPENMP] Add ast-print tests for in_reduction clause, NFC.
Alexey Bataev [Fri, 21 Jul 2017 18:55:46 +0000 (18:55 +0000)]
[OPENMP] Add ast-print tests for in_reduction clause, NFC.

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

7 years agoComplex Long Double classification In RegCall calling convention
Erich Keane [Fri, 21 Jul 2017 18:50:36 +0000 (18:50 +0000)]
Complex Long Double classification In RegCall calling convention

This change is part of the RegCall calling convention support for LLVM.
Existing RegCall implementation was extended to include correct handling of
Complex Long Double type. Complex long double types should be returned/passed
in memory and not register stack. This patch implements this behavior.

Patch by: eandrews

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

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

7 years ago[OPENMP] Initial support for 'in_reduction' clause.
Alexey Bataev [Fri, 21 Jul 2017 18:48:21 +0000 (18:48 +0000)]
[OPENMP] Initial support for 'in_reduction' clause.

Parsing/sema analysis for 'in_reduction' clause for task-based
directives.

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

7 years ago[Hexagon] Add inline-asm constraint 'a' for modifier register class
Krzysztof Parzyszek [Fri, 21 Jul 2017 18:07:15 +0000 (18:07 +0000)]
[Hexagon] Add inline-asm constraint 'a' for modifier register class

For example
  asm ("memw(%0++%1) = %2" : : "r"(addr),"a"(mod),"r"(val) : "memory")

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

7 years ago[OPENMP] Simplify analysis of data-sharing attributes.
Alexey Bataev [Fri, 21 Jul 2017 17:24:30 +0000 (17:24 +0000)]
[OPENMP] Simplify analysis of data-sharing attributes.

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

7 years agoTest commit
Andrey Kasaurov [Fri, 21 Jul 2017 15:24:37 +0000 (15:24 +0000)]
Test commit

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

7 years agoTest commit
Nikolay Haustov [Fri, 21 Jul 2017 13:58:11 +0000 (13:58 +0000)]
Test commit

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

7 years ago[clang-diff] Get rid of unused variable warnings in ASTDiff.cpp
Alex Lorenz [Fri, 21 Jul 2017 13:18:51 +0000 (13:18 +0000)]
[clang-diff] Get rid of unused variable warnings in ASTDiff.cpp

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

7 years agoClang's tests should depend on clang-diff
Alex Lorenz [Fri, 21 Jul 2017 13:12:01 +0000 (13:12 +0000)]
Clang's tests should depend on clang-diff

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

7 years agoFix another compiler error from r308731
Alex Lorenz [Fri, 21 Jul 2017 13:04:57 +0000 (13:04 +0000)]
Fix another compiler error from r308731

std::pair in emplace back couldn't be constructed because SNodeId has an
explicit constructor. Not sure how this even compiled on my machine before.

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

7 years agoFix tuple construction compiler error from r308731
Alex Lorenz [Fri, 21 Jul 2017 12:57:40 +0000 (12:57 +0000)]
Fix tuple construction compiler error from r308731

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

7 years ago[clang-diff] Add initial implementation
Alex Lorenz [Fri, 21 Jul 2017 12:49:28 +0000 (12:49 +0000)]
[clang-diff] Add initial implementation

This is the first commit for the "Clang-based C/C++ diff tool" GSoC project.

ASTDiff is a new library that computes a structural AST diff between two ASTs
using the gumtree algorithm. Clang-diff is a new Clang tool that will show
the structural code changes between different ASTs.

Patch by Johannes Altmanninger!

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

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

7 years ago[clang-format] Fix comment levels between '}' and PPDirective
Krasimir Georgiev [Fri, 21 Jul 2017 10:26:13 +0000 (10:26 +0000)]
[clang-format] Fix comment levels between '}' and PPDirective

Summary:
This fixes a regression exposed by r307795 in which the level of a comment line
between '}' and a preprocessor directive is incorrectly set as the level of the
line before the '}'. In effect, this:
```
int f(int i) {
  int j = i;
  return i + j;
}
// comment

#ifdef A
#endif
```
was formatted as:
```
int f(int i) {
  int j = i;
  return i + j;
}
  // comment

#ifdef A
#endif
```

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

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

7 years agoFixed failing assert in code completion.
Ilya Biryukov [Fri, 21 Jul 2017 09:24:00 +0000 (09:24 +0000)]
Fixed failing assert in code completion.

Summary:
The code was accessing uninstantiated default argument.
This resulted in failing assertion at ParmVarDecl::getDefaultArg().

Reviewers: erikjv, klimek, bkramer, krasimir

Reviewed By: krasimir

Subscribers: cfe-commits

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

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

7 years ago[mips] Add `short_call` to the set of `long_call/far/near` attributes
Simon Atanasyan [Fri, 21 Jul 2017 08:10:57 +0000 (08:10 +0000)]
[mips] Add `short_call` to the set of `long_call/far/near` attributes

MIPS gcc supports `long_call/far/near` attributes only, but other
targets have the `short_call` attribut, so let's support it for MIPS
for consistency.

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

7 years agoFix tblgen error.
Richard Trieu [Fri, 21 Jul 2017 04:56:48 +0000 (04:56 +0000)]
Fix tblgen error.

tblgen couldn't determing a unique name between "long_call" and "far", so it
errored out when generating documentation.  Copy the documentation, and give
an explicit header for "long_call".

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

7 years ago[Driver] Consider -fno-sanitize=... state when filtering out -fsanitize-coverage=...
Petr Hosek [Fri, 21 Jul 2017 01:17:49 +0000 (01:17 +0000)]
[Driver] Consider -fno-sanitize=... state when filtering out -fsanitize-coverage=...

The driver ignores -fsanitize-coverage=... flags when also given
-fsanitize=... flags for sanitizer flavors that don't support the
coverage runtime. This logic failed to account for subsequent
-fno-sanitize=... flags that disable the sanitizer flavors that
conflict with -fsanitize-coverage=... flags.

Patch by Roland McGrath

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

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