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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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