Commit Graph

36733 Commits

Author SHA1 Message Date
David Majnemer 11d2427b21 AST: Fix the mangling for unqualified-blocks
CXXNameMangler::mangleUnqualifiedBlock believed that
MangleContext::getBlockId returned something that used Itanium-style
discriminator numbers.

Discriminator numbers start their numberign from 1 and the first
mangling that actually gets any sort of number mangled in is the second
discriminator.

However, Block IDs start from zero.  The logic for omitting the mangling
number did a ' > 1' instead of a ' > 0' comparison; this could
potentially cause mangling conflicts.

llvm-svn: 214699
2014-08-04 06:16:50 +00:00
David Majnemer 37bffb6f3a AST: Propagate 'AlignIsRequired' though many levels of typedefs
A typedef of a typedef should have AlignIsRequired if *either* typedef
has an AlignAttr attached to it.

llvm-svn: 214698
2014-08-04 05:11:01 +00:00
Richard Smith 077d083b4d PR11778: Fix the rejects-valid half of this bug. We still produce the same
poorly-worded warning for a case value that is not a possible value of the
switched-on expression.

llvm-svn: 214678
2014-08-04 00:40:48 +00:00
Richard Smith 06f621d349 Don't destroy MacroInfos if we find the macro definition is invalid; it'll get
destroyed on shutdown regardless. Fixes a double-delete.

llvm-svn: 214675
2014-08-03 23:41:04 +00:00
Justin Bogner 6bcf724f52 Driver: Simplify a use of the path API
It's a bit more obvious what's going on if we use path::filename
rather than decrementing an iterator here.

llvm-svn: 214668
2014-08-03 21:46:33 +00:00
NAKAMURA Takumi 0f9447d1ce Tools.cpp: Avoid std::to_string() on -fbuild-session-timestamp to appease mingw32 builder.
llvm-svn: 214656
2014-08-03 01:11:44 +00:00
Richard Smith 6d0e97afcf In the case of mangling collisions, make an attempt to note both definitions
involved.

llvm-svn: 214606
2014-08-02 00:50:16 +00:00
Alexey Samsonov d9ad5cec0c [ASan] Use metadata to pass source-level information from Clang to ASan.
Instead of creating global variables for source locations and global names,
just create metadata nodes and strings. They will be transformed into actual
globals in the instrumentation pass (if necessary). This approach is more
flexible:
1) we don't have to ensure that our custom globals survive all the optimizations
2) if globals are discarded for some reason, we will simply ignore metadata for them
   and won't have to erase corresponding globals
3) metadata for source locations can be reused for other purposes: e.g. we may
   attach source location metadata to alloca instructions and provide better descriptions
   for stack variables in ASan error reports.

No functionality change.

llvm-svn: 214604
2014-08-02 00:35:50 +00:00
Justin Bogner 9c6818ef00 InstrProf: Update for LLVM API change
We've added support for a multiple functions with the same name in
LLVM's profile data, so the lookup returning the function hash it
found doesn't make sense anymore. Update to pass in the hash we
expect.

This also adds a test that the version 1 format is still readable,
since the new API is expected to handle that.

llvm-svn: 214586
2014-08-01 22:50:16 +00:00
Richard Smith 7f5755cfac Notional simplification: defer emitting deferred inline methods until we finish
emitting everything, rather than potentially doing this reentrantly.

llvm-svn: 214582
2014-08-01 22:42:16 +00:00
Richard Smith 570706dd7c Actually fix problem with modules buildbot this time.
llvm-svn: 214579
2014-08-01 22:17:28 +00:00
Ben Langmuir 19e6acbd51 Add -fbuild-session-file as an alternative to -fbuild-session-timestamp
Build systems tend to traffic in files and modification times, so having
them touch a file at the beginning of the build can be easier than
having them update the compile command they use every time they build.

llvm-svn: 214577
2014-08-01 22:12:21 +00:00
Alexey Samsonov 4b8de11c81 [Sanitizer] Introduce SanitizerMetadata class.
It is responsible for generating metadata consumed by sanitizer instrumentation
passes in the backend. Move several methods from CodeGenModule to SanitizerMetadata.
For now the class is stateless, but soon it won't be the case.

Instead of creating globals providing source-level information to ASan, we will create
metadata nodes/strings which will be turned into actual global variables in the
backend (if needed).

No functionality change.

llvm-svn: 214564
2014-08-01 21:35:28 +00:00
Joerg Sonnenberger 254f8729d0 Let's assume PowerPC has no SSE.
llvm-svn: 214562
2014-08-01 21:20:02 +00:00
Richard Smith 1ba0a07e46 Re-commit r214547 with tests fixed. Hopefully all the bots will be happy now.
Original message:

Fix iterator invalidation issues that are breaking my modules buildbot's
bootstrap.

llvm-svn: 214555
2014-08-01 20:39:36 +00:00
Richard Smith 455768e2af Revert r214547 due to test breakage.
llvm-svn: 214549
2014-08-01 20:09:39 +00:00
Richard Smith cf08ff50dd Fix iterator invalidation issues that are breaking my modules buildbot's bootstrap.
llvm-svn: 214547
2014-08-01 19:59:14 +00:00
Aaron Ballman e13d00996d Dropping some else-after-returns. No functional changes intended.
llvm-svn: 214526
2014-08-01 17:02:34 +00:00
Daniel Sanders 2ef3cdd3d5 Revert r214497: [mips] Defer va_arg expansion to the backend.
It appears that the backend does not handle all cases that were handled by clang.
In particular, it does not handle structs as used in
SingleSource/UnitTests/2003-05-07-VarArgs.

llvm-svn: 214512
2014-08-01 13:26:28 +00:00
Aaron Ballman 41b10ac3b7 Replacing some more complex logic with a helper function call to ObjCMethod::getReturnTypeSourceRange. No functional changes intended.
llvm-svn: 214511
2014-08-01 13:20:09 +00:00
Robert Lytton f9710b32b1 Xcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.
Summary:
There are no tests as it is dependant upon the environment variables
XCC_C_INCLUDE_PATH & XCC_CPLUS_INCLUDE_PATH  being set.

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

llvm-svn: 214510
2014-08-01 13:11:46 +00:00
Daniel Jasper dcf37fbec5 clang-format: Add a space in ObjC protocols.
Before:
  @interface Foo (HackStuff)<MyProtocol>

After:
  @interface Foo (HackStuff) <MyProtocol>

llvm-svn: 214508
2014-08-01 13:03:05 +00:00
Aaron Ballman 4bfa0de5b0 Improving diagnostic source ranges for the nonnull attribute. Now it highlights the attribute and the faulty nonpointer type when possible.
llvm-svn: 214507
2014-08-01 12:58:11 +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
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
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
Aaron Ballman 634e46255b Removing an outdated FIXME. No functional changes.
llvm-svn: 214411
2014-07-31 18:09:13 +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
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
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
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