Commit Graph

69748 Commits

Author SHA1 Message Date
Masud Rahman 3bddc261dd Test commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316263 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-21 16:03:17 +00:00
Sanjay Patel 0e806a85e1 [CodeGen] add tests for __builtin_sqrt*; NFC
I don't know if this is correct, but this is what we currently do.
More discussion in PR27108 and PR27435 and D27618.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316250 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 23:32:41 +00:00
George Karpenkov 4290aec8a4 [Analyzer] Correctly handle parameters passed by reference when bodyfarming std::call_once
Explicitly not supporting functor objects.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316249 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 23:29:59 +00:00
Richard Smith 7c9e1b206c Implement current CWG direction for support of arrays of unknown bounds in
constant expressions.

We permit array-to-pointer decay on such arrays, but disallow pointer
arithmetic (since we do not know whether it will have defined behavior).

This is based on r311970 and r301822 (the former by me and the latter by Robert
Haberlach). Between then and now, two things have changed: we have committee
feedback indicating that this is indeed the right direction, and the code
broken by this change has been fixed.

This is necessary in C++17 to continue accepting certain forms of non-type
template argument involving arrays of unknown bound.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316245 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 22:56:25 +00:00
Jonas Hahnfeld d194f2aeb2 Revert "[OpenMP] Avoid VLAs for some reductions on array sections"
This breaks at least two buildbots:
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/1175
http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/10478

This reverts commit r316229 during local investigation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316235 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 20:16:17 +00:00
Jonas Hahnfeld f20a280b3b [OpenMP] Avoid VLAs for some reductions on array sections
In some cases the compiler can deduce the length of an array section
as constants. With this information, VLAs can be avoided in place of
a constant sized array or even a scalar value if the length is 1.
Example:
int a[4], b[2];
pragma omp parallel reduction(+: a[1:2], b[1:1])
{ }

For chained array sections, this optimization is restricted to cases
where all array sections except the last have a constant length 1.
This trivially guarantees that there are no holes in the memory region
that needs to be privatized.
Example:
int c[3][4];
pragma omp parallel reduction(+: c[1:1][1:2])
{ }

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316229 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 19:40:40 +00:00
Erich Keane 44c160f916 Allow /showIncludes with /P
r213589 was checked in as a solution to
https://bugs.llvm.org/show_bug.cgi?id=20336.

However, it is possible to use /EP with /P
to suppress #line directives AND output to
a file. There is no reason in that case to
suppress /showIncludes.

This was reported here:
https://bugs.llvm.org/show_bug.cgi?id=34997

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 19:18:30 +00:00
Haojian Wu d6aede0fad [clang-refactor] Add "-Inplace" option to the commandline tool.
Summary:
Change clang-refactor default behavior to print the new code after refactoring
(instead of editing the source files), which would make it easier to use
and debug the refactoring action.

Reviewers: arphaman, ioeric

Reviewed By: arphaman

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316212 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 12:37:16 +00:00
Ivan A. Kosarev a312801e78 [CodeGen] Fix generation of TBAA info for array-to-pointer conversions
Resolves:
Fatal error: Offset not zero at the point of scalar access.
http://llvm.org/PR34992

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316211 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 12:35:17 +00:00
Saleem Abdulrasool f4502ab59c Basic: restore {,u}intptr_t on NetBSD/ARM
NetBSD uses `long int` for `intptr_t` on ARM.  This was changed in SVN
r316046, referenced against other compilers.  However, NetBSD's
reference was incorrect as the current clang behaviour is more
up-to-date.  Restore the original behaviour for that target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316204 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 04:11:28 +00:00
Richard Smith 53df1a5045 Revert r316193.
This patch breaks users using -fno-canonical-prefixes, for whom resolving
symlinks is not acceptable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-20 00:25:07 +00:00
Peter Wu cc28d36809 Try to shorten system header paths when using -MD depfiles
GCC tries to shorten system headers in depfiles using its real path
(resolving components like ".." and following symlinks). Mimic this
feature to ensure that the Ninja build tool detects the correct
dependencies when a symlink changes directory levels, see
https://github.com/ninja-build/ninja/issues/1330

An option to disable this feature is added in case "these changed header
paths may conflict with some compilation environments", see
https://gcc.gnu.org/ml/gcc-patches/2012-09/msg00287.html

Note that the original feature request for GCC
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52974) also included paths
preprocessed output (-E) and diagnostics. That is not implemented now
since I am not sure if it breaks something else.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316193 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 23:53:27 +00:00
Aaron Ballman 22b25a6d05 These attributes are not supported by GCC and should not be in the gnu namespace. Switching from the GCC spelling to the GNU spelling so that they are only supported with __attribute__(()).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316186 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 21:20:28 +00:00
Aaron Ballman 65f011ebfc These attributes are supported by GCC with the gnu vendor namespace for C++11-style attributes. Enabling the gnu namespace by switching to the GCC spelling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316184 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 21:09:39 +00:00
Jan Vesely 2178f1e610 AMDGPU: Parse r600 CPU name early and expose FMAF capability
Improve amdgcn macro test
Differential Revision: https://reviews.llvm.org/D38667

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 20:40:13 +00:00
Guozhi Wei 65729bee40 [CGExprScalar] Add missing types in function GetIntrinsic
In function GetIntrinsic, not all types are covered. Types double and long long are missed, type long is wrongly treated same as int, it should be same as long long. These problems cause compiler crashes when compiling code in PR31161. This patch fixed the problem.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316179 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 20:11:23 +00:00
Benjamin Kramer 73f05d5776 [Sema] Fix assertion failure when checking for unused variables in a dependent context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 19:07:13 +00:00
Erich Keane 9d5150b14a Fix nodiscard for volatile references
As reported here https://bugs.llvm.org/show_bug.cgi?id=34988
[[nodiscard]] warnings were not being suppressed for
volatile-ref return values.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 15:58:58 +00:00
Yaxun Liu a16acc3f8d [AMDGPU] Fix bug in enqueued block codegen due to an extra line
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 15:56:13 +00:00
Gabor Horvath 3c5f57098d [analyzer] Dump signed integers in SymIntExpr and IntSymExpr correctly
Patch by: Adam Balogh!

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316157 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 11:58:21 +00:00
Haojian Wu 9d48724248 Fix a few nits in RenamingAction.
* Add missing override keyword.
* avoid unnecessary copy of std::string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316152 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 08:20:55 +00:00
Martin Storsjo 3c7f433b74 [Headers] Fix typoed __ARM_DWARF_EH__ ifdefs
These typos appeared in SVN r309226 and r309327.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 07:40:45 +00:00
Richard Smith 7d9b7a95bc Don't suppress instantiation of definitions for variables subject to explicit
instantiation declarations if they are usable from constant expressions.

We are permitted to instantiate in these cases, and required to do so in order
to have an initializer available for use within constant evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 22:45:01 +00:00
Erich Keane b5f76b264e Fix capitalization of parameter
The .cpp file has this properly capitalized, but 
the header does not.  Simply fixed it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 22:17:16 +00:00
Krasimir Georgiev ac9a20e957 [clang-format] Sort whole block of using declarations while partially formatting
Summary:
This patch enables sorting the full block of using declarations when
some line is affected.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316130 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 22:13:25 +00:00
Benjamin Kramer 070fec4a83 [Driver] Fix use after free in Hexagon toolchain code.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316127 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 21:43:42 +00:00
Alex Lorenz 7e9c7d8757 [refactor] Add a doc comment to the test function in the selection
unittest.

As suggested by Haojian Wu!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 18:51:48 +00:00
Alex Lorenz dab11d229e [refactor] selection: new CodeRangeASTSelection represents a set of selected
consecutive statements

This commit adds a CodeRangeASTSelection value to the refactoring library. This
value represents a set of selected statements in one body of code.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316104 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 18:48:58 +00:00
Matt Morehouse 2c6e8f835e [clang-proto-fuzzer] Use ToT protobuf-mutator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316103 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 18:38:04 +00:00
Sumanth Gundapaneni adece34c34 [Hexagon] Handling of new HVX flags and target-features
This patch has the following changes
A new flag "-mhvx-length={64B|128B}" is introduced to specify the length of the vector.
Previously we have used "-mhvx-double" for 128 Bytes. This adds the target-feature "+hvx-length{64|128}b"

The "-mhvx" flag must be provided on command line to enable HVX for Hexagon. If no -mhvx-length flag
is specified, a default length is picked from the arch mentioned in this priority order from either -mhvx=vxx
or -mcpu. For v60 and v62 the default length is 64 Byte. For unknown versions, the length is 128 Byte. The 
-mhvx flag adds the target-feature "+hvxv{hvx_version}"

The 64 Byte mode is soon going to be deprecated. A warning is emitted if 64 Byte is enabled. A warning is
still emitted for the default 64 Byte as well. This warning can be suppressed with a -Wno flag.

The "-mhvx-double" and "-mno-hvx-double" flags are deprecated. A warning is emitted if the driver sees
them on commandline. "-mhvx-double" is an alias to "-mhvx-length=128B"

The compilation will error out if -mhvx-length is specified with out an -mhvx/-mhvx= flag

The macro HVX_LENGTH is defined and is set to the length of the vector. 
Eg: #define HVX_LENGTH 64

The macro HVX_ARCH is defined and is set to the version of the HVX. 
Eg: #define HVX_ARCH 62

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316102 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 18:10:13 +00:00
Aaron Ballman f53794cdab Enable support for the [[maybe_unused]] attribute from WG14 N2053 when enabling double square bracket attributes in C code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316096 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 16:59:27 +00:00
Aaron Ballman 58199aaa59 Silencing a redefinition warning that was not germane to the test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316086 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 14:48:33 +00:00
Aaron Ballman 644b1eb1f2 Enable support for the [[fallthrough]] attribute from WG14 N2052 when enabling double square bracket attributes in C code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 14:33:27 +00:00
Aaron Ballman 1b97bbcc56 Silence -Wimplicit-fallthrough warnings with the generated code; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316075 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 12:11:58 +00:00
Haojian Wu 977de9aa10 [clang-rename] Rename alias.
Summary:
* Support rename alias.
* Add unittests for renaming alias.
* Don't generate fixes for the SourceLocations that are invalid or in temporary
  buffer, otherwise crash would be happened when generating AtomicChanges.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: klimek, mgorny, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316074 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 12:10:11 +00:00
Gabor Horvath aed3a60e36 [ASTImporter] Import SubStmt of CaseStmt
Patch by: Rafael Stahl!

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 09:25:18 +00:00
NAKAMURA Takumi 635ffc9d02 [CMake] Use #cmakedefine01 for CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER)
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/D35541

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316061 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 05:21:17 +00:00
Richard Smith e940f2f16c Provide a flag group to turn on/off all "binary literals" extension warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316056 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 02:19:24 +00:00
Richard Smith 5920af9409 [modules] When finding the owning module of an instantiated context in template
instantiation, follow lexical parents not semantic ones: we want to find the
module where the pattern was written.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316055 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 01:41:38 +00:00
Petr Hosek d5aad901c0 [CMake] Build Fuchsia toolchain as -O3
Differential Revision: https://reviews.llvm.org/D39017

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316053 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 01:27:54 +00:00
Saleem Abdulrasool 09c41bf0d2 Basic: fix __{,U}INTPTR_TYPE__ on ARM
Darwin and OpenBSD are the only platforms which use `long int` for
`__INTPTR_TYPE__`.  The other platforms use `int` in 32-bit, and `long
int` on 64-bit (except for VMS and Windows which are LLP64).  Adjust the
type definitions to match the platform definitions.  We now generate the
same definition as GCC on all the targets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316046 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 00:00:50 +00:00
Zachary Turner 1b1d1233bd Resubmit "[lit] Raise the logic for enabling clang & lld substitutions to llvm."
The substitution for %debuginfo_tests had been inadvertently removed.
This adds it back.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316043 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 23:43:36 +00:00
Saleem Abdulrasool a7e10abc2f Basic: fix `__INTPTR_TYPE__` for Windows ARM
The `IntPtrType` for Windows ARM should be `int` as per MSVC.  Adjust
the type accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316042 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 22:49:53 +00:00
George Karpenkov ac036d4cdb [Analyzer] Always use non-reference types when creating expressions in BodyFarm.
Remove an option to use a reference type (on by default!) since a
non-reference type is always needed for creating expressions, functions
with multiple boolean parameters are very hard to use, and in general it
was just a booby trap for further crashes.
Furthermore, generalize call_once test case to fix some of the crashes mentioned
https://bugs.llvm.org/show_bug.cgi?id=34869
Also removes std::call_once crash.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 22:28:18 +00:00
Nico Weber ab38736dcc Fix PR34981, a crash-on-invalid merging dllimport to an invalid redecl.
This is basically like r288207, just the other way round.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316032 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 21:14:02 +00:00
Erich Keane 2301481f44 [CFG] Relax Wexceptions warning on rethrow
As reported here: https://bugs.llvm.org/show_bug.cgi?id=34973

"catch(...)" should catch EVERYTHING, even a rethrow. This
patch changes the order in which things are checked to ensure
that a '...' catch will get a rethrow.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316030 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 20:57:24 +00:00
Aaron Ballman cca410711f This test case was missing -fsyntax-only, so I've added it. NFC to the actual test contents, just how the test is executed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316028 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 20:49:30 +00:00
Aaron Ballman 6a20f1df93 Enable support for the [[nodiscard]] attribute from WG14 N2050 when enabling double square bracket attributes in C code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316026 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 20:33:35 +00:00
Vassil Vassilev c29141b4ed Expose ConsumeAnyToken interface to external clients.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316022 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 19:38:57 +00:00
Bruno Cardoso Lopes ba32363759 [OpenCL] Restrict swizzle length check to OpenCL mode
Changes behavior introduced in r298369 to only error out on
vector component invalid length access on OpenCL mode.

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

rdar://problem/33568748

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 17:54:57 +00:00