Commit Graph

53956 Commits

Author SHA1 Message Date
Eli Bendersky 78e83d8895 Fix a memory leak - dispose of the CXString after printing it in mangling.
Thanks to kcc@ for noticing.

llvm-svn: 214506
2014-08-01 12:55:44 +00:00
Aaron Ballman d6807dafb3 Initializing the loop hint option token again.
llvm-svn: 214504
2014-08-01 12:41:37 +00:00
Aaron Ballman d0b090d735 Initializing the loop hint option token.
llvm-svn: 214502
2014-08-01 12:20:20 +00:00
Daniel Sanders cd8ba86990 [mips] Defer va_arg expansion to the backend.
Summary:
This patch causes clang to emit va_arg instructions to the backend instead of
expanding them into an implementation itself. The backend already implements
va_arg since this is necessary for NaCl so this patch is removing redundant
code.

Together with the llvm patch (D4556) that accounts for the effect of endianness
on the expansion of va_arg, this fixes PR19612.

Depends on D4556

Reviewers: sstankovic, dsanders

Reviewed By: dsanders

Subscribers: rnk, cfe-commits

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

llvm-svn: 214497
2014-08-01 10:29:21 +00:00
Richard Smith 46bb581a03 [modules] Remove IRGen special case for emitting implicit special members if
they're somehow missing a body. Looks like this was left behind when the loop
was generalized, and it's not been problematic before because without modules,
a used, implicit special member function declaration must be a definition.

This was resulting in us trying to emit a constructor declaration rather than
a definition, and producing a constructor missing its member initializers.

llvm-svn: 214473
2014-08-01 01:56:39 +00:00
Manman Ren 264da422b9 Add comments to debug info testing case.
llvm-svn: 214472
2014-08-01 01:47:13 +00:00
Richard Trieu 428058fb9a Remove this pointer that is converted to bool. In well-defined contexts, the
this pointer is always non-null.  If the this pointer is null, it is undefined
and the compiler may optimize it away by assuming it is non-null.  The null
checks are pushed into the callers.

llvm-svn: 214471
2014-08-01 01:42:01 +00:00
Hans Wennborg 05fb383d2b clang-format vs plugin: claim support for VS 14 CTP too
llvm-svn: 214461
2014-08-01 00:02:24 +00:00
Richard Smith 24d166ca77 Fix buildbot: work around missing GCC C++11 feature.
llvm-svn: 214459
2014-07-31 23:52:38 +00:00
Richard Smith 6de7a24782 [modules] Maintain an AST invariant across module load/save: if any declaration
of a function has a resolved exception specification, then all declarations of
the function do.

We should probably improve the AST representation to make this implicit (perhaps
only store the exception specification on the canonical declaration), but this
fixes things for now.

The testcase for this (which used to assert) also exposes the actual bug I was
trying to reduce here: we sometimes fail to emit the body of an imported
special member function definition. Fix for that to follow.

llvm-svn: 214458
2014-07-31 23:46:44 +00:00
Richard Smith 8acb4280c5 Factor out exception specification information from
FunctionProtoType::ExtProtoInfo. Most of the users of these fields don't care
about the other ExtProtoInfo bits and just want to talk about the exception
specification.

llvm-svn: 214450
2014-07-31 21:57:55 +00:00
Aaron Ballman ef940aaf07 Loop hint pragmas sometimes do not contain an identifier option (such as #pragma unroll(4)). Check explicitly that the token we stored was an identifier.
Amends r214432

llvm-svn: 214446
2014-07-31 21:24:32 +00:00
Aaron Ballman ef7aef8fe5 Implemented a diagnostic to handle multiple, distinct ownership_return attributes on the same declaration. This removes a FIXME from the code.
llvm-svn: 214436
2014-07-31 20:44:26 +00:00
Tyler Nowicki 0c9b34b3ec Add a state variable to the loop hint attribute.
This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler.

Resubmit with changes to try to fix the build-bot issue.

Reviewed by Aaron Ballman

llvm-svn: 214432
2014-07-31 20:15:14 +00:00
Hans Wennborg f51dc3b5d4 Local extern redeclarations of dllimport variables stay dllimport even if they don't specify the attribute
llvm-svn: 214425
2014-07-31 19:29:39 +00:00
Eli Bendersky e4f02eceea Reformat docstring to 80-col
llvm-svn: 214412
2014-07-31 18:12:17 +00:00
Aaron Ballman 634e46255b Removing an outdated FIXME. No functional changes.
llvm-svn: 214411
2014-07-31 18:09:13 +00:00
Eli Bendersky 44a206f829 Exposes a C API to name mangling for a given cursor.
Inspired by https://gist.github.com/tritao/2766291, and was previously discussed
on cfe-dev: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-June/037577.html

Adding testing capability via c-index-test.

llvm-svn: 214410
2014-07-31 18:04:56 +00:00
Fariborz Jahanian a1db7df243 Obective-C. Patch to fix the incorrect ObjcMessageExpr argument source ranges,
when arguments are structures or classes. PR16392.
patch by Karlis Senko

llvm-svn: 214409
2014-07-31 17:39:50 +00:00
Nico Weber be39a87e11 Delay check for prototype on __fastcall functions until after MergeFunctionDecl.
In C, it is only known after merging decls if a function with 0 arguments has
a prototype.  Fixes PR20386, see that for more notes.

llvm-svn: 214408
2014-07-31 17:19:18 +00:00
Aaron Ballman 8ed8dbd96a Automate attribute argument count semantic checking when there are variadic or optional arguments present. With this, the only time you should have to manually check attribute argument counts is when HasCustomParsing is set to true, or when you have variadic arguments that aren't really variadic (like ownership_holds and friends).
Updating the diagnostics in the launch_bounds test since they have been improved in that case. Adding a test for nonnull since it has little test coverage, but has truly variadic arguments.

llvm-svn: 214407
2014-07-31 16:37:04 +00:00
Ehsan Akhgari 9f507382dd ms-inline-asm: Add a test to ensure that call doesn't clobber eax.
Note that it's not clear whether this is the right behavior, please see
the review for the discussion.

Reviewers: rnk

Subscribers: cfe-commits

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

llvm-svn: 214401
2014-07-31 13:43:17 +00:00
Manuel Klimek 45bf56cdf9 Fix parsing of classes where the class name is an absolute nested name specifier.
llvm-svn: 214393
2014-07-31 07:19:30 +00:00
Richard Smith 77be48ac47 PR18097: Support initializing an _Atomic(T) from an object of C++ class type T
or a class derived from T. We already supported this when initializing
_Atomic(T) from T for most (and maybe all) other reasonable values of T.

llvm-svn: 214390
2014-07-31 06:31:19 +00:00
David Majnemer 742424339a Sema: Disallow taking the address of a bitfield coming from preincrement
Clang forgot that '++s.m' was a bitfield l-value and permit it's address
to be taken; this would crash at CodeGen-time.

Instead, propagate the object-kind when we see the prefix
increment/decrement.

This fixes PR20496.

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

llvm-svn: 214386
2014-07-31 04:52:13 +00:00
Adam Nemet da82bcc4dd [AVX512] Add unaligned FP load intrinsics
Part of <rdar://problem/17688758>

llvm-svn: 214380
2014-07-31 04:00:39 +00:00
NAKAMURA Takumi db9552f4a4 Revert r214333, "Add a state variable to the loop hint attribute."
It brought undefined behavior.

llvm-svn: 214376
2014-07-31 01:52:33 +00:00
Richard Smith 68daa119ea Rename this test so that it actually runs, and fix it so that it passes.
llvm-svn: 214369
2014-07-31 00:22:56 +00:00
Aaron Ballman 04559a7941 Updating a comment related to the implementation of -Woverloaded-virtual, and adding a FIXME to a test case. (Drive-by removal of trailing whitespace in the test case as well.)
No functional changes.

llvm-svn: 214362
2014-07-30 23:50:53 +00:00
Rafael Espindola 42affc2db6 Update for llvm change.
llvm-svn: 214356
2014-07-30 22:52:16 +00:00
Tyler Nowicki cab7ca3e2a Add a state variable to the loop hint attribute.
This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler.

Reviewed by Aaron Ballman

llvm-svn: 214333
2014-07-30 20:54:33 +00:00
Adam Nemet 2db1d2fb32 [AVX512] Add intrinsic for knot
Part of <rdar://problem/17688758>

llvm-svn: 214316
2014-07-30 16:51:27 +00:00
Adam Nemet c871ff95f3 [AVX512] Add some of the FP cast intrinsics
Part of <rdar://problem/17688758>

llvm-svn: 214315
2014-07-30 16:51:24 +00:00
Adam Nemet f42e7a274a [AVX512] Add set1 intrinsics
(Dropped the byte and word variants from the patch.  Turns out these are not
part of AVX512F but only AVX512BW/VL.)

Part of <rdar://problem/17688758>

llvm-svn: 214314
2014-07-30 16:51:22 +00:00
Fraser Cormack dadc371e85 Add OpenCL/SPIR kernel_arg_base_type metadata node
As defined in the SPIR 1.2 specification, this node behaves similarly to
kernel_arg_type but will print the underlying type name, e.g., without
typedefs.

Example:
  typedef unsigned int myunsignedint;
would report:
  'myunsignedint' in the kernel_arg_type node
  'uint' in the kernel_arg_base_type node

llvm-svn: 214308
2014-07-30 14:39:53 +00:00
Robert Khasanov 3b6616c3a3 [SKX] Enabling SKX target (Skylake server chip)
a) add SKX support to Clang driver;
b) add tests for SKX target and AVX512BW, AVX512DQ, AVX512VL features into clang driver tests

Patch by Zinovy Nis <zinovy.y.nis@intel.com>

llvm-svn: 214306
2014-07-30 13:53:40 +00:00
Fraser Cormack 152493b635 Fix OpenCL/SPIR kernel_arg_type metadata node
This fixes a bug where kernel_arg_type was always changing 'unsigned ' to 'u'
for any parameter type, including non-canonical types.

Example:
  typedef unsigned int myunsignedint;
would report:
  "myunt"

llvm-svn: 214305
2014-07-30 13:41:12 +00:00
NAKAMURA Takumi f9f672c06d Suppress clang/test/Sema/struct-packed-align.c also on msvc for investigating.
FIXME: This test is incompatible to MS compat mode.
FIXME: Don't suppress this also on mingw. :-p
llvm-svn: 214301
2014-07-30 12:17:38 +00:00
Daniel Jasper 71646ec206 clang-format: Understand 'typename' in placement new.
Before:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa)) typename aaaaaaaaaaaaaaaaaaaaaaaa();

After:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
      typename aaaaaaaaaaaaaaaaaaaaaaaa();

llvm-svn: 214300
2014-07-30 12:14:10 +00:00
NAKAMURA Takumi e098b3b993 Suppress clang/test/Sema/struct-packed-align.c for targeting LLP64.
llvm-svn: 214298
2014-07-30 10:44:35 +00:00
Simon Atanasyan 1b0542ecee [Driver][Mips] Add function-wrapper so simplify creation of `Multilib` objects.
No functional changes.

llvm-svn: 214294
2014-07-30 09:15:10 +00:00
David Majnemer f8d3864dbe AST: Simplify some code
Iterator invalidation issues already force us to do one lookup and one
insert.
Don't use the particular bit-pattern of the 'Align' field to determine
whether or not we have already inserted into the TypeInfo DenseMap;
instead ask for an iterator to the TypeInfo entry.

llvm-svn: 214293
2014-07-30 08:42:33 +00:00
Manuel Klimek b0042c414e Fix some cases of incorrect handling of lifetime extended temporaries.
MaterializeTemporaryExpr already contains information about the lifetime
of the temporary; if the lifetime is not the full statement, we do not
want to emit a destructor at the end of the full statement for it.

llvm-svn: 214292
2014-07-30 08:34:42 +00:00
David Majnemer 8d5f9ab2cc MS ABI: Mangle alias templates used as template-template arguments
A templated using declaration may be used as a template-template
argument.

Unfortunately, the VS "14" chooses '?' as the sole marker for the
argument.  This is problematic because it presupposes the possibility of
using more than one template-aliases as arguments to the same template.

This fixes PR20047.

llvm-svn: 214290
2014-07-30 08:20:03 +00:00
Rafael Espindola eaa88c1eee Simplify the code.
Thanks to David Balkie for the suggestion.

llvm-svn: 214286
2014-07-30 04:40:23 +00:00
Rafael Espindola e122ee1fab Fix a use after free bug.
llvm-svn: 214281
2014-07-30 02:37:26 +00:00
David Majnemer 34b5749989 MS ABI: Consider alignment attributes on typedefs for layout
The MS ABI has a notion of 'required alignment' for fields; this
alignment supercedes pragma pack directives.

MSVC takes into account alignment attributes on typedefs when
determining whether or not a field has a certain required alignment.

Do the same in clang by tracking whether or not we saw such an attribute
when calculating the type's bitwidth and alignment.

This fixes PR20418.

Reviewers: rnk

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

llvm-svn: 214274
2014-07-30 01:30:47 +00:00
Larisse Voufo f73da98f48 Not all instantiated variable is odr-used. Do not mark non-odr-used variable template specializations as such.
llvm-svn: 214267
2014-07-30 00:49:55 +00:00
Richard Smith a0ce9c4651 [modules] Factor out ODR checking, to avoid unnecessary repeated work in
finishPendingActions loop.

llvm-svn: 214246
2014-07-29 23:23:27 +00:00
Hans Wennborg cbd71cacb0 clang-format vs plugin: include the license
The vsix installer will show the license when it starts, and it
would print an annoying message when there was none.

While we're here, add a MoreInfoUrl.

llvm-svn: 214237
2014-07-29 22:34:53 +00:00