]> granicus.if.org Git - clang/log
clang
7 years ago[sanitizer-coverage] more docs
Kostya Serebryany [Thu, 29 Sep 2016 18:58:17 +0000 (18:58 +0000)]
[sanitizer-coverage] more docs

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

7 years ago[sanitize-coverage] doc typo
Kostya Serebryany [Thu, 29 Sep 2016 18:34:40 +0000 (18:34 +0000)]
[sanitize-coverage] doc typo

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

7 years ago[sanitizer-coverage/libFuzzer] make the guards for trace-pc 32-bit; create one array...
Kostya Serebryany [Thu, 29 Sep 2016 17:43:24 +0000 (17:43 +0000)]
[sanitizer-coverage/libFuzzer] make the guards for trace-pc 32-bit; create one array of guards per function, instead of one guard per BB. reorganize the code so that trace-pc-guard does not create unneeded globals

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

7 years agoRevert "[PR30341] Alias must point to a definition"
Aditya Kumar [Thu, 29 Sep 2016 11:37:23 +0000 (11:37 +0000)]
Revert "[PR30341] Alias must point to a definition"

This reverts commit r282679.

Ninja check fails, reverting to debug the issue.

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

7 years agoXFAIL Driver/darwin-stdlib.cpp if CLANG_DEFAULT_CXX_STDLIB is set
Jonas Hahnfeld [Thu, 29 Sep 2016 07:43:08 +0000 (07:43 +0000)]
XFAIL Driver/darwin-stdlib.cpp if CLANG_DEFAULT_CXX_STDLIB is set

Until someone rewrites the stdlib logic for Darwin so that we don't need
to pass down the -stdlib argument to cc1.
(see https://llvm.org/bugs/show_bug.cgi?id=30548)

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

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

7 years ago[PR30341] Alias must point to a definition
Aditya Kumar [Thu, 29 Sep 2016 03:32:04 +0000 (03:32 +0000)]
[PR30341] Alias must point to a definition

Inlining the destructor caused the compiler to generate bad IR which failed the Verifier in the backend.
https://llvm.org/bugs/show_bug.cgi?id=30341

This patch disables alias to available_externally definitions.

Reviewers: eugenis, rsmith

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

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

7 years agoMark P0127R3 as done, and replace its __has_feature check with the corresponding...
Richard Smith [Thu, 29 Sep 2016 00:08:05 +0000 (00:08 +0000)]
Mark P0127R3 as done, and replace its __has_feature check with the corresponding SD-6 macro.

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

7 years agoP0127R2: Support type deduction for types of non-type template parameters in
Richard Smith [Wed, 28 Sep 2016 23:55:27 +0000 (23:55 +0000)]
P0127R2: Support type deduction for types of non-type template parameters in
C++1z.

Patch by James Touton! Some bugfixes and rebasing by me.

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

7 years ago[CUDA] Disallow variable-length arrays in CUDA device code.
Justin Lebar [Wed, 28 Sep 2016 22:45:58 +0000 (22:45 +0000)]
[CUDA] Disallow variable-length arrays in CUDA device code.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

7 years ago[CUDA] Disallow exceptions in device code.
Justin Lebar [Wed, 28 Sep 2016 22:45:54 +0000 (22:45 +0000)]
[CUDA] Disallow exceptions in device code.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

7 years ago[Coroutines] Add proper mangling for operator co_await for MicrosoftABI
Gor Nishanov [Wed, 28 Sep 2016 22:37:17 +0000 (22:37 +0000)]
[Coroutines] Add proper mangling for operator co_await for MicrosoftABI

Reviewers: rnk, rsmith

Subscribers: mehdi_amini, cfe-commits

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

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

7 years agoFix bug where template argument deduction of a non-type template parameter used
Richard Smith [Wed, 28 Sep 2016 22:08:38 +0000 (22:08 +0000)]
Fix bug where template argument deduction of a non-type template parameter used
as a template argument in a template-id, from a null non-type template
argument, failed.

Extracted from a patch by James Touton!

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

7 years agocxx_status: use HTML5 details/summary elements to hide implementation status
Richard Smith [Wed, 28 Sep 2016 21:01:37 +0000 (21:01 +0000)]
cxx_status: use HTML5 details/summary elements to hide implementation status
tables for fully-implemented language modes by default. Also add some missing
elements to TS support table.

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

7 years agoAdd a couple more tentative names for upcoming SD-6 feature checks. These might
Richard Smith [Wed, 28 Sep 2016 20:42:56 +0000 (20:42 +0000)]
Add a couple more tentative names for upcoming SD-6 feature checks. These might
not reflect the final chosen names, but supporting them now seems to have
little downside.

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

7 years agoP0095R3: Implement the latest published revision of SD-6 (C++ feature test macros).
Richard Smith [Wed, 28 Sep 2016 20:26:06 +0000 (20:26 +0000)]
P0095R3: Implement the latest published revision of SD-6 (C++ feature test macros).

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

7 years agoP0096R2: Implement more recent revision of SD-6 (C++ feature test macros).
Richard Smith [Wed, 28 Sep 2016 19:44:50 +0000 (19:44 +0000)]
P0096R2: Implement more recent revision of SD-6 (C++ feature test macros).

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

7 years agoLong-overdue update to cxx_status: C++14 is no longer "upcoming".
Richard Smith [Wed, 28 Sep 2016 19:22:36 +0000 (19:22 +0000)]
Long-overdue update to cxx_status: C++14 is no longer "upcoming".

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

7 years agoRe-commit r282556, reverted in r282564, with a fix to CallArgList::addFrom to
Richard Smith [Wed, 28 Sep 2016 19:09:10 +0000 (19:09 +0000)]
Re-commit r282556, reverted in r282564, with a fix to CallArgList::addFrom to
function correctly when targeting MS ABIs (this appears to have never mattered
prior to this change).

Update test case to always cover both 32-bit and 64-bit Windows ABIs, since
they behave somewhat differently from each other here.

Update test case to also cover operators , && and ||, which it appears are also
affected by P0145R3 (they're not explicitly called out by the design document,
but this is the emergent behavior of the existing wording).

Original commit message:

P0145R3 (C++17 evaluation order tweaks): evaluate the right-hand side of
assignment and compound-assignment operators before the left-hand side. (Even
if it's an overloaded operator.)

This completes the implementation of P0145R3 + P0400R0 for all targets except
Windows, where the evaluation order guarantees for <<, >>, and ->* are
unimplementable as the ABI requires the function arguments are evaluated from
right to left (because parameter destructors are run from left to right in the
callee).

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

7 years ago[CUDA] Added support for CUDA-8
Artem Belevich [Wed, 28 Sep 2016 17:47:40 +0000 (17:47 +0000)]
[CUDA] Added support for CUDA-8

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

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

7 years ago[CUDA] added __nvvm_atom_{sys|cta}_* builtins.
Artem Belevich [Wed, 28 Sep 2016 17:47:35 +0000 (17:47 +0000)]
[CUDA] added __nvvm_atom_{sys|cta}_* builtins.

These builtins are available on sm_60+ GPU only.

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

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

7 years agoTrying to buildbot failures caused by r282577.
Eric Liu [Wed, 28 Sep 2016 12:49:14 +0000 (12:49 +0000)]
Trying to buildbot failures caused by r282577.

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

7 years ago[X86] Remove the mm_malloc.h include guard hack from the X86 builtins tests
Elad Cohen [Wed, 28 Sep 2016 11:59:09 +0000 (11:59 +0000)]
[X86] Remove the mm_malloc.h include guard hack from the X86 builtins tests

The X86 clang/test/CodeGen/*builtins.c tests define the mm_malloc.h include
guard as a hack for avoiding its inclusion (mm_malloc.h requires a hosted
environment since it expects stdlib.h to be available - which is not the case
in these internal clang codegen tests).
This patch removes this hack and instead passes -ffreestanding to clang cc1.

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

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

7 years agoASTMerge: explicitly specify arch for GCCAsmStmt test to calm non-x86 buildbots
Aleksei Sidorin [Wed, 28 Sep 2016 11:04:42 +0000 (11:04 +0000)]
ASTMerge: explicitly specify arch for GCCAsmStmt test to calm non-x86 buildbots

This should fix r282572.

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

7 years agoMerge conflicting replacements when they are order-independent.
Eric Liu [Wed, 28 Sep 2016 11:02:16 +0000 (11:02 +0000)]
Merge conflicting replacements when they are order-independent.

Summary:
Now two replacements are considered order-independent if applying them in
either order produces the same result. These include (but not restricted
to) replacements that:
  - don't overlap (being directly adjacent is fine) and
  - are overlapping deletions.
  - are insertions at the same offset and applying them in either order
    has the same effect, i.e. X + Y = Y + X if one inserts text X and the
    other inserts text Y.

Discussion about this design can be found in D24717

Reviewers: djasper, klimek

Subscribers: omtcyfz, cfe-commits

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

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

7 years agoASTMerge: specify arch for GCCAsmStmt test explicitly to calm non-x86 buildbots
Aleksei Sidorin [Wed, 28 Sep 2016 10:57:36 +0000 (10:57 +0000)]
ASTMerge: specify arch for GCCAsmStmt test explicitly to calm non-x86 buildbots

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

7 years ago[StaticAnalyzer] Fix false positives for vardecls that are technically unreachable...
Daniel Marjamaki [Wed, 28 Sep 2016 10:39:53 +0000 (10:39 +0000)]
[StaticAnalyzer] Fix false positives for vardecls that are technically unreachable but they are needed.

Example:

    switch (x) {
      int a;  // <- This is unreachable but needed
    case 1:
      a = ...

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

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

7 years agoFix warnings in clang-completion-mode.el.
Manuel Klimek [Wed, 28 Sep 2016 10:20:10 +0000 (10:20 +0000)]
Fix warnings in clang-completion-mode.el.

- Use defvar to declare variables
- Don't use delete-backward-char, which is for interactive use only

Patch by Philipp Stephani

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

7 years ago[ASTImporter] Implement some expression-related AST node import (part 2)
Aleksei Sidorin [Wed, 28 Sep 2016 10:16:56 +0000 (10:16 +0000)]
[ASTImporter] Implement some expression-related AST node import (part 2)

* Some code cleanup
* Add tests not present in http://reviews.llvm.org/D14286
* Integrate a test suite from Serge Pavlov (http://reviews.llvm.org/D14224)
* ArrayTypeTraitExpr: serialize sub-expression to avoid keeping it undefined
* Implement import of some nodes:
  - ArrayTypeTraitExpr
  - ExpressionTraitExpr
  - OpaqueValueExpr
  - ArraySubscriptExpr
  - ExplicitCastExpr
  - ImplicitValueInitExpr
  - OffsetOfExpr
  - CXXThisExpr
  - CXXThrowExpr
  - CXXNoexceptExpr
  - CXXDefaultArgExpr
  - CXXScalarValueInitExpr
  - CXXBindTemporaryExpr
  - CXXTemporaryObjectExpr
  - MaterializeTemporaryExpr
  - ExprWithCleanups

  - StaticAssertDecl
  - FriendDecl

  - DecayedType

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

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

7 years ago[Headers] Replace stray indentation with tabs with spaces. NFC.
Martin Storsjo [Wed, 28 Sep 2016 09:34:51 +0000 (09:34 +0000)]
[Headers] Replace stray indentation with tabs with spaces. NFC.

This matches the rest of the surrounding file.

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

7 years agoRevert r282556. This change made several bots unhappy.
Richard Smith [Wed, 28 Sep 2016 02:20:06 +0000 (02:20 +0000)]
Revert r282556. This change made several bots unhappy.

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

7 years agoPut new warning in a diagnostic group.
Matthias Braun [Tue, 27 Sep 2016 23:44:38 +0000 (23:44 +0000)]
Put new warning in a diagnostic group.

The warning I added in r282426 should be a diagnostic group.

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

7 years agoP0145R3 (C++17 evaluation order tweaks): evaluate the right-hand side of
Richard Smith [Tue, 27 Sep 2016 23:44:22 +0000 (23:44 +0000)]
P0145R3 (C++17 evaluation order tweaks): evaluate the right-hand side of
assignment and compound-assignment operators before the left-hand side. (Even
if it's an overloaded operator.)

This completes the implementation of P0145R3 + P0400R0 for all targets except
Windows, where the evaluation order guarantees for <<, >>, and ->* are
unimplementable as the ABI requires the function arguments are evaluated from
right to left (because parameter destructors are run from left to right in the
callee).

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

7 years agoRevert r282547 and add test to show correct behavior.
Richard Trieu [Tue, 27 Sep 2016 23:44:07 +0000 (23:44 +0000)]
Revert r282547 and add test to show correct behavior.

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

7 years ago[Coverage] The coverage region for switch covers the code after the switch.
Alex Lorenz [Tue, 27 Sep 2016 23:30:36 +0000 (23:30 +0000)]
[Coverage] The coverage region for switch covers the code after the switch.

This patch fixes a regression introduced in r262697 that changed the way the
coverage regions for switches are constructed. The PGO instrumentation counter
for a switch statement refers to the counter at the exit of the switch.
Therefore, the coverage region for the switch statement should cover the code
that comes after the switch, and not the switch statement itself.

rdar://28480997

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

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

7 years agoFix defaulted member functions for templated classes.
Richard Trieu [Tue, 27 Sep 2016 22:28:59 +0000 (22:28 +0000)]
Fix defaulted member functions for templated classes.

In some cases, non-special member functions were being marked as being defaulted
in templated classes.  This can cause interactions with later code that expects
the default function to be one of the specific member functions.  Fix the check
so that templated class members are checked the same way as non-templated class
members are.

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

7 years agoShorten DiagnosticInfoOptimizationRemark* to OptimizationRemark*. NFC
Adam Nemet [Tue, 27 Sep 2016 22:19:29 +0000 (22:19 +0000)]
Shorten DiagnosticInfoOptimizationRemark* to OptimizationRemark*. NFC

With the new streaming interface in LLVM, these class names need to be
typed a lot and it's way too looong.

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

7 years agoAdapt to LLVM optimization remark interface change. NFC
Adam Nemet [Tue, 27 Sep 2016 20:55:12 +0000 (20:55 +0000)]
Adapt to LLVM optimization remark interface change. NFC

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

7 years agoAdapt to LLVM EnableStatistics() change.
Matthias Braun [Tue, 27 Sep 2016 19:38:59 +0000 (19:38 +0000)]
Adapt to LLVM EnableStatistics() change.

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

7 years agoRevert "Adapt to LLVM optimization remark interface change. NFC"
Adam Nemet [Tue, 27 Sep 2016 16:39:27 +0000 (16:39 +0000)]
Revert "Adapt to LLVM optimization remark interface change. NFC"

This reverts commit r282500.

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

7 years agoAdapt to LLVM optimization remark interface change. NFC
Adam Nemet [Tue, 27 Sep 2016 16:15:21 +0000 (16:15 +0000)]
Adapt to LLVM optimization remark interface change. NFC

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

7 years agoUpdate to commit r282488, fix the buildboot failure.
Ayman Musa [Tue, 27 Sep 2016 15:37:31 +0000 (15:37 +0000)]
Update to commit r282488, fix the buildboot failure.

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

7 years ago[avx512] Add aliases to some missing avx512 intrinsics.
Ayman Musa [Tue, 27 Sep 2016 14:06:32 +0000 (14:06 +0000)]
[avx512] Add aliases to some missing avx512 intrinsics.

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

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

7 years agoSilencing a Sphinx diagnostic with options, again.
Aaron Ballman [Tue, 27 Sep 2016 12:17:05 +0000 (12:17 +0000)]
Silencing a Sphinx diagnostic with options, again.

Warning, treated as error:
/opt/llvm/build.attributes.src/tools/clang/docs/CommandGuide/clang.rst:413: WARNING: unknown option: -save-stats=cwd

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

7 years ago[Power9] Builtins for ELF v.2 ABI conformance - front end portion
Nemanja Ivanovic [Tue, 27 Sep 2016 10:45:22 +0000 (10:45 +0000)]
[Power9] Builtins for ELF v.2 ABI conformance - front end portion

This patch corresponds to review:
https://reviews.llvm.org/D24397

It adds the __POWER9_VECTOR__ macro and the -mpower9-vector option along with
a number of altivec.h functions (refer to the code review for a list).

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

7 years ago[ASTMatcher] Clarify isStaticStorageClass and hasStaticStorageDuration documents.
Haojian Wu [Tue, 27 Sep 2016 07:53:20 +0000 (07:53 +0000)]
[ASTMatcher] Clarify isStaticStorageClass and hasStaticStorageDuration documents.

Reviewers: aaron.ballman

Subscribers: klimek, cfe-commits

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

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

7 years agoRemove default argument from lambda to appease old MSVC.
Richard Smith [Tue, 27 Sep 2016 00:53:24 +0000 (00:53 +0000)]
Remove default argument from lambda to appease old MSVC.

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

7 years agoDefend test against differences between 32-bit and 64-bit MSABI manglings.
Richard Smith [Tue, 27 Sep 2016 00:52:29 +0000 (00:52 +0000)]
Defend test against differences between 32-bit and 64-bit MSABI manglings.

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

7 years agoP0145R3 (C++17 evaluation order tweaks): evaluate the base expression before
Richard Smith [Mon, 26 Sep 2016 23:56:57 +0000 (23:56 +0000)]
P0145R3 (C++17 evaluation order tweaks): evaluate the base expression before
the pointer-to-member expression in calls through .* and ->* expressions.

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

7 years agoP0145R3 (C++17 evaluation order tweaks): consistently emit the LHS of array
Richard Smith [Mon, 26 Sep 2016 23:49:47 +0000 (23:49 +0000)]
P0145R3 (C++17 evaluation order tweaks): consistently emit the LHS of array
subscripting before the RHS, regardless of which is the base and which is the
index.

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

7 years ago[clang-format] Don't allow newline after uppercase Obj-C block return types
Daniel Jasper [Mon, 26 Sep 2016 22:19:08 +0000 (22:19 +0000)]
[clang-format] Don't allow newline after uppercase Obj-C block return types

Fixes the following:
  BOOL (^aaa)(void) = ^BOOL {
  };

The first BOOL's token was getting set to TT_FunctionAnnotationRParen
incorrectly, which was causing an unexpected newline after (^aaa). This
was introduced in r245846.

Patch by Kent Sutherland, thank you!

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

7 years agoheaders: add missing Windows ARM Interlocked intrinsics
Saleem Abdulrasool [Mon, 26 Sep 2016 22:12:43 +0000 (22:12 +0000)]
headers: add missing Windows ARM Interlocked intrinsics

On ARM, there are multiple versions of each of the intrinsics, with
acquire/relaxed/release barrier semantics.

The newly added ones are provided as inline functions here instead of builtins,
since they should only be available on certain archs (arm/aarch64).

This is necessary in order to compile C++ code for ARM in MSVC mode.

Patch by Martin Storsjö!

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

7 years ago[Modules TS] Diagnose 'export' declaration within 'export' declaration.
Richard Smith [Mon, 26 Sep 2016 21:27:23 +0000 (21:27 +0000)]
[Modules TS] Diagnose 'export' declaration within 'export' declaration.

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

7 years agoFix test on windows
Matthias Braun [Mon, 26 Sep 2016 20:48:34 +0000 (20:48 +0000)]
Fix test on windows

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

7 years agoCC1: Add -save-stats option
Matthias Braun [Mon, 26 Sep 2016 18:53:34 +0000 (18:53 +0000)]
CC1: Add -save-stats option

This option behaves in a similar spirit as -save-temps and writes
internal llvm statistics in json format to a file.

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

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

7 years agoComplete support for the cxxCtorInitializer() AST matcher so that it can be used...
Aaron Ballman [Mon, 26 Sep 2016 17:04:27 +0000 (17:04 +0000)]
Complete support for the cxxCtorInitializer() AST matcher so that it can be used as a top-level matcher.

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

7 years ago[ASTMatcher] Add isStaticStorageClass matcher for varDecl and functionDecl.
Haojian Wu [Mon, 26 Sep 2016 16:01:52 +0000 (16:01 +0000)]
[ASTMatcher] Add isStaticStorageClass matcher for varDecl and functionDecl.

Reviewers: klimek

Subscribers: cfe-commits, klimek

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

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

7 years ago[analyzer] Improve CastToStruct checker so it can also detect widening casts of struc...
Daniel Marjamaki [Mon, 26 Sep 2016 15:17:18 +0000 (15:17 +0000)]
[analyzer] Improve CastToStruct checker so it can also detect widening casts of struct data

Example:

struct AB {
  int A;
  int B;
};

struct ABC {
  int A;
  int B;
  int C;
};

void f() {
  struct AB Data;
  struct ABC *P = (struct ABC *)&Data;
}

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

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

7 years agoclang-format: Only special-case top-level */& in multivar-declstmts.
Daniel Jasper [Mon, 26 Sep 2016 15:14:24 +0000 (15:14 +0000)]
clang-format: Only special-case top-level */& in multivar-declstmts.

Before (even with PointerAlignment: Left):
  vector<int *> a, b;

After:
  vector<int*> a, b;

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

7 years agoIn the get started page, also explain how to start the testsuite
Sylvestre Ledru [Mon, 26 Sep 2016 13:22:34 +0000 (13:22 +0000)]
In the get started page, also explain how to start the testsuite

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

7 years agoupdate the link to the code coverage
Sylvestre Ledru [Mon, 26 Sep 2016 12:53:53 +0000 (12:53 +0000)]
update the link to the code coverage

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

7 years agoDriver: avoid failing in the backend
Saleem Abdulrasool [Mon, 26 Sep 2016 04:48:22 +0000 (04:48 +0000)]
Driver: avoid failing in the backend

Avoid failing in the backend when the rewrite map does not exist.  Rather check
that the map exists in the frontend before handing it off to the backend.  Add
the missing rewrite maps that the tests were referencing.

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

7 years ago[AMDGPU] Expose flat work group size, register and wave control attributes
Konstantin Zhuravlyov [Mon, 26 Sep 2016 01:02:57 +0000 (01:02 +0000)]
[AMDGPU] Expose flat work group size, register and wave control attributes

__attribute__((amdgpu_flat_work_group_size(<min>, <max>))) - request minimum and maximum flat work group size
__attribute__((amdgpu_waves_per_eu(<min>[, <max>]))) - request minimum and/or maximum waves per execution unit

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

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

7 years agoRemove excessive padding from RedeclarableResult
Alexander Shaposhnikov [Sat, 24 Sep 2016 04:21:53 +0000 (04:21 +0000)]
Remove excessive padding from RedeclarableResult

This diff reorders the fields of the class RedeclarableResult
to remove excessive padding.

Test plan: make -j8 check-clang

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

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

7 years agoRemove excessive padding from ObjCCategoriesVisitor
Alexander Shaposhnikov [Sat, 24 Sep 2016 02:07:19 +0000 (02:07 +0000)]
Remove excessive padding from ObjCCategoriesVisitor

This diff reorders the fields of ObjCCategoriesVisitor
to remove excessive padding.

Test plan: make -j8 check-clang

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

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

7 years ago[analyzer][scan-build-py] subprocess output handling reviewed in clang module
Laszlo Nagy [Sat, 24 Sep 2016 00:20:59 +0000 (00:20 +0000)]
[analyzer][scan-build-py] subprocess output handling reviewed in clang module

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

7 years agoUse llvm::to_string instead of std::to_string to fix bot
Teresa Johnson [Fri, 23 Sep 2016 22:25:03 +0000 (22:25 +0000)]
Use llvm::to_string instead of std::to_string to fix bot

This should fix the android build in this bot:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/11143

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

7 years agoUpdate clang for r282299.
Peter Collingbourne [Fri, 23 Sep 2016 21:43:51 +0000 (21:43 +0000)]
Update clang for r282299.

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

7 years ago[analyzer] Fix crash in RetainCountChecker::checkEndFunction
Alexander Shaposhnikov [Fri, 23 Sep 2016 20:49:01 +0000 (20:49 +0000)]
[analyzer] Fix crash in RetainCountChecker::checkEndFunction

The class BodyFarm creates bodies for
OSAtomicCompareAndSwap*, objc_atomicCompareAndSwap*, dispatch_sync*, dispatch_once*
and for them the flag isBodyAutosynthesized is set to true.

This diff
1. makes AnalysisConsumer::HandleCode skip the autosynthesized code
2. replaces assert(LCtx->getParent()) in RetainCountChecker::checkEndFunction
by assert(!LCtx->inTopFrame()) (minor cleanup)

Test plan: make -j8 check-clang-analysis

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

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

7 years ago[LTO] Add -flto-jobs=N to control backend parallelism
Teresa Johnson [Fri, 23 Sep 2016 20:38:09 +0000 (20:38 +0000)]
[LTO] Add -flto-jobs=N to control backend parallelism

Summary:
Currently, a linker option must be used to control the backend
parallelism of ThinLTO. The linker option varies depending on the
linker (e.g. gold vs ld64). Add a new clang option -flto-jobs=N
to control this.

I've added in the wiring to pass this to the gold plugin. I also
added in the logic to pass this down in the form I understand that
ld64 uses on MacOS, for the darwin target.

Reviewers: mehdi_amini, dexonsmith

Subscribers: mehdi_amini, cfe-commits

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

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

7 years agoRevert "set the underlying value of “#pragma STDC FP_CONTRACT” on by default"
Renato Golin [Fri, 23 Sep 2016 20:32:52 +0000 (20:32 +0000)]
Revert "set the underlying value of “#pragma STDC FP_CONTRACT” on by default"

This reverts commit r282259, as it broke the AArch64 test-suite bots.

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

7 years agoset the underlying value of “#pragma STDC FP_CONTRACT” on by default
Sebastian Pop [Fri, 23 Sep 2016 16:16:25 +0000 (16:16 +0000)]
set the underlying value of “#pragma STDC FP_CONTRACT” on by default

Clang has the default FP contraction setting of “-ffp-contract=on”, which
doesn't really mean “on” in the conventional sense of the word, but rather
really means “according to the per-statement effective value of the relevant
pragma”.

Before this patch, Clang has that pragma defaulting to “off”. Since the
“-ffp-contract=on” mode is really an AND of two booleans and the second of them
defaults to “off”, the whole thing effectively defaults to “off”. This patch
changes the default value of the pragma to “on”, thus making the default pair of
booleans (on, on) rather than (on, off). This makes FP optimization slightly
more aggressive than before when not using either “-Ofast”, “-ffast-math”, or
“-ffp-contract=fast”. Even with this patch the compiler still respects
“-ffp-contract=off”.

As per a suggestion by Steve Canon, the added code does _not_ require “-O3” or
higher. This is so as to try our best to preserve identical floating-point
results for unchanged source code compiling for an unchanged target when only
changing from any optimization level in the set (“-O0”, “-O1”, “-O2”, “-O3”) to
any other optimization level in that set. “-Os” and “-Oz” seem to be behaving
identically, i.e. should probably be considered a part of the aforementioned
set, but I have not reviewed this rigorously. “-Ofast” is explicitly _not_ a
member of that set.

Patch authored by Abe Skolnik [a.skolnik@samsung.com] and Stephen Canon [scanon@apple.com].

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

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

7 years agoRevert of r282255 because of "Fell off the end of a string-switch" buildbot
Sjoerd Meijer [Fri, 23 Sep 2016 15:37:17 +0000 (15:37 +0000)]
Revert of r282255 because of "Fell off the end of a string-switch" buildbot
failures.

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

7 years agoFix for r280064 that added options for fp denormals and exceptions.
Sjoerd Meijer [Fri, 23 Sep 2016 15:21:33 +0000 (15:21 +0000)]
Fix for r280064 that added options for fp denormals and exceptions.
These options were forgotten to be copied in setCommandLineOpts.

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

7 years ago[clang-format] support header deletion in cleanupAroundReplacemnts.
Eric Liu [Fri, 23 Sep 2016 15:10:56 +0000 (15:10 +0000)]
[clang-format] support header deletion in cleanupAroundReplacemnts.

Summary:
- If a replacement has offset UINT_MAX, length 0, and a replacement text
  that is an #include directive, this will insert the #include into the
  correct block in the \p Code.
- If a replacement has offset UINT_MAX, length 1, and a replacement text
  that is the name of the header to be removed, the header will be removed
  from \p Code if it exists.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[OpenCL] Augment pipe built-ins with pipe packet size and alignment.
Alexey Bader [Fri, 23 Sep 2016 14:20:00 +0000 (14:20 +0000)]
[OpenCL] Augment pipe built-ins with pipe packet size and alignment.

Reviewers: Anastasia, vpykhtin

Subscribers: dmitry, cfe-commits

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

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

7 years ago[asan] Fix incorrect SEH symbol mangling on win64.
Etienne Bergeron [Fri, 23 Sep 2016 14:07:47 +0000 (14:07 +0000)]
[asan] Fix incorrect SEH symbol mangling on win64.

Summary:
The ASAN unittests are failing (check-asan-dynamic) due to an incorrect symbol name:
```
LINK : error LNK2001: unresolved external symbol ___asan_seh_interceptor
```

On win64, the linker is not adding an extra underscore. This was correctly fixed in the same file for other uses.

After that patch, most of the unittests are passing, but some related to SEH needs to be fixed.
```
Failing Tests (4):
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memchr.cc
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memcpy_indirect.cc
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_seh.cc
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/seh.cc

  Expected Passes    : 339
  Passes With Retry  : 3
  Expected Failures  : 16
  Unsupported Tests  : 152
  Unexpected Failures: 4
```

Reviewers: rnk, kcc, majnemer

Subscribers: majnemer, chrisha, cfe-commits

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

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

7 years agoMinor tweak. Avoid hardcoding.
Daniel Marjamaki [Fri, 23 Sep 2016 12:23:44 +0000 (12:23 +0000)]
Minor tweak. Avoid hardcoding.

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

7 years agoFix indentation
Daniel Marjamaki [Fri, 23 Sep 2016 08:27:24 +0000 (08:27 +0000)]
Fix indentation

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

7 years ago[AVX-512] Add initial support for checking rounding mode arguments of builtins.
Craig Topper [Fri, 23 Sep 2016 04:48:31 +0000 (04:48 +0000)]
[AVX-512] Add initial support for checking rounding mode arguments of builtins.

The backend can't encode all possible values of the argument and will fail isel. Checking in the frontend presents a friendlier experience to the user.

I started with builtins that can only take _MM_CUR_DIRECTION or _MM_NO_EXC. More builtins coming in the future.

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

7 years ago[X86] Split up the single switch statement in Sema::CheckX86BuiltinFunctionCall into...
Craig Topper [Fri, 23 Sep 2016 04:48:27 +0000 (04:48 +0000)]
[X86] Split up the single switch statement in Sema::CheckX86BuiltinFunctionCall into different switches or ifs for each type of check.

This in preparation for a new check that will check some of the builtins that already had the immediate range check.

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

7 years ago[OpenBSD] Add type sign information for OpenBSD
Renato Golin [Thu, 22 Sep 2016 19:28:20 +0000 (19:28 +0000)]
[OpenBSD] Add type sign information for OpenBSD

Like NetBSD, OpenBSD prefers having a consistent set of typedefs
across the architectures it supports over strictly following the ARM
ABIs.  The diff below makes sure that clang's view of those types
matches OpenBSD's system header files.  It also adds a test that
checks the relevant types on all OpenBSD platforms that clang works
on.  Hopefully we can add mips64 and powerpc to that list in the
future.

Patch by Mark Kettenis <mark.kettenis@xs4all.nl>

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

7 years ago[docs] Touch up the coverage docs some more
Vedant Kumar [Thu, 22 Sep 2016 15:34:33 +0000 (15:34 +0000)]
[docs] Touch up the coverage docs some more

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

7 years agoFix Wbitfield-constant-conversion false positives
Daniel Marjamaki [Thu, 22 Sep 2016 14:13:46 +0000 (14:13 +0000)]
Fix Wbitfield-constant-conversion false positives

Summary:
The diagnostic did not handle ~ well. An expression such as ~0 is often used when 'all ones' is needed.

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

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

7 years agoThird attempt to fix Sphinx bot
Teresa Johnson [Thu, 22 Sep 2016 13:58:33 +0000 (13:58 +0000)]
Third attempt to fix Sphinx bot

Bot now complaining about -flto=thin reference, used similar workaround
for that failure.

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

7 years agoSecond attempt to fix Sphinx bot
Teresa Johnson [Thu, 22 Sep 2016 13:41:10 +0000 (13:41 +0000)]
Second attempt to fix Sphinx bot

The fix in r282148 was not enough to fix the following error:
/home/llvmbb/llvm-build-dir/clang-sphinx-docs/llvm/src/tools/clang/docs/CommandGuide/clang.rst:338:
WARNING: unknown option: -flto=full

on the sphinx bot:
  http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/16313

(not reproducible locally).

This time, simply remove the option reference.

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

7 years agoFixing sphinx build due to diagnostic:
Aaron Ballman [Thu, 22 Sep 2016 12:15:18 +0000 (12:15 +0000)]
Fixing sphinx build due to diagnostic:

/opt/llvm/build.attributes.src/tools/clang/docs/CommandGuide/clang.rst:338: WARNING: unknown option: -flto=full

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

7 years agoclang-format: [JS] reserved words in method names.
Martin Probst [Thu, 22 Sep 2016 07:18:00 +0000 (07:18 +0000)]
clang-format: [JS] reserved words in method names.

Summary:
Before:
    class X {
      delete () {
        ...
      }
    }

After:
    class X {
      delete() {
        ...
      }
    }

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[X86] Fix some illegal rounding modes in some builtin test cases to ones that would...
Craig Topper [Thu, 22 Sep 2016 06:13:33 +0000 (06:13 +0000)]
[X86] Fix some illegal rounding modes in some builtin test cases to ones that would properly compile to valid assembly.

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

7 years agoclang-format: Add an option to git-clang-format to diff between to commits
Stephen Hines [Thu, 22 Sep 2016 05:52:55 +0000 (05:52 +0000)]
clang-format: Add an option to git-clang-format to diff between to commits

Summary:
When building pre-upload hooks using git-clang-format, it is useful to limit the scope to a diff of two commits (instead of from a commit against the working tree) to allow for less false positives in dependent commits.

This change adds the option of specifying two git commits to git-clang-format when using the `--diff` flag, which uses a different strategy to diff (using `git-diff-tree` instead of `git-diff-index`), and runs clang-format against the second commit instead of the working directory.

There is a slight backwards-incompatibility introduced with this change: if a filename matches a branch name or other commit-ish, then `git clang-format <commit> <file>` will no longer work as expected; use `git clang-format <commit> -- <file>` instead.

Patch by Luis Hector Chavez!

Reviewers: djasper, lodato

Subscribers: lodato, cfe-commits, srhines

Projects: #clang-c

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

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

7 years ago[CMake] More robust handling for bootstrap variables
Chris Bieneman [Thu, 22 Sep 2016 00:18:12 +0000 (00:18 +0000)]
[CMake] More robust handling for bootstrap variables

Checking defined isn't good enough we also need to handle defined to empty string.

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

7 years ago[Sema] Fix PR30481: crash on checking printf args.
George Burgess IV [Thu, 22 Sep 2016 00:00:26 +0000 (00:00 +0000)]
[Sema] Fix PR30481: crash on checking printf args.

We were falling through from one case to another in a switch statement.
Oops.

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

7 years ago[CMake] Check if passthrough variables are defined
Chris Bieneman [Wed, 21 Sep 2016 23:24:15 +0000 (23:24 +0000)]
[CMake] Check if passthrough variables are defined

Checking if they evaluate to true cases prevents passing values that evaluate to false cases. Instead we should check if the variables are defined.

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

7 years ago[CMake] Pass CLANG_VERSION_* variables into later stages
Chris Bieneman [Wed, 21 Sep 2016 20:43:43 +0000 (20:43 +0000)]
[CMake] Pass CLANG_VERSION_* variables into later stages

When supporting overriding clang versions we also need to pass those through to the next stage so they remain overridden.

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

7 years agoAdd -Wignored-pragma-intrinsic flag
Albert Gutowski [Wed, 21 Sep 2016 20:19:21 +0000 (20:19 +0000)]
Add -Wignored-pragma-intrinsic flag

Summary: People might want to receive warnings about pragmas but not about intrinsics that are implemented in intrin.h.

Reviewers: thakis, hans

Subscribers: cfe-commits

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

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

7 years ago[docs] Add ThinLTO user documentation
Teresa Johnson [Wed, 21 Sep 2016 16:57:03 +0000 (16:57 +0000)]
[docs] Add ThinLTO user documentation

Summary: Add some user facing documentation on ThinLTO and how to use it.

Reviewers: mehdi_amini

Subscribers: mehdi_amini, cfe-commits

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

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

7 years ago[AVX512] Fix return types on __builtin_ia32_gather3XivXdi builtins
Cameron McInally [Wed, 21 Sep 2016 16:07:40 +0000 (16:07 +0000)]
[AVX512] Fix return types on __builtin_ia32_gather3XivXdi builtins

The return types on the AVX512 __builtin_ia32_gather3XivXdi builtins are incorrect. The return type should match the type of the pass through vector.

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

-This line, and those below, will be ignored--

M    include/clang/Basic/BuiltinsX86.def

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

7 years agoPR30401: Fix substitutions for functions with abi_tag
Dmitry Polukhin [Wed, 21 Sep 2016 08:27:03 +0000 (08:27 +0000)]
PR30401: Fix substitutions for functions with abi_tag

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

7 years agoclang-format: [JS] do not wrapp @returns tags.
Martin Probst [Wed, 21 Sep 2016 06:56:38 +0000 (06:56 +0000)]
clang-format: [JS] do not wrapp @returns tags.

Summary: @returns is incorrect code, the standard is @return. However wrapping it can still confuse users.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[analyzer] Add a checker that detects blocks in critical sections
Anna Zaks [Tue, 20 Sep 2016 20:28:50 +0000 (20:28 +0000)]
[analyzer] Add a checker that detects blocks in critical sections

This checker should find the calls to blocking functions (for example: sleep, getc, fgets,read,recv etc.) inside a critical section. When sleep(x) is called while a mutex is held, other threads cannot lock the same mutex. This might take some time, leading to bad performance or even deadlock.

Example:

mutex_t m;

void f() {
  sleep(1000); // Error: sleep() while m is locked! [f() is called from foobar() while m is locked]
  // do some work
}

void foobar() {
  lock(m);
  f();
  unlock(m);
}

A patch by zdtorok (Zoltán Dániel Török)!

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

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

7 years agoRemove some boilerplate comments that don't explain anything.
Eric Christopher [Tue, 20 Sep 2016 19:45:06 +0000 (19:45 +0000)]
Remove some boilerplate comments that don't explain anything.

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