Commit Graph

59263 Commits

Author SHA1 Message Date
David Majnemer c28d46ea3c Move EHPersonality to CGCleanup
This makes it possible to use EHPersonality in other parts of CodeGen.

Differential Revision: http://reviews.llvm.org/D11440

llvm-svn: 242971
2015-07-22 23:46:21 +00:00
David Majnemer 51fd8a020b [MS Compat] Allow _Atomic(Type) and 'struct _Atomic' to coexist
MSVC 2013 ships, as part of its STL implementation, a class named
'_Atomic'.  This is unfortunate because this keyword is in conflict with
the C11 keyword with the same name.  Our solution was to disable this
keyword when targeting MSVC 2013 and reenable it for 2015.

However, this makes it impossible for clang's headers to make use of
_Atomic.  This is problematic in the case of libc++ as it makes heavy
use of this keyword.

Let the keywordness of _Atomic float under certain circumstances:
the body of a class named _Atomic, or a class with a base specifier
named _Atomic, will not have the keyword variant of _Atomic for the
duration of the class body.  This is sufficient to allow us to correctly
handle _Atomic in the STL while permitting us to use _Atomic as a
keyword everywhere else.

Differential Revision: http://reviews.llvm.org/D11233

llvm-svn: 242970
2015-07-22 23:46:18 +00:00
Richard Smith 16fe4d178e Fix dumb use-after-free bug introduced in r242868.
llvm-svn: 242960
2015-07-22 22:51:15 +00:00
David Majnemer 6a6589036b [MSVC Compatibility] Use a better predicate for __BOOL_DEFINED
Instead of using CPlusPlus, use Bool.  No functionality change is
intended, it just makes things a tad bit more clear.

llvm-svn: 242957
2015-07-22 22:36:26 +00:00
Hans Wennborg 4afe504980 Fix -Wextra-semi warnings.
Patch by Eugene Zelenko!

Differential Revision: http://reviews.llvm.org/D11401

llvm-svn: 242931
2015-07-22 20:46:26 +00:00
Aaron Ballman 079d3e152d Something was unbalanced, and it wasn't the parentheses. ;-) Reverts r242915.
llvm-svn: 242927
2015-07-22 20:02:00 +00:00
Aaron Ballman cd1646823b Balancing parenthesis in comments and documentation; NFC.
llvm-svn: 242915
2015-07-22 17:51:42 +00:00
Yaron Keren d030d11a24 Add cygwin x86_64 target.
Patch by Martell Malone!

http://reviews.llvm.org/D11349

llvm-svn: 242914
2015-07-22 17:38:19 +00:00
Samuel Antao 5b0688edfd [OpenMP] Make target data directive generate unexpected directive diagnostic.
llvm-svn: 242906
2015-07-22 16:02:46 +00:00
Reid Kleckner 0213a4756e [mingw] Add support for -rtlib option and -stdlib option to the mingw driver
Now clang should be able to use compiler-rt and libc++ on mingw.

Based on a patch by Martell Malone.

Differential Revision: http://reviews.llvm.org/D11237

llvm-svn: 242905
2015-07-22 16:01:38 +00:00
Renato Golin a74bbc7b36 Pass -I options to integrates and external assemblers
Fixes PR21000.

Patch by Artem Belevich.

llvm-svn: 242904
2015-07-22 15:32:36 +00:00
Hubert Tong 27f0697308 [CONCEPTS] Add diagnostics: non-defining function; non-namespace scope
Summary:
Create diagnostic for function concept declaration which is not a
definition.

Create diagnostic for concept declaration which isn't in namespace
scope.

Create associated tests.

Reviewers: rsmith, faisalv, fraggamuffin, hubert.reinterpretcast

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D11027

Patch by Nathan Wilson!

llvm-svn: 242899
2015-07-22 13:32:36 +00:00
NAKAMURA Takumi 7da34f1549 StmtOpenMP.h: Fix a couple of \param(s) in r242785. [-Wdocumentation]
llvm-svn: 242898
2015-07-22 12:38:10 +00:00
Richard Smith 33e0f7ef94 [modules] Stop performing PCM lookups for all identifiers when building with C++ modules. Instead, serialize a list of interesting identifiers and mark those ones out of date on module import. Avoiding the identifier lookups here gives a 20-30% speedup in builds with large numbers of modules. No functionality change intended.
llvm-svn: 242868
2015-07-22 02:08:40 +00:00
Richard Smith a7c535b3c1 [modules] Change module manager visitation order to be a bit more stable when
more modules are added: visit modules depth-first rather than breadth-first.
The visitation is still (approximately) oldest-to-newest, and still guarantees
that a module is visited before anything it imports, so modules that are
imported by others sometimes need to jump to a later position in the visitation
order when more modules are loaded, but independent module trees don't
interfere with each other any more.

llvm-svn: 242863
2015-07-22 01:28:05 +00:00
Davide Italiano f179e36e0e [Sema] Diagnose use of declaration correctly.
Before we skipped that for virtual functions not fully qualified (r81507).
This commit basically reverts this to the older behaviour, which seems
more consistent. We now also correctly consider ill-formed calls to deleted
member functions, which were silently passed before in some cases.
The review contains the whole discussion.

PR:		20268
Differential Revision:	 http://reviews.llvm.org/D11334

llvm-svn: 242857
2015-07-22 00:30:58 +00:00
Richard Smith a534a31c5e [modules] In C++, stop serializing and deserializing a list of declarations in
the identifier table. This is redundant, since the TU-scope lookups are also
serialized as part of the TU DeclContext, and wasteful in a number of ways. We
still emit the decls for PCH / preamble builds, since for those we want
identical results, not merely semantically equivalent ones.

llvm-svn: 242855
2015-07-21 23:54:07 +00:00
Richard Trieu 159e5ed9dc Change a test to follow the formatting of the rest of the tests in the file.
No functional change.

llvm-svn: 242854
2015-07-21 23:38:30 +00:00
Daniel Jasper bcad06640b clang-format: Fix unary operator detection in for loops.
Before:
  for (;; * a = b) {}

After:
  for (;; *a = b) {}

llvm-svn: 242849
2015-07-21 22:51:00 +00:00
Aaron Ballman e4de1a51ec Use range-based for loops; NFC.
llvm-svn: 242846
2015-07-21 22:33:52 +00:00
Tim Northover 525c73ceb7 ARM: actually define __ARM_ARCH_7S__ for the armv7s slice
We ended up with the wrong predefine after the recent TargetParser shuffle, and
I accidentally solidified it with a test. This should fix it.

llvm-svn: 242841
2015-07-21 21:47:33 +00:00
Aaron Ballman 2bf2cadc00 Use a range-based for loop; NFC.
llvm-svn: 242836
2015-07-21 21:18:29 +00:00
Aaron Ballman d4a392c53e Replace some uses of Self.Context with the local variable C; NFC.
llvm-svn: 242835
2015-07-21 21:07:11 +00:00
David Blaikie fd7c2198e4 Fix GCC build due to shadowing
llvm-svn: 242826
2015-07-21 18:59:10 +00:00
David Blaikie f05779e21c Pass an iterator range to EmitCallArgs
llvm-svn: 242824
2015-07-21 18:37:18 +00:00
Richard Smith d520a250b6 [modules] Produce an error if -cc1 wants to implicitly build a module and no
module cache has been provided, rather than creating one in the current
directory.

llvm-svn: 242819
2015-07-21 18:07:47 +00:00
Bob Wilson 13fd00d7c4 Update the documentation for "novtable" to match r242730.
llvm-svn: 242800
2015-07-21 16:40:03 +00:00
Daniel Jasper 9aea860ca2 Add missing parentheses to appease -Wlogical-op-parentheses.
Add missing case to appease -Wswitch.

llvm-svn: 242797
2015-07-21 16:18:51 +00:00
Asaf Badouh ffeb624483 [X86][AVX512F] add FP arithmetic intrinsics
add/div/mul/sub include rounding versions


Differential Revision: http://reviews.llvm.org/D11354

llvm-svn: 242790
2015-07-21 15:27:28 +00:00
Michael Wong 65f367fcbb Commit for http://reviews.llvm.org/D10765
for OpenMP 4 target data directive parsing and sema.
This commit is on behalf of Kelvin Li.

llvm-svn: 242785
2015-07-21 13:44:28 +00:00
Aaron Ballman 61a992439d Removing attribute documentation headings that are not required and do not add clarity; NFC.
llvm-svn: 242774
2015-07-21 12:20:53 +00:00
Yaron Keren 2859653d51 Fix mingw toolchain to honor sysroot on Linux and add tests.
It should now support three mingw distributions running on Windows
and three Linux distributions. The include directories for each are
listed in the comments.

llvm-svn: 242766
2015-07-21 11:01:00 +00:00
Akira Hatanaka 0a23fac13c [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
option "-arm-reserve-r9".

This recommits r242736, which had to be reverted because the llvm-side
change that was committed in r242737 caused the number of subtarget
features to go over the limit of 64.

This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

Differential Revision: http://reviews.llvm.org/D11319

llvm-svn: 242755
2015-07-21 01:41:08 +00:00
Richard Smith c7ae3e03e2 Fix crash-on-invalid: don't look ahead past an unknown token, it might be EOF.
llvm-svn: 242744
2015-07-21 00:23:34 +00:00
Akira Hatanaka 6a543b6754 Revert r242736.
r242737 caused builds to fail with the following error message, so I'm
reverting the clang side change too:

error:Too many subtarget features! Bump MAX_SUBTARGET_FEATURES.

llvm-svn: 242741
2015-07-20 23:53:02 +00:00
Daniel Jasper e35c220c8b clang-format: Fix crasher when a UTF8 character is found in an escape
sequence. Discovered by the fuzzer.

llvm-svn: 242738
2015-07-20 23:28:07 +00:00
Akira Hatanaka 6b7fff9ce5 [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
option "-arm-reserve-r9".
        
This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

Differential Revision: http://reviews.llvm.org/D11319

llvm-svn: 242736
2015-07-20 23:20:53 +00:00
Bob Wilson 0058b82c02 Refactor TableGen backend for ClangAttrEmitter to avoid duplication.
GenerateHasAttrSpellingStringSwitch and GenerateTargetRequirements had
duplicated code to check the conditions for target-specific attributes.
Refactor the duplicated code into a separate function. NFC.

llvm-svn: 242731
2015-07-20 22:57:36 +00:00
Bob Wilson 7c73083bd3 Ignore the "novtable" declspec when not using the Microsoft C++ ABI.
Clang used to silently ignore __declspec(novtable). It is implemented
now, but leaving the vtable uninitialized does not work when using the
Itanium ABI, where the class layout for complex class hierarchies is
stored in the vtable. It might be possible to honor the novtable
attribute in some simple cases and either report an error or ignore
it in more complex situations, but it’s not clear if that would be
worthwhile. There is also value in having a simple and predictable
behavior, so this changes clang to simply ignore novtable when not using
the Microsoft C++ ABI.

llvm-svn: 242730
2015-07-20 22:57:31 +00:00
David Majnemer 1bf0f8ede6 [MS Compat] Add support for __declspec(noalias)
The attribute '__declspec(noalias)' communicates that the function only
accesses memory pointed to by its pointer-typed arguments.

llvm-svn: 242728
2015-07-20 22:51:52 +00:00
Artem Belevich db35a3ee43 [CUDA] Moved device-side triple calculation to buildCudaActions().
Differential Revision: http://reviews.llvm.org/D11310

llvm-svn: 242718
2015-07-20 21:59:31 +00:00
Reid Kleckner bbe48722cb Fix code completion tests to use an explicit modules cache path
Otherwise the stale module cache data may cause the test to fail.  These
two tests are new and are the only instances of c-index-test with
-fmodules that doesn't have an explicit module cache path.

llvm-svn: 242710
2015-07-20 21:22:46 +00:00
Reid Kleckner eab97d3d47 Fix a case where we forgot to make a static local variable comdat
Sometimes we can provide an initializer for static locals, in which case
we sometimes might need to change the type. Changing the type requires
making a new LLVM GlobalVariable, and in this codepath we were
forgetting to transfer the comdat.

Fixes PR23838.

Patch by Ivan Garramona.

llvm-svn: 242704
2015-07-20 20:35:30 +00:00
Artem Belevich 5bde4e051e Fixed style issues pointed out by Justin Bogner.
Differential Revision: http://reviews.llvm.org/D11273

llvm-svn: 242698
2015-07-20 20:02:54 +00:00
Yunzhong Gao d65200cbfd Fix quoting of #pragma comment for PS4.
This is the PS4 counterpart to r229376, which quotes the library name if the
name contains space. It was discovered that if a library name contains both
double-quote and space characters, quoting the name might produce unexpected
results, but we are mostly concerned with a Windows host environment, which
does not allow double-quote or slashes in file/folder names.

Differential Revision: http://reviews.llvm.org/D11275

llvm-svn: 242689
2015-07-20 17:46:56 +00:00
Benjamin Kramer b596056413 [CodeGen] Flip lanes when lowering __builtin_palignr with one lane
Otherwise we'd pick the wrong lane for the resulting shuffle and
miscompile code. PR24187.

llvm-svn: 242678
2015-07-20 15:31:17 +00:00
Charlie Turner 9edec4e806 Add some missing 'F' flags to libm/libc builtins.
More discussion available in http://reviews.llvm.org/D9913

llvm-svn: 242675
2015-07-20 14:36:59 +00:00
Aaron Ballman ddd2ecea9c Silence a -Wtype-limits warning; NFC.
llvm-svn: 242670
2015-07-20 13:36:07 +00:00
Yaron Keren 0050b48f6c Remove erroneous space in "lib64" string constant.
llvm-svn: 242667
2015-07-20 12:40:25 +00:00
Alexey Bataev 91e5860fad [X86, inlineasm] Improve analysis of x,Y0,Yi,Ym,Yt,L,e,Z,s asm constraints (patch by Alexey Frolov)
Improve Sema checking of 9 existing inline asm constraints (‘x’, ‘Y*’, ‘L’, ‘e’, ‘Z’, ‘s’).
Differential Revision: http://reviews.llvm.org/D10536

llvm-svn: 242665
2015-07-20 12:08:00 +00:00