]> granicus.if.org Git - clang/log
clang
11 years agoFix a typo in the diagnostic note added in r186342.
Kaelyn Uhrain [Mon, 15 Jul 2013 21:18:33 +0000 (21:18 +0000)]
Fix a typo in the diagnostic note added in r186342.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186348 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove the "->" to "." fixit from r186128 into a separate note since
Kaelyn Uhrain [Mon, 15 Jul 2013 19:54:54 +0000 (19:54 +0000)]
Move the "->" to "." fixit from r186128 into a separate note since
recovery is not attempted with the fixit. Also move the associated test
case from FixIt/fixit.cpp to SemaCXX/member-expr.cpp since the fixit is
no longer automatically applied.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186342 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for type traversal matchers.
Samuel Benzaquen [Mon, 15 Jul 2013 19:25:06 +0000 (19:25 +0000)]
Add support for type traversal matchers.

Summary:
Fixup the type traversal macros/matchers to specify the supported types.
Make the marshallers a little more generic to support any variadic function.
Update the doc script.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1023

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186340 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRe-revert r86040, which was un-reverted in r186199.
Chandler Carruth [Mon, 15 Jul 2013 17:27:42 +0000 (17:27 +0000)]
Re-revert r86040, which was un-reverted in r186199.

This breaks the build of basic patterns with repeated friend
declarations. See the added test case in SemaCXX/friend.cpp or the test
case reported to the original commit log.

Original commit log:
  If we friend a declaration twice, that should not make it visible to
  name lookup in the surrounding context. Slightly rework how we handle
  friend declarations to inherit the visibility of the prior
  declaration, rather than setting a friend declaration to be visible
  whenever there was a prior declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186331 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang-format: Improve c-style cast detection.
Daniel Jasper [Mon, 15 Jul 2013 15:04:42 +0000 (15:04 +0000)]
clang-format: Improve c-style cast detection.

Before:
  #define x ((int) - 1)
  #define p(q) ((int *) & q)
After:
  #define x ((int)-1)
  #define p(q) ((int *)&q)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186324 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoImprovement of change r186320.
Daniel Jasper [Mon, 15 Jul 2013 14:33:14 +0000 (14:33 +0000)]
Improvement of change r186320.

Fixed a test that by now passed for the wrong reason.

Before:
  llvm::outs() << "aaaaaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaa(
                                                 aaaaaaaaaaaaaaaaaaaaaaaaaaaa);
After:
  llvm::outs() << "aaaaaaaaaaaaaaaaaaa: "
               << aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa);

Also reformatted Format.cpp with the latest changes (1 formatting fix
and 1 layout change of a <<-chain).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186322 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoImprove formatting of operator<< chains.
Daniel Jasper [Mon, 15 Jul 2013 14:12:30 +0000 (14:12 +0000)]
Improve formatting of operator<< chains.

Before:
  llvm::outs() << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa << "aaaaaaaaaaaaaaaa: "
               << aaaaaaaaaaaaaaaa << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa;

After:
  llvm::outs() << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa
               << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa
               << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186320 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplacing an empty switch with its moral equivalent. No functional changes intended.
Aaron Ballman [Mon, 15 Jul 2013 13:41:33 +0000 (13:41 +0000)]
Replacing an empty switch with its moral equivalent.  No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186318 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd 'static' and 'const' qualifiers to some arrays of strings.
Craig Topper [Mon, 15 Jul 2013 08:24:27 +0000 (08:24 +0000)]
Add 'static' and 'const' qualifiers to some arrays of strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186314 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix to PR12262 - assertion when substituting explicit template arguments
Serge Pavlov [Mon, 15 Jul 2013 06:14:07 +0000 (06:14 +0000)]
Fix to PR12262 - assertion when substituting explicit template arguments
does not substitute a sizeof-pack expression.
The solution is proposed by Richard Smith.
Differential Revision: http://llvm-reviews.chandlerc.com/D869

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186306 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert 186302 to fix build bots.
Craig Topper [Mon, 15 Jul 2013 05:44:18 +0000 (05:44 +0000)]
Revert 186302 to fix build bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186305 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
Craig Topper [Mon, 15 Jul 2013 04:28:48 +0000 (04:28 +0000)]
Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186302 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
Craig Topper [Mon, 15 Jul 2013 03:38:40 +0000 (03:38 +0000)]
Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186300 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReformat line.
Eric Christopher [Sun, 14 Jul 2013 21:15:27 +0000 (21:15 +0000)]
Reformat line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186294 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove BlockLiteralGeneric earlier in CGDebugInfo and remove
Eric Christopher [Sun, 14 Jul 2013 21:12:44 +0000 (21:12 +0000)]
Move BlockLiteralGeneric earlier in CGDebugInfo and remove
BlockLiteralGenericSet and replace with a call to isType() on the
BlockLiteralGeneric.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186293 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate a few comments and reformat a decl for clarity.
Eric Christopher [Sun, 14 Jul 2013 21:00:07 +0000 (21:00 +0000)]
Update a few comments and reformat a decl for clarity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186292 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplace C++0x in a comment with C++11
Craig Topper [Sun, 14 Jul 2013 17:04:56 +0000 (17:04 +0000)]
Replace C++0x in a comment with C++11

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186287 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChange cxx0x to cxx11 in diagnostic name.
Craig Topper [Sun, 14 Jul 2013 17:02:30 +0000 (17:02 +0000)]
Change cxx0x to cxx11 in diagnostic name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186286 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChange cxx0x to cxx11 in diagnostic name.
Craig Topper [Sun, 14 Jul 2013 17:01:54 +0000 (17:01 +0000)]
Change cxx0x to cxx11 in diagnostic name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186285 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
Craig Topper [Sun, 14 Jul 2013 16:47:36 +0000 (16:47 +0000)]
Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186284 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake these tests more robust against IRgen choosing to emit more named metadata.
Richard Smith [Sun, 14 Jul 2013 06:18:38 +0000 (06:18 +0000)]
Make these tests more robust against IRgen choosing to emit more named metadata.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186279 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDelete a test that is checking badly for a point bug that Clang never had (and that...
Richard Smith [Sun, 14 Jul 2013 06:17:03 +0000 (06:17 +0000)]
Delete a test that is checking badly for a point bug that Clang never had (and that spuriously fails with modules enabled).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186278 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd missing include guards into headers in lib/Headers. While it may appear
Richard Smith [Sun, 14 Jul 2013 05:41:45 +0000 (05:41 +0000)]
Add missing include guards into headers in lib/Headers. While it may appear
that these headers should not be included more than once, they are in fact
included twice when building our builtins module (in order for it to generate
submodules for them), and without this, any modular build enabling AVX and
including any builtin header fails.

Testing this is tricky because including any of these headers in a modular
build is liable to fail, due to unrelated builtin headers in the same module
including headers which might not be available on the system running the tests.
Suggestion on that front are welcome (but we're getting close to being able to
run a buildbot that has modules enabled for all tests, which would nicely solve
the testing problem).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186275 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIf an unimported submodule of an imported module contains a declaration of a
Richard Smith [Sun, 14 Jul 2013 02:01:48 +0000 (02:01 +0000)]
If an unimported submodule of an imported module contains a declaration of a
global allocation or deallocation function, that should not cause that global
allocation or deallocation function to become unavailable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186270 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSerialization support for TagDecl::IsCompleteDefinitionRequired
David Blaikie [Sun, 14 Jul 2013 01:07:41 +0000 (01:07 +0000)]
Serialization support for TagDecl::IsCompleteDefinitionRequired

Requested by Richard Smith in post-commit review of r186262

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186266 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInitialize the "IsCompleteDefinitionRequired" field in the ASTContext ctor
David Blaikie [Sat, 13 Jul 2013 22:29:32 +0000 (22:29 +0000)]
Initialize the "IsCompleteDefinitionRequired" field in the ASTContext ctor

Introduced in r186262 & found by the hexagon buildbots (but owing to
this being UB, that's random chance - so there's no additional test case
here)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186265 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to emit the...
David Blaikie [Sat, 13 Jul 2013 21:08:14 +0000 (21:08 +0000)]
PR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to emit the full definition of a type in -flimit-debug-info

This simplifies the core benefit of -flimit-debug-info by taking a more
systematic approach to avoid emitting debug info definitions for types
that only require declarations. The previous ad-hoc approach (3 cases
removed in this patch) had many holes.

The general approach (adding a bit to TagDecl and callback through
ASTConsumer) has been discussed with Richard Smith - though always open
to revision.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186262 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCorrectly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENT
David Blaikie [Sat, 13 Jul 2013 21:08:08 +0000 (21:08 +0000)]
Correctly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENT

Test coverage for non-dependent pack expansions doesn't demonstrate a
failure prior to this patch (a follow-up commit improving debug info
will cover this commit specifically) but covers a related hole in our
test coverage.

Reviewed by Richard Smith & Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186261 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify getTypeInfoImpl handling of 'non-canonical unless dependent' types.
David Blaikie [Sat, 13 Jul 2013 21:08:03 +0000 (21:08 +0000)]
Simplify getTypeInfoImpl handling of 'non-canonical unless dependent' types.

These types are not dependent in this context, so just look through
the sugar.

Review by Richard Smith & Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186260 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Revert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile""
David Blaikie [Sat, 13 Jul 2013 19:23:35 +0000 (19:23 +0000)]
Revert "Revert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile""

This reverts commit b18b043a5a37f76803d89467e46bcac286c0ecae.

Reapply with fix for the configure+make build (missing include of
ASTContext.h).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186257 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile"
David Blaikie [Sat, 13 Jul 2013 18:54:56 +0000 (18:54 +0000)]
Revert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile"

This reverts commit r186253.

This is failing to link under Configure+Make on the buildbots for
reasons I don't immediately understand.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186255 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPR16540: ASTVector::insert(Context, Iter, Element) doesn't compile
David Blaikie [Sat, 13 Jul 2013 18:08:59 +0000 (18:08 +0000)]
PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile

Fix some uninstantiable code in ASTVector::insert. I've added a
cheap-and-dirty compile test for this, because I don't have the time to
figure out a nice way to get a real ASTContext to implement executable
tests - but we probably should have them for this ADT.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186253 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixes a typo caught by Arthur O'Dwyer
Fariborz Jahanian [Sat, 13 Jul 2013 17:16:41 +0000 (17:16 +0000)]
Fixes a typo caught by Arthur O'Dwyer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186249 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoC++ modules: Don't call DeclContext::lookup when half-way through deserializing
Richard Smith [Sat, 13 Jul 2013 02:00:19 +0000 (02:00 +0000)]
C++ modules: Don't call DeclContext::lookup when half-way through deserializing
decls. That can reenter deserialization and explode horribly by trying to merge
a declaration that we've not got very far through deserializing yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186236 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ms-cxxabi] Don't consider function templates for name backrefs
Reid Kleckner [Sat, 13 Jul 2013 00:43:39 +0000 (00:43 +0000)]
[ms-cxxabi] Don't consider function templates for name backrefs

They don't seem to be used for back references, presumably because a
function template is unlikely to reoccur, while a class template name
may reoccur as a type.

This fixes a mangling issue for llvm::hash_combine() in Hashing.h.

Reviewers: timurrrr

Differential Revision: http://llvm-reviews.chandlerc.com/D1078

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186233 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoObjC migrator: More knobs for migrating
Fariborz Jahanian [Sat, 13 Jul 2013 00:04:20 +0000 (00:04 +0000)]
ObjC migrator: More knobs for migrating
conforming protocols to each class. wip.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186231 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoObjC migrator: early work for migrating implicitly conforming
Fariborz Jahanian [Fri, 12 Jul 2013 22:32:19 +0000 (22:32 +0000)]
ObjC migrator: early work for migrating implicitly conforming
protocols to classes. This is wip.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186220 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChanges so that a few tests do not fail when running under guarded malloc.
Argyrios Kyrtzidis [Fri, 12 Jul 2013 22:30:03 +0000 (22:30 +0000)]
Changes so that a few tests do not fail when running under guarded malloc.

Guarded malloc emits some messages at the beginning in stderr when enabled.
These messages caused a few tests to fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186219 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse function attributes to pass along the stack protector buffer size instead of...
Bill Wendling [Fri, 12 Jul 2013 22:26:07 +0000 (22:26 +0000)]
Use function attributes to pass along the stack protector buffer size instead of making it a target option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186218 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCompute 'this' correctly for block in lambda.
Eli Friedman [Fri, 12 Jul 2013 22:05:26 +0000 (22:05 +0000)]
Compute 'this' correctly for block in lambda.

Using CurFuncDecl is both correct and simple compared to crawling
the DeclContexts of the block.

Fixes <rdar://problem/14415072>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186210 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoProvide a better diagnostic and a fixit for a '.' or '->' before the left paren
Kaelyn Uhrain [Fri, 12 Jul 2013 21:43:02 +0000 (21:43 +0000)]
Provide a better diagnostic and a fixit for a '.' or '->' before the left paren
of a function call.

This fixes PR5898 and means we now have a better diagnostic here than GCC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186208 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUnrevert r186040, reverted in r186185, with fix for PR16597.
Richard Smith [Fri, 12 Jul 2013 20:38:49 +0000 (20:38 +0000)]
Unrevert r186040, reverted in r186185, with fix for PR16597.

Original commit log:
  If we friend a declaration twice, that should not make it visible to
  name lookup in the surrounding context. Slightly rework how we handle
  friend declarations to inherit the visibility of the prior
  declaration, rather than setting a friend declaration to be visible
  whenever there was a prior declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186199 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r186040 to fix PR16597 while Richard investigates what the best
Chandler Carruth [Fri, 12 Jul 2013 18:54:40 +0000 (18:54 +0000)]
Revert r186040 to fix PR16597 while Richard investigates what the best
fix is.

Original commit log:
  If we friend a declaration twice, that should not make it visible to
  name lookup in the surrounding context. Slightly rework how we handle
  friend declarations to inherit the visibility of the prior
  declaration, rather than setting a friend declaration to be visible
  whenever there was a prior declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186185 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Treat nullPtrType as a location type.
Anna Zaks [Fri, 12 Jul 2013 17:58:33 +0000 (17:58 +0000)]
[analyzer] Treat nullPtrType as a location type.

Fixes PR16584 (radar://14415223).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186172 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agofixes a typo caught by Jordan.
Fariborz Jahanian [Fri, 12 Jul 2013 16:41:56 +0000 (16:41 +0000)]
fixes a typo caught by Jordan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186171 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoObjective-C: Produce gcc compatible encoding of
Fariborz Jahanian [Fri, 12 Jul 2013 16:19:11 +0000 (16:19 +0000)]
Objective-C: Produce gcc compatible encoding of
ivar type in meta-data while preventing recursive
encoding in a corner case. // rdar://14408244

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186169 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[scan-build] Add missing comma to ccc-analyzer.
Jordan Rose [Fri, 12 Jul 2013 16:07:33 +0000 (16:07 +0000)]
[scan-build] Add missing comma to ccc-analyzer.

Thanks, Dmitry!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186167 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang-format: Improve <<-formatting.
Daniel Jasper [Fri, 12 Jul 2013 15:14:05 +0000 (15:14 +0000)]
clang-format: Improve <<-formatting.

This fixes a regression caused by r186115.

Before:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
       bbbbbbbbb) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbb)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186164 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang-format: Fix string literal breaking.
Daniel Jasper [Fri, 12 Jul 2013 11:37:05 +0000 (11:37 +0000)]
clang-format: Fix string literal breaking.

Before this patch, it did not cooperate with
Style::AlwaysBreakBeforeMultilineStrings. Thus, it would turn

  aaaaaaaaaaaa(aaaaaaaaaaaaa, "aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa");

into:

  aaaaaaaaaaaa(aaaaaaaaaaaaa, "aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa "
                              "aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa");

and only a second format step would lead to the desired (with that
option):

  aaaaaaaaaaaa(aaaaaaaaaaaaa,
               "aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa "
               "aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa");

This could even lead to clang-format breaking the string at a different
character and thus leading to a completely different end result.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186154 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang-format: Break before/between array subscript expressions.
Daniel Jasper [Fri, 12 Jul 2013 11:19:37 +0000 (11:19 +0000)]
clang-format: Break before/between array subscript expressions.

clang-format used to treat array subscript expressions much like
function call (just replacing () with []). However, this is not really
appropriate especially for expressions with multiple subscripts.

Although it might seem counter-intuitive, the most consistent solution
seems to be to always (if necessary) break before a square bracket,
never after it. Also, multiple subscripts of the same expression should
be aligned if they are on subsequent lines.

Before:
  aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaa][
      bbbbbbbbbbbbbbbbbbbbbbbbb] = c;
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa][
      bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = ccccccccccc;

After:
  aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaa]
                           [bbbbbbbbbbbbbbbbbbbbbbbbb] = c;
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]
      [bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = ccccccccccc;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186153 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Add support for __builtin_addressof.
Jordan Rose [Fri, 12 Jul 2013 00:26:14 +0000 (00:26 +0000)]
[analyzer] Add support for __builtin_addressof.

...so we don't regress on std::addressof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186140 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[scan-build] Pass through all -f and -O flags, along with -Wwrite-strings.
Jordan Rose [Thu, 11 Jul 2013 23:56:12 +0000 (23:56 +0000)]
[scan-build] Pass through all -f and -O flags, along with -Wwrite-strings.

These flags control language options and user-visible macros, so it's
important to preserve them when analyzing. Rather than try to keep up
with all the -f flags, we'll pass them all through and then ban the ones
we don't want (like -fsyntax-only).

-Wwrite-strings is really an f-flag in disguise: it implies -fconst-strings.

Patch by Keaton Mowry, modified by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186138 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix crash on zero-argument assignment operator.
Eli Friedman [Thu, 11 Jul 2013 23:55:07 +0000 (23:55 +0000)]
Fix crash on zero-argument assignment operator.

Make sure we don't crash when checking whether an assignment operator
without any arguments is a special member.  <rdar://problem/14397774>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186137 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd the ability to use guarded malloc when running clang's lit tests.
David Dean [Thu, 11 Jul 2013 23:37:50 +0000 (23:37 +0000)]
Add the ability to use guarded malloc when running clang's lit tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186135 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoProvide a fixit hint for changing '->' to '.' if there is no operator->
Kaelyn Uhrain [Thu, 11 Jul 2013 22:38:30 +0000 (22:38 +0000)]
Provide a fixit hint for changing '->' to '.' if there is no operator->
defined for a class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186128 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake CXXBaseSpecifier::getType return unqual type.
Eli Friedman [Thu, 11 Jul 2013 22:22:22 +0000 (22:22 +0000)]
Make CXXBaseSpecifier::getType return unqual type.

Various pieces of code, like base initialization in Sema and RTTI IRGen,
don't properly ignore qualifiers on base classes.  Instead of auditing the
whole codebase, just strip them off in the getter.  (The type as written is
still available in the TypeSourceInfo for code that cares.)

Fixes PR16596.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186125 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang-format: Fix bug concerning the alignment of "}".
Daniel Jasper [Thu, 11 Jul 2013 21:27:40 +0000 (21:27 +0000)]
clang-format: Fix bug concerning the alignment of "}".

Before:
    int i;  // indented 2 space more than clang-format would use.
    SomeReturnType  // clang-format invoked on this line.
    SomeFunctionMakingLBraceEndInColumn80() {
  }  // This is the indent clang-format would prefer.

After:
    int i;  // indented 2 space more than clang-format would use.
    SomeReturnType  // clang-format invoked on this line.
    SomeFunctionMakingLBraceEndInColumn80() {
    }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186120 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang-format: Break before trailing annotations.
Daniel Jasper [Thu, 11 Jul 2013 21:02:56 +0000 (21:02 +0000)]
clang-format: Break before trailing annotations.

(if they are not function-like).

Before:
  SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      OVERRIDE;

After:
  SomeFunction(aaaaaaaaaaaaaaaaaaaaaa,
               aaaaaaaaaaaaaaaaaaaaaaaa) OVERRIDE;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186117 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang-format: Avoid line breaks before the first <<.
Daniel Jasper [Thu, 11 Jul 2013 20:41:21 +0000 (20:41 +0000)]
clang-format: Avoid line breaks before the first <<.

This puts a slight penalty on the linebreak before the first "<<", so
that clang-format generally tries to keep things on the first line.

User feedback has shown that this is generally desirable.

Before:
  llvm::outs()
      << "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =" << aaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  llvm::outs() << "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ="
               << aaaaaaaaaaaaaaaaaaaaaaaaaaa;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186115 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRestore warning to its original text when
Fariborz Jahanian [Thu, 11 Jul 2013 19:13:34 +0000 (19:13 +0000)]
Restore warning to its original text when
certain familiy of methods have the wrong type.
// rdar://14408244

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186111 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify GetBuiltinNames by hoising the NoBuiltins argument out of it.
Eli Bendersky [Thu, 11 Jul 2013 16:53:04 +0000 (16:53 +0000)]
Simplify GetBuiltinNames by hoising the NoBuiltins argument out of it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186106 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoObjectiveC arc[qoi]: When due to change of certain methods'
Fariborz Jahanian [Thu, 11 Jul 2013 16:48:06 +0000 (16:48 +0000)]
ObjectiveC arc[qoi]: When due to change of certain methods'
result type, a diagnostic being issued, issue a 'note'
mentioning reason behind the unexpected warning.
// rdar://14121570.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186105 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoImprove detection of trailing return types.
Daniel Jasper [Thu, 11 Jul 2013 14:33:06 +0000 (14:33 +0000)]
Improve detection of trailing return types.

Trailing return types can only occur in declaration contexts.

Before:
  void f() { auto a = b -> c(); }

After:
  void f() { auto a = b->c(); }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186087 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix indentation problem for comments in call chains
Daniel Jasper [Thu, 11 Jul 2013 13:48:16 +0000 (13:48 +0000)]
Fix indentation problem for comments in call chains

Before:
SomeObject
    // Calling someFunction on SomeObject
        .someFunction();

After:
SomeObject
    // Calling someFunction on SomeObject
    .someFunction();

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186085 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoKeep trailing annotations close to their argument.
Daniel Jasper [Thu, 11 Jul 2013 12:34:23 +0000 (12:34 +0000)]
Keep trailing annotations close to their argument.

Before:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(
    aaaaaaaaaaaa);

After:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    GUARDED_BY(aaaaaaaaaaaa);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186077 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPR5066: If a declarator cannot have an identifier, and cannot possibly be
Richard Smith [Thu, 11 Jul 2013 05:10:21 +0000 (05:10 +0000)]
PR5066: If a declarator cannot have an identifier, and cannot possibly be
followed by an identifier, then diagnose an identifier as being a bogus part of
the declarator instead of tripping over it. Improves diagnostics for cases like

  std::vector<const int *p> my_vec;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186061 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDocumentation fixes - the rest of DeclCXX.h:
James Dennett [Thu, 11 Jul 2013 05:01:16 +0000 (05:01 +0000)]
Documentation fixes - the rest of DeclCXX.h:
* More \brief additions/fixes;
* Fix some misleading comments about C++11's explicit conversion operators;
* Mark up some \code examples;
* Add \file documentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186059 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDocumentation cleanup for DeclCXX.h:
James Dennett [Thu, 11 Jul 2013 03:51:36 +0000 (03:51 +0000)]
Documentation cleanup for DeclCXX.h:
* Fixing up \brief summaries (adding some, making some briefer);
* Standardizing on \commands, not @commands;
* Update C++0x references to C++11;
* Fix typos and Doxygen warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186056 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang/test/CodeGen/c11atomics.c: Fix testcase for -Asserts since r186054.
NAKAMURA Takumi [Thu, 11 Jul 2013 03:45:54 +0000 (03:45 +0000)]
clang/test/CodeGen/c11atomics.c: Fix testcase for -Asserts since r186054.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186055 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix build.
Eli Friedman [Thu, 11 Jul 2013 02:28:36 +0000 (02:28 +0000)]
Fix build.

Sorry about that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186054 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a __builtin_addressof that performs the same functionality as the built-in
Richard Smith [Thu, 11 Jul 2013 02:27:57 +0000 (02:27 +0000)]
Add a __builtin_addressof that performs the same functionality as the built-in
& operator (ignoring any overloaded operator& for the type). The purpose of
this builtin is for use in std::addressof, to allow it to be made constexpr;
the existing implementation technique (reinterpret_cast to some reference type,
take address, reinterpert_cast back) does not permit this because
reinterpret_cast between reference types is not permitted in a constant
expression in C++11 onwards.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186053 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake CheckAddressOfOperand a member of Sema so it can be reused by
Richard Smith [Thu, 11 Jul 2013 02:26:56 +0000 (02:26 +0000)]
Make CheckAddressOfOperand a member of Sema so it can be reused by
__builtin_addressof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186052 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify atomic load/store IRGen.
Eli Friedman [Thu, 11 Jul 2013 01:32:21 +0000 (01:32 +0000)]
Simplify atomic load/store IRGen.

Also fixes a couple minor bugs along the way; see testcases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186049 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix some grammar errors.
Richard Smith [Thu, 11 Jul 2013 00:34:42 +0000 (00:34 +0000)]
Fix some grammar errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186048 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix documentation:
Richard Smith [Thu, 11 Jul 2013 00:27:05 +0000 (00:27 +0000)]
Fix documentation:

  #if defined(__has_foo("X")) && __has_foo("X")

is not a correct way to portably use __has_foo, because it is expanded to

  #if 0 && 0("X")

... which is ill-formed.

Also add a missing ')'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186047 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIf we friend a declaration twice, that should not make it visible to name
Richard Smith [Wed, 10 Jul 2013 22:04:13 +0000 (22:04 +0000)]
If we friend a declaration twice, that should not make it visible to name
lookup in the surrounding context. Slightly rework how we handle friend
declarations to inherit the visibility of the prior declaration, rather
than setting a friend declaration to be visible whenever there was a prior
declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186040 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoObjC migrator: Improve on hueristics.
Fariborz Jahanian [Wed, 10 Jul 2013 21:30:22 +0000 (21:30 +0000)]
ObjC migrator: Improve on hueristics.
migrate to 'copy attribute if Object
class implements NSCopying otherwise
assume implied 'strong'. Remove
lifetime qualifier on property as it has
moved to property's attribute. Added TODO
comment for future work by poking into
setter implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186037 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse a LexicalScope here since it is one and it will encapsulate
Eric Christopher [Wed, 10 Jul 2013 20:14:36 +0000 (20:14 +0000)]
Use a LexicalScope here since it is one and it will encapsulate
the two sets of debug scope and cleanup scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186030 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Remove bogus assert: in C++11, 'new' can do list-initialization.
Jordan Rose [Wed, 10 Jul 2013 19:14:10 +0000 (19:14 +0000)]
[analyzer] Remove bogus assert: in C++11, 'new' can do list-initialization.

Previously, we asserted that whenever 'new' did not include a constructor
call, the type must be a non-record type. In C++11, however, uniform
initialization syntax (braces) allow 'new' to construct records with
list-initialization: "new Point{1, 2}".

Removing this assertion should be perfectly safe; the code here matches
what VisitDeclStmt does for regions allocated on the stack.

<rdar://problem/14403437>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186028 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a hook RecursiveASTVisitor::TraverseLambdaBody, to enable visitors to
James Dennett [Wed, 10 Jul 2013 18:29:15 +0000 (18:29 +0000)]
Add a hook RecursiveASTVisitor::TraverseLambdaBody, to enable visitors to
use/maintain additional state from the LambdaExpr while visiting the body
of a LambdaExpr.

One use for this arises because Clang's AST currently holds lambda bodies
in a form prior to their adjustment to refer to captured copies of local
variables, and so some clients will need access to the lambda's closure
type in order to query how to map VarDecl*s to the FieldDecls of their
by-copy captures. This hook is sufficient for at least one such client;
to do this without such a hook would require the client to re-implement
the whole of TraverseLambdaExpr, which is non-trivial and would likely be
more brittle.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186024 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoOffer typo suggestions for 'using' declarations.
Kaelyn Uhrain [Wed, 10 Jul 2013 17:34:22 +0000 (17:34 +0000)]
Offer typo suggestions for 'using' declarations.

Patch courtesy of Luke Zarko <zarko@google.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186019 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd experimental flag for adaptive parameter bin-packing.
Daniel Jasper [Wed, 10 Jul 2013 14:02:49 +0000 (14:02 +0000)]
Add experimental flag for adaptive parameter bin-packing.

This is not activated for any style, might change or go away
completely.

For those that want to play around with it, set
ExperimentalAutoDetectBinPacking to true.

clang-format will then:
Look at whether function calls/declarations/definitions are currently
formatted with one parameter per line (on a case-by-case basis). If so,
clang-format will avoid bin-packing the parameters. If all parameters
are on one line (thus that line is "inconclusive"), clang-format will
make the choice dependent on whether there are other bin-packed
calls/declarations in the same file.

The reason for this change is that bin-packing in some situations can be
really bad and an author might opt to put one parameter on each line. If
the author does that, he might want clang-format not to mess with that.
If the author is unhappy with the one-per-line formatting, clang-format
can easily be convinced to bin-pack by putting any two parameters on the
same line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186003 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed comment of Sema::FindInstantiatedDecl.
Serge Pavlov [Wed, 10 Jul 2013 04:59:14 +0000 (04:59 +0000)]
Fixed comment of Sema::FindInstantiatedDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185997 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFinish off mangling locals in block literals.
Eli Friedman [Wed, 10 Jul 2013 01:33:19 +0000 (01:33 +0000)]
Finish off mangling locals in block literals.

Specifically, handle the case where the block is in a default argument
in a class method.  The mangling here follows what we do for lambdas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185991 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGet rid of dead/useless code for block mangling.
Eli Friedman [Wed, 10 Jul 2013 01:13:27 +0000 (01:13 +0000)]
Get rid of dead/useless code for block mangling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185989 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMore local mangling fixes.
Eli Friedman [Wed, 10 Jul 2013 00:30:46 +0000 (00:30 +0000)]
More local mangling fixes.

Compute mangling numbers for externally visible local variables and tags.
Change the mangler to consistently use discriminators where necessary.
Tweak the scheme we use to number decls which are not externally visible
to avoid unnecessary discriminators in common cases now that we request
them more consistently.

Fixes <rdar://problem/14204721>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185986 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoobjc migrator: More refinment of property
Fariborz Jahanian [Wed, 10 Jul 2013 00:20:11 +0000 (00:20 +0000)]
objc migrator: More refinment of property
attributes in migration. Specialli use of
'copy' attribute for retainable object types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185985 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoApply BlackList -> SpecialCaseList rename in Clang.
Peter Collingbourne [Tue, 9 Jul 2013 22:03:30 +0000 (22:03 +0000)]
Apply BlackList -> SpecialCaseList rename in Clang.

Differential Revision: http://llvm-reviews.chandlerc.com/D1095

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185979 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoObjective-C: merge objc_requires_super attribute of
Fariborz Jahanian [Tue, 9 Jul 2013 22:02:20 +0000 (22:02 +0000)]
Objective-C: merge objc_requires_super attribute of
method declaration into its implementation to
prevent a bogus warning about mismatched attributes.
then make sure the warning about missing call to super comes out
of the method implementation. // rdar://14251387

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185974 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReapply an improved version of r180816/180817.
Adrian Prantl [Tue, 9 Jul 2013 20:29:03 +0000 (20:29 +0000)]
Reapply an improved version of r180816/180817.

Do not generate VLAs as complex variables any more, as they are now
correctly represented as breg+0 locations in the backend.

(Paired commit with LLVM: r185966)

rdar://problem/13658587

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185967 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoObjC migrator: Add -objcmt-migrate-property to do property
Fariborz Jahanian [Tue, 9 Jul 2013 16:59:14 +0000 (16:59 +0000)]
ObjC migrator: Add -objcmt-migrate-property to do property
migration. Also, fixes an old bug where older migration
flags were not being checked for properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185948 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInitial support for formatting trailing return types.
Daniel Jasper [Tue, 9 Jul 2013 14:36:48 +0000 (14:36 +0000)]
Initial support for formatting trailing return types.

This fixes llvm.org/PR15170.

For now, the basic formatting rules are (based on the C++11 standard):
* Surround the "->" with spaces.
* Break before "->".

Also fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185938 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoArrayRef'ize Sema::FinalizeDeclaratorGroup, Sema::BuildDeclaratorGroup and
Rafael Espindola [Tue, 9 Jul 2013 12:05:01 +0000 (12:05 +0000)]
ArrayRef'ize Sema::FinalizeDeclaratorGroup, Sema::BuildDeclaratorGroup and
Sema::ActOnDocumentableDecls.

Patch by Robert Wilhelm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185931 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAvoid confusing indentations for chained function calls.
Daniel Jasper [Tue, 9 Jul 2013 11:57:27 +0000 (11:57 +0000)]
Avoid confusing indentations for chained function calls.

Basically treat a function with a trailing call similar to a function
with multiple parameters.

Before:
  aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa))
      .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();

After:
  aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
                           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa))
      .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();

Also fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185930 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoc-index-test/CMakeLists.txt: Suggest -isystem to include libxml2 with include_directo...
NAKAMURA Takumi [Tue, 9 Jul 2013 11:14:30 +0000 (11:14 +0000)]
c-index-test/CMakeLists.txt: Suggest -isystem to include libxml2 with include_directories(SYSTEM).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185928 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoc-index-test/Makefile: Use -isystem instead of -I on $(LIBXML2_INC) with -Wdocumentation.
NAKAMURA Takumi [Tue, 9 Jul 2013 11:14:24 +0000 (11:14 +0000)]
c-index-test/Makefile: Use -isystem instead of -I on $(LIBXML2_INC) with -Wdocumentation.

-Wdocumentation won't seek -isystem. LIBXML2's headers in a certain distro might be incompatible to -Wdocumentation.

FIXME: Could autoconf detect clang or availability of -isystem?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185927 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix alignment of closing brace in braced initializers.
Daniel Jasper [Tue, 9 Jul 2013 09:06:29 +0000 (09:06 +0000)]
Fix alignment of closing brace in braced initializers.

Before:
someFunction(OtherParam, BracedList{
                           // comment 1 (Forcing intersting break)
                           param1, param2,
                           // comment 2
                           param3, param4
             });
After:
someFunction(OtherParam, BracedList{
                           // comment 1 (Forcing intersting break)
                           param1, param2,
                           // comment 2
                           param3, param4
                         });

To do so, the UnwrappedLineParser now stores the information about the
kind of brace in the FormatToken.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185914 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFormat overloaded operators like other functions.
Daniel Jasper [Tue, 9 Jul 2013 07:43:55 +0000 (07:43 +0000)]
Format overloaded operators like other functions.

This fixes llvm.org/PR16328 (at least partially).

Before:
SomeLoooooooooooooooooooooooooooooogType operator<<(
    const SomeLooooooooogType &a, const SomeLooooooooogType &b);

After:
SomeLoooooooooooooooooooooooooooooogType
operator<<(const SomeLooooooooogType &a, const SomeLooooooooogType &b);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185908 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Fixup for r185609: actually do suppress warnings coming out of std::list.
Anna Zaks [Tue, 9 Jul 2013 01:55:00 +0000 (01:55 +0000)]
[analyzer] Fixup for r185609: actually do suppress warnings coming out of std::list.

list is the name of a class, not a namespace. Change the test as well - the previous
version did not test properly.

Fixes radar://14317928.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185898 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix recovery for missing * in objc property.
Eli Friedman [Tue, 9 Jul 2013 01:38:07 +0000 (01:38 +0000)]
Fix recovery for missing * in objc property.

<rdar://problem/14354144>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185897 91177308-0d34-0410-b5e6-96231b3b80d8