Commit Graph

48689 Commits

Author SHA1 Message Date
DeLesley Hutchins 5ede5cc9ba Thread safety analysis: check pt_guarded_by attribute when calling -> and *
on smart pointers.  -Wthread-safety-beta only.

llvm-svn: 194103
2013-11-05 23:09:56 +00:00
Fariborz Jahanian 23417073ee ObjectiveC migrator. Please annotation of properties with
NS_RETURNS_INNER_POINTER under -objcmt-returns-innerpointer-property
flag (off by default), as older compilers do not support such annotations.
// rdar://15396636

llvm-svn: 194100
2013-11-05 22:28:30 +00:00
Richard Smith e9ff770f8b Simplify: we don't care why constant evaluation might have failed when we're
checking an expression for constant overflow.

llvm-svn: 194099
2013-11-05 22:23:30 +00:00
Richard Smith 6d4c6586c9 Refactor constant expression handling and make a couple of tweaks to make it a
bit more robust against future changes. This includes a slight diagnostic
improvement: if we know we're only trying to form a constant expression, take
the first diagnostic which shows the expression is not a constant expression,
rather than preferring the first one which makes the expression unfoldable.

llvm-svn: 194098
2013-11-05 22:18:15 +00:00
Rafael Espindola 0df9e16cc7 With this patch -Wwrite-strings is still implemented with the terrible
hack of passing -fconst-strings to -cc1, but at least the driver uses
the regular warning checking code path.

Since we don't support a warning that is DefaultIgnore in one language
but not in another, this patch creates a dummy C only warning in the same
group as the existing one to get the desired effect.

llvm-svn: 194097
2013-11-05 21:43:54 +00:00
Rafael Espindola 2e2995bf50 Produce direct calls instead of alias to linkonce_odr functions.
This is a small optimization on linux, but should help more on windows
where msvc only outputs one destructor if there would be two identical ones.

llvm-svn: 194095
2013-11-05 21:37:29 +00:00
James Dennett 42c4e50f63 Documentation tweaks: Fix a typo in a reference to the C++ standard,
another typo in a comment, and update formatting of some comments to
use Doxygen \brief annotations instead of repeating the name of the
documented entity.

llvm-svn: 194092
2013-11-05 19:37:38 +00:00
Daniel Jasper bbf5c1c965 clang-format: Allow line merging and partial formatting of nested blocks
Before, clang-format would always format entire nested blocks, which
can be unwanted e.g. for long DEBUG({...}) statements. Also
clang-format would not allow to merge lines in nested blocks (e.g. to
put "if (a) return;" on one line in Google style).

This is the first step of several refactorings mostly focussing on the
additional functionality (by reusing the "format many lines" code to
format the children of a nested block). The next steps are:
* Pull out the line merging into its own class.
* Seperate the formatting of many lines from the formatting of a single
  line (and the analysis of the solution space).

llvm-svn: 194090
2013-11-05 19:10:03 +00:00
Kaelyn Uhrain 89035721b9 Revert "Try to correct a mistyped "-" or ">" to "->" for some C++ cases."
Revert this patch until cases of rejected valid code (e.g. identifiers
that require ADL to be resolved properly) are fixed.

llvm-svn: 194088
2013-11-05 18:28:21 +00:00
Jiangning Liu 34a7109b47 Implement AArch64 Neon Crypto instruction classes AES, SHA, and 3 SHA.
llvm-svn: 194086
2013-11-05 17:42:24 +00:00
Timur Iskhodzhanov 5877663622 Fix vbtable indices when a class shares the vbptr with a non-virtual base
llvm-svn: 194082
2013-11-05 15:54:58 +00:00
Alp Toker 3364fe149c Disable test fully with REQUIRES
Third time's the charm, sorry for the noise.

llvm-svn: 194076
2013-11-05 13:27:19 +00:00
Alp Toker 53b74accc7 Disable the test that crashes
XFAIL wasn't enough for some of the build servers.

llvm-svn: 194073
2013-11-05 12:55:00 +00:00
Alp Toker 6731f38aca Fix a test that was never being run, mark it XFAIL
Turns out this has always been crashing since the test landed in
r186647:

  Assertion failed: (Access != AS_none && "Access specifier is AS_none inside a record decl"), function CheckAccessDeclContext, file clang/lib/AST/DeclBase.cpp, line 690.

Needs attention.

llvm-svn: 194072
2013-11-05 12:45:46 +00:00
Alp Toker f80de76ca9 Make test run reliably
llc waits for input on stdin, which was not provided in this test. It
was running only thanks to a quirk in the way lit concatenates
commands.

llvm-svn: 194071
2013-11-05 12:45:43 +00:00
Alp Toker f9cabd9ddb Fix test that was not being run
llvm-svn: 194070
2013-11-05 12:45:40 +00:00
Alp Toker 52ca4a4e47 Fix test that wasn't testing anything
llvm-svn: 194069
2013-11-05 12:45:37 +00:00
Joey Gouly a7310a8cfa Do not allow functions or kernels called 'main' in OpenCL.
llvm-svn: 194068
2013-11-05 12:30:39 +00:00
David Majnemer 21db51ab91 Simplify test case added in r194059
llvm-svn: 194061
2013-11-05 10:05:58 +00:00
David Majnemer 76faf1f525 Lex: Require that '#' be followed by a macro parameter name when preceded by '##'
After lexing a '##', we would look ahead and check to see if it was
followed by '__VA_ARGS__'.  After doing so, we would then go ahead and
lex the token.

However we would fail in the case where the '##' was followed by a '#'
followed by an identifier because we would have lexed the '#' separately
from the identifier, bypassing our parameter validation logic.

Instead, lex the tokens coming after the '##' later.

This fixes PR17804.

llvm-svn: 194059
2013-11-05 09:30:17 +00:00
Richard Smith 96c07b165e Remove stray comma from documentation.
llvm-svn: 194056
2013-11-05 09:12:55 +00:00
Richard Smith b47c36f8e1 C++1y sized deallocation: if we have a use, but not a definition, of a sized
deallocation function (and the corresponding unsized deallocation function has
been declared), emit a weak discardable definition of the function that
forwards to the corresponding unsized deallocation.

This allows a C++ standard library implementation to provide both a sized and
an unsized deallocation function, where the unsized one does not just call the
sized one, for instance by putting both in the same object file within an
archive.

llvm-svn: 194055
2013-11-05 09:12:18 +00:00
Richard Smith 2d1d3ca1cc Enable links now that they work.
llvm-svn: 194054
2013-11-05 08:27:00 +00:00
David Majnemer 2748da9be4 Sema: Improve comment introduced in r193397
llvm-svn: 194052
2013-11-05 08:01:18 +00:00
Rafael Espindola 26cc9bdfc0 Expand the test a bit.
llvm-svn: 194050
2013-11-05 07:11:42 +00:00
Rafael Espindola 1cc563d558 Add a testcase from the recent bootstrap failure.
llvm-svn: 194049
2013-11-05 06:44:57 +00:00
Rafael Espindola b5ac86865a Revert "Produce direct calls instead of alias to linkonce_odr functions."
This reverts commit r194046.
Debugging a bootstrap issue.

llvm-svn: 194047
2013-11-05 05:29:54 +00:00
Rafael Espindola 5d79a51a45 Produce direct calls instead of alias to linkonce_odr functions.
This is a small optimization on linux, but should help more on windows
where msvc only outputs one destructor if there would be two identical ones.

llvm-svn: 194046
2013-11-05 05:22:36 +00:00
Kevin Qin 9eece7b5e0 Implemented aarch64 neon intrinsic vcopy_lane with float type.
llvm-svn: 194042
2013-11-05 02:05:44 +00:00
Fariborz Jahanian ce4bbb2532 ObjectiveC. Method implementations should only check for
"Missing call to Super" in the overriding method and
not in the method itself. // rdar://15385981.

llvm-svn: 194031
2013-11-05 00:28:21 +00:00
Dmitri Gribenko e9bcf5b7b1 Include non-explicit submodules in exported module list
This change fixes Richard's testcase for r193815.  Now we include non-explicit
submodules into the list of exports.

The test failed previously because:
- recursive_visibility_a1.inner is not imported (only recursive_visibility_a1 is),
- thus the 'inner' submodule is not showing up in any of the import lists,
- and because of this getExportedModules() is not returning the
  correct module set -- it only considers modules that are imported.

The fix is to make Module::getExportedModules() include non-explicit submodules
into the list of exports.

llvm-svn: 194018
2013-11-04 21:51:33 +00:00
Anna Zaks 3d46ac66d8 [analyzer] Track the count of NSOrderedSet similarly to other fast enumerations.
llvm-svn: 194005
2013-11-04 19:13:08 +00:00
Anna Zaks 830d2f7701 [analyzer] Suppress warnings coming out of std::basic_string.
The analyzer cannot reason about the internal invariances of the data structure (radar://15194597).

llvm-svn: 194004
2013-11-04 19:13:03 +00:00
Kaelyn Uhrain 3fb1710910 Try to correct a mistyped "-" or ">" to "->" for some C++ cases.
Similar C code isn't caught as it seems to hit a different code path.
Also, as the check is only done for record pointers, cases involving
an overloaded operator-> are not handled either. Note that the reason
this check is done in the parser instead of Sema is not related to
having enough knowledge about the current state as it is about being
able to fix up the parser's state to be able to recover and traverse the
correct code paths.

llvm-svn: 194002
2013-11-04 18:59:34 +00:00
Rafael Espindola 3f643bd124 Use aliases for more constructors and destructors.
With this patch we produce alias for cases like

template<typename T>
struct foobar {
  foobar() {
  }
};
template struct foobar<void>;

We just have to be careful to produce the same aliases in every TU because
of comdats.

llvm-svn: 194000
2013-11-04 18:38:59 +00:00
Rafael Espindola a6775b622f clang-format this if.
llvm-svn: 193997
2013-11-04 17:13:51 +00:00
Justin Bogner e0ccdb1a28 CodeGen: Test that simple expressions are simplified at -O0
llvm-svn: 193995
2013-11-04 16:13:23 +00:00
Justin Bogner b23224eede CodeGen: Use EmitBranchOnBool when generating For and CXXForRange
A while ago EmitForStmt was changed to explicitly evaluate the
condition expression and create a branch instead of using
EmitBranchOnBool, so that the condition expression could be used for
some cleanup logic. The cleanup stuff has since been reorganized, and
this is no longer necessary.

In EmitCXXForRange, the evaluated condition was never used for
anything else. The logic was presumably modeled on EmitForStmt.

llvm-svn: 193994
2013-11-04 16:13:21 +00:00
Justin Bogner 085e28e4a6 CodeGen: Move an initialization away from an unrelated comment
An initialization somehow found its way in between a comment and the
block of code the comment is about. Moving the initialization makes
this less confusing.

llvm-svn: 193993
2013-11-04 16:13:18 +00:00
NAKAMURA Takumi d6f14d98c2 clang/lib/Parse/CMakeLists.txt: Fixup corresponding to r193989. ClangAttrTypeArg is required here.
llvm-svn: 193991
2013-11-04 13:10:53 +00:00
Aaron Ballman ccdca78d50 Updating the makefile to reflect CMake; addendum to r193989.
llvm-svn: 193990
2013-11-04 13:02:44 +00:00
Aaron Ballman 4768b31797 Attributes which accept a type as their sole argument are no longer hard coded into the parser. Instead, they are automatically listed through tablegen.
llvm-svn: 193989
2013-11-04 12:55:56 +00:00
Benjamin Kramer a1ced436b1 Make ADLResult::iterator a proper iterator.
PR17796.

llvm-svn: 193986
2013-11-04 10:29:56 +00:00
Benjamin Kramer d9a5e2a490 Driver: Add support for -march=bdver3 on x86.
llvm-svn: 193985
2013-11-04 10:29:51 +00:00
Richard Smith b2504bdc0d Issue a diagnostic if an implicitly-defined move assignment operator would move
the same virtual base class multiple times (and the move assignment is used,
and the move assignment for the virtual base is not trivial).

llvm-svn: 193977
2013-11-04 04:26:14 +00:00
Filip Pizlo 29cc006eb8 It is no longer necessary to opt out of pretty stack traces.
llvm-svn: 193973
2013-11-04 02:25:34 +00:00
Richard Smith 2002bfec3b Update a comment to match current core issues list.
llvm-svn: 193970
2013-11-04 02:02:27 +00:00
Richard Smith 8b86f2d401 Implement final resolution of DR1402: implicitly-declared move operators that
would be deleted are still declared, but are ignored by overload resolution.

Also, don't delete such members if a subobject has no corresponding move
operation and a non-trivial copy. This causes us to implicitly declare move
operations in more cases, but risks move-assigning virtual bases multiple
times in some circumstances (a warning for that is to follow).

llvm-svn: 193969
2013-11-04 01:48:18 +00:00
David Majnemer 42350dfcc8 Sema: Do not allow overloading between methods based on restrict
If the sole distinction between two declarations is that one has a
__restrict qualifier then we should not consider it to be an overload.

Instead, we will consider it as an incompatible redeclaration which is
similar to how MSVC, ICC and GCC would handle it.

This fixes PR17786.

N.B. We must not mangle in __restrict into method qualifiers becase we
don't allow overloading between such declarations anymore.  To do
otherwise would be a violation of the Itanium ABI.

llvm-svn: 193964
2013-11-03 23:51:28 +00:00
Alp Toker 6d023c4f1e Fix test to actually check the FixIt-applied code
r102230 added an 'echo' making this a no-op.

Also fixes FAIL on native Windows with no shell/GnuWin32.

llvm-svn: 193938
2013-11-03 01:50:38 +00:00