Commit Graph

69536 Commits

Author SHA1 Message Date
Craig Topper d23254a008 [Docs] Regenerate the command line option reference.
llvm-svn: 308641
2017-07-20 17:52:48 +00:00
Alexey Bataev 4d4624c20c [OPENMP] Fix DSA processing for member declaration.
If the member declaration is captured in the OMPCapturedExprDecl, we may
loose data-sharing attribute info for this declaration. Patch fixes this
bug.

llvm-svn: 308629
2017-07-20 16:47:47 +00:00
Simon Dardis 31636a1fd9 Reland "[mips] Teach the driver to accept -m(no-)gpopt."
This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

This version fixes a logic error that generated warnings incorrectly and
gets rid of spurious arguments to the backend when -mgpopt is not used.

llvm-svn: 308619
2017-07-20 14:04:12 +00:00
Benjamin Kramer d515291ffd [vfs] Assert that the status is known in equivalent().
Otherwise we'd silently compare uninitialized data.

llvm-svn: 308604
2017-07-20 11:57:02 +00:00
NAKAMURA Takumi 956d4d2ee6 clang/module.modulemap: Clang_Diagnostics: Activate "Sema/SemaDiagnostic.h".
It seems issues were resolved.

llvm-svn: 308593
2017-07-20 07:51:47 +00:00
Peter Szecsi 58a8b6b4af Revert "[StaticAnalyzer] Completely unrolling specific loops with known bound option"
Revert r308561 and r308558.

Clang-ppc64be-linux seems to crash while running the test cases.

llvm-svn: 308592
2017-07-20 07:35:11 +00:00
NAKAMURA Takumi 8dbf9516e9 clang/module.modulemap: Split out Clang_RewriteFrontend from Clang_Rewrite.
FIXME: Both Rewrite(Core) and RewriteFrontend don't cover just under clang/Rewrite. There's no file, though.
llvm-svn: 308587
2017-07-20 06:08:53 +00:00
Martin Storsjo 1c8af27ae1 [AArch64] Produce correct defaultlib directives for windows in MSVC style
Differential Revision: https://reviews.llvm.org/D35546

llvm-svn: 308584
2017-07-20 05:47:06 +00:00
Faisal Vali f4c4642052 [NFC] Update local variable names to upper-case as per LLVM Coding Standards.
llvm-svn: 308574
2017-07-20 01:10:56 +00:00
Peter Szecsi 251a611cd6 [StaticAnalyzer] Completely unrolling specific loops with known bound option
Missing files added to rL308558.

llvm-svn: 308561
2017-07-20 00:05:25 +00:00
Peter Szecsi cb387b11df This feature allows the analyzer to consider loops to completely unroll. New
requirements/rules (for unrolling) can be added easily via ASTMatchers.

The current implementation is hidden behind a flag.

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.

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

llvm-svn: 308558
2017-07-19 23:50:00 +00:00
Craig Topper 9377b9fa69 [X86] Put avx512vpopcntdq in the right spot in the validateCpuSupports string switch.
The validateCpuSupports switch is in the order of the enum defined in CGBuiltin.cpp and libgcc/compiler-rt.

llvm-svn: 308546
2017-07-19 22:58:58 +00:00
Erich Keane 57e15cd40a Improve SEMA for attribute-target
Add more diagnosis for the non-multiversioning case.

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

llvm-svn: 308539
2017-07-19 22:06:33 +00:00
Erich Keane 2c748cc756 Add isValidCPUName and isValidFeature to TargetInfo
These two functions are really useful for implementations of attributes 
(including attribute-target), so add the functionality.

llvm-svn: 308530
2017-07-19 21:50:08 +00:00
Akira Hatanaka 30629f7dbc Add AlignedAllocation.h.
I forgot to "git add" it in r308496.

llvm-svn: 308498
2017-07-19 17:26:42 +00:00
Akira Hatanaka 3e40c30188 [Sema] Improve diagnostic message for unavailable C++17 aligned
allocation functions.

This changes the error message Sema prints when an unavailable C++17
aligned allocation function is selected.

Original message: "... possibly unavailable on x86_64-apple-macos10.12"
New message: "... only available on macOS 10.13 or newer"

This is a follow-up to r306722.

rdar://problem/32664169

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

llvm-svn: 308496
2017-07-19 17:17:50 +00:00
Hans Wennborg fbb21e0315 Clear release notes for 6.0.0
llvm-svn: 308478
2017-07-19 14:14:07 +00:00
Hans Wennborg 825c37e4fe Bump docs version to 6.0
llvm-svn: 308466
2017-07-19 13:50:27 +00:00
Simon Dardis 4c5fd9cd7f Revert "Reland "[mips] Teach the driver to accept -m(no-)gpopt.""
This reverts r308458. Investigating further buildbot breakage.

llvm-svn: 308459
2017-07-19 13:34:08 +00:00
Simon Dardis badcc7e74b Reland "[mips] Teach the driver to accept -m(no-)gpopt."
This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

This version fixes a logic error that generated warnings incorrectly.

llvm-svn: 308458
2017-07-19 13:12:37 +00:00
Hans Wennborg f365d423a0 Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files"
This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until
it's fixed, especially since this landed just before the 5.0 branch.

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

llvm-svn: 308455
2017-07-19 12:31:01 +00:00
Alex Lorenz 287f684c18 Recommit r308327: Add a warning for missing '#pragma pack (pop)'
and suspicious uses of '#pragma pack' in included files

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

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

rdar://10184173

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

llvm-svn: 308441
2017-07-19 11:30:41 +00:00
Erik Verbruggen 797980e0aa Fix compilation problem introduced in r308433
llvm-svn: 308438
2017-07-19 11:15:36 +00:00
Simon Dardis a923f0e9ce Revert "[mips] Teach the driver to accept -m(no-)gpopt."
Revert r308431 and r308432, these caused broke some buildbots.

llvm-svn: 308436
2017-07-19 11:11:02 +00:00
Erik Verbruggen 11338c598a Add default values for function parameter chunks
Append optional chunks with their default values. For example:
before - "int i", after - "int i = 10"

Patch by Ivan Donchevskii!
    
Differential Revision: https://reviews.llvm.org/D33644

llvm-svn: 308433
2017-07-19 10:45:40 +00:00
Simon Dardis 76ea96bbce [mips] Add warning test for -mgpopt option.
llvm-svn: 308432
2017-07-19 10:39:15 +00:00
Simon Dardis e435e41e01 [mips] Teach the driver to accept -m(no-)gpopt.
This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

llvm-svn: 308431
2017-07-19 10:38:03 +00:00
Hans Wennborg 7f36a9543d Update clang-cl options in the users manual
llvm-svn: 308427
2017-07-19 09:52:24 +00:00
Devin Coughlin bac49e5764 [analyzer] Add annotation attribute to trust retain count implementation
Add support to the retain-count checker for an annotation indicating that a
function's implementation should be trusted by the retain count checker.
Functions with these attributes will not be inlined and the arguments will
be treating as escaping.

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

Patch by Malhar Thakkar!

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

llvm-svn: 308416
2017-07-19 04:10:44 +00:00
Petr Hosek dce1134c33 [CMake] Build runtimes for Fuchsia targets
This relies on the multi-target runtimes build support.

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

llvm-svn: 308412
2017-07-19 02:57:47 +00:00
Petr Hosek 5518d189ee [scan-build-py] Patch to fix "-analyzer-config" option
I noticed that when I use "-analyze-config" option in scan-build-py, it
behaves differently from original perl based scan-build.

For example, command:

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

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

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

Patch by Haowei Wu

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

llvm-svn: 308401
2017-07-19 00:29:41 +00:00
Adrian Prantl 5649b0e8c9 Update for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).
<rdar://problem/33357889>
https://bugs.llvm.org/show_bug.cgi?id=33822

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

llvm-svn: 308399
2017-07-19 00:09:58 +00:00
Adrian Prantl 9a1a1aa2ad Debug Info: Set the MainFileName when generating -gmodules debug info for PCM.
Previously it was uninitialized and thus always defaulted to "<stdin>".
This is mostly a cosmetic change that helps making the debug info more readable.

llvm-svn: 308397
2017-07-18 23:58:34 +00:00
Petr Hosek dcf3d49a8e [Driver] Always use -z rodynamic for Fuchsia
Fuchsia uses read-only .dynamic section.

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

llvm-svn: 308390
2017-07-18 23:23:16 +00:00
Erich Keane b0d4423bff Convert attribute 'target' parsing from a 'pair' to a 'struct' to make further improvements easier
Convert attribute 'target' parsing from a 'pair' to a 'struct' to make further 
improvements easier

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

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

llvm-svn: 308357
2017-07-18 20:41:02 +00:00
Erik Pilkington 9f866a7896 [Sema] NFC: Move all availability checking code to SemaDeclAttr.cpp
Previously, this was awkwardly split up between SemaExpr.cpp.

llvm-svn: 308356
2017-07-18 20:32:07 +00:00
Alexey Bataev 169d96a203 [OPENMP] Initial support for 'task_reduction' clause.
Parsing/sema analysis of the 'task_reduction' clause.

llvm-svn: 308352
2017-07-18 20:17:46 +00:00
Raphael Isemann 028e619be8 Add GCC's noexcept-type alias for c++1z-compat-mangling
Summary: GCC has named this `-Wnoexcept-type`, so let's add an alias to stay compatible with the GCC flags.

Reviewers: rsmith, dexonsmith

Reviewed By: dexonsmith

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

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

llvm-svn: 308340
2017-07-18 18:52:58 +00:00
Raphael Isemann 7d19bd06d1 Don't set TUScope to null when generating a module in incremental processing mode.
Summary: When in incremental processing mode, we should never set `TUScope` to a nullptr otherwise any future lookups fail. We already have similar checks in the rest of the code, but we never hit this one because so far we didn't try to generate a module from the AST that Cling generates.

Reviewers: rsmith, v.g.vassilev

Reviewed By: v.g.vassilev

Subscribers: cfe-commits, v.g.vassilev

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

llvm-svn: 308333
2017-07-18 18:24:42 +00:00
Alex Lorenz aa61922157 Revert r308327
I forgot to test clang-tools-extra which is now failing.

llvm-svn: 308328
2017-07-18 17:36:42 +00:00
Alex Lorenz ad273341a4 Add a warning for missing '#pragma pack (pop)' and suspicious uses
of '#pragma pack' in included files

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

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

rdar://10184173

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

llvm-svn: 308327
2017-07-18 17:23:51 +00:00
Alexey Bataev fad872fc2d [OPENMP] Generalization of sema analysis of reduction-based clauses,
NFC.

llvm-svn: 308317
2017-07-18 15:32:58 +00:00
Yaxun Liu 9d33fb1bc5 CodeGen: Insert addr space cast for automatic/temp var at right position
The uses of alloca may be in different blocks other than the block containing the alloca.
Therefore if the alloca addr space is non-zero and it needs to be casted to default
address space, the cast needs to be inserted in the same BB as the alloca insted of
the current builder insert point since the current insert point may be in a different BB.

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

llvm-svn: 308313
2017-07-18 14:46:03 +00:00
Martin Probst 93008f0154 clang-format: [JS] Correctly format JavaScript imports with long module paths
Currently the `UnwrappedLineParser` fails to correctly unwrap JavaScript
imports where the module path is not on the same line as the `from` keyword.
For example:

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

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

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

Patch originally by Jared Neil - thanks!

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

llvm-svn: 308306
2017-07-18 14:00:19 +00:00
NAKAMURA Takumi 7f633dfe99 [CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into clang/Config/config.h.
LLVM_ENABLE_MODULES is sensitive of -D. Move them into config.h.

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

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

llvm-svn: 308277
2017-07-18 08:55:03 +00:00
Krasimir Georgiev e62dd8b5e9 [Index] Prevent canonical decl becoming nullptr
Summary:
This patch prevents getCanonicalDecl returning nullptr in case it finds
a canonical TemplateDeclaration with no attached TemplatedDecl.
Found by running the indexer over a version of the standard library deep inside
a template metaprogramming mess.

Reviewers: klimek, vsk

Reviewed By: vsk

Subscribers: vsk, arphaman, cfe-commits

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

llvm-svn: 308269
2017-07-18 07:20:53 +00:00
Sylvestre Ledru b78f3b89e1 Also add the option -no-pie (like -nopie)
Summary:
For example, this option is expected by ghc (haskell compiler). Currently, building with ghc will fail with:

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

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


Reviewers: rafael, joerg

Reviewed By: joerg

Subscribers: joerg, cfe-commits

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

llvm-svn: 308268
2017-07-18 06:54:54 +00:00
Egor Churaev 53f9a30543 [OpenCL] Added extended tests on metadata generation for half data type and arrays.
Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: bader, cfe-commits, yaxunl

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

llvm-svn: 308266
2017-07-18 06:04:01 +00:00
Alexey Bataev 6e7f49fc4a [OPENMP] Pacify windows buildbots, NFC.
llvm-svn: 308243
2017-07-18 00:42:35 +00:00
Devin Coughlin 35b59fcaf2 [analyzer] Add missing documentation for static analyzer checkers
Some checks did not have documentation in the www/analyzer/ folder and also
some alpha checks became non-alpha.

Patch by Dominik Szabó!

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

llvm-svn: 308242
2017-07-18 00:34:57 +00:00