]> granicus.if.org Git - clang/log
clang
11 years agoObjectiveC migrator: Remove semicolon after the typedef
Fariborz Jahanian [Thu, 18 Jul 2013 22:17:33 +0000 (22:17 +0000)]
ObjectiveC migrator: Remove semicolon after the typedef
declaration when converting to NS_ENUM. This required
some code refactoring.

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

11 years agoAddress -Wreorder warning in Driver.cpp
Hans Wennborg [Thu, 18 Jul 2013 21:45:42 +0000 (21:45 +0000)]
Address -Wreorder warning in Driver.cpp

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

11 years agoTurn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,
Hans Wennborg [Thu, 18 Jul 2013 20:29:38 +0000 (20:29 +0000)]
Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,
and add a new option --driver-mode= to control it explicitly.

The CCCIsCXX and CCCIsCPP flags were non-overlapping, i.e. there
are currently really three modes that Clang can run in: gcc, g++
or cpp, so it makes sense to represent them as an enum.

Having a command line flag to control it helps testing.

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

11 years agoObjectiveC migration. migration to NS_ENUM/SN_OPTION
Fariborz Jahanian [Thu, 18 Jul 2013 20:11:45 +0000 (20:11 +0000)]
ObjectiveC migration. migration to NS_ENUM/SN_OPTION
- wip.

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

11 years ago[Driver] Use LLVM's response file parser because it can read UTF-16
Reid Kleckner [Thu, 18 Jul 2013 20:00:53 +0000 (20:00 +0000)]
[Driver] Use LLVM's response file parser because it can read UTF-16

MSBuild writes response files as UTF-16 little endian with a byte order
mark.  With this change, clang will be able to read them, although we
still can't parse any of their flags.

Adds a UTF-16-LE response file with a BOM for testing.

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

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

11 years agoSeparate the notion of 'context' when recursing down in the parser and actual errors.
Samuel Benzaquen [Thu, 18 Jul 2013 19:47:59 +0000 (19:47 +0000)]
Separate the notion of 'context' when recursing down in the parser and actual errors.

Summary:
Change how error messages are constructed and stored in Diagnostics.
Separate the notion of 'context' when recursing down in the parser and actual errors.
This will simplify adding some new features, like argument overloading and error recovery.

Reviewers: klimek

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

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

11 years agoChanged declarations from Attr to InheritableAttr as they are already being processed...
Aaron Ballman [Thu, 18 Jul 2013 19:11:29 +0000 (19:11 +0000)]
Changed declarations from Attr to InheritableAttr as they are already being processed that way semantically.

Patch thanks to Dean Sutherland!  Reviewed by Eli Friedman.

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

11 years agoSwitching to use checkAttributeNumArgs for trivial cases. No functional changes...
Aaron Ballman [Thu, 18 Jul 2013 18:01:48 +0000 (18:01 +0000)]
Switching to use checkAttributeNumArgs for trivial cases.  No functional changes intended.

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

11 years agoTest contents were somehow duplicated, resulting in any testcase that fails automatic...
Aaron Ballman [Thu, 18 Jul 2013 17:41:26 +0000 (17:41 +0000)]
Test contents were somehow duplicated, resulting in any testcase that fails automatically failing twice.  Removing the duplicates.

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

11 years agoReplacing a morally duplicate diagnostic by adding it to an existing diagnostic's...
Aaron Ballman [Thu, 18 Jul 2013 14:56:42 +0000 (14:56 +0000)]
Replacing a morally duplicate diagnostic by adding it to an existing diagnostic's select list.  Updates the tests for the more consistent diagnostic.

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

11 years agoclang-format: Fix bad line break with pointers to members.
Daniel Jasper [Thu, 18 Jul 2013 14:46:07 +0000 (14:46 +0000)]
clang-format: Fix bad line break with pointers to members.

Before:
  void f() {
    (a->*
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(aaaa,
                                           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
  }

After:
  void f() {
    (a->*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
        aaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
  }

Also add missing test case.

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

11 years agoFix crash in libclang if code completion is used with unknown flags.
Manuel Klimek [Thu, 18 Jul 2013 14:23:12 +0000 (14:23 +0000)]
Fix crash in libclang if code completion is used with unknown flags.

Use CaptureDroppedDiagnostics to make sure that there is a diagnostic
client installed when warning flags are parsed.

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

11 years agoRemoved a parameter from handleAttrWithMessage to make it more consistent with other...
Aaron Ballman [Thu, 18 Jul 2013 13:13:52 +0000 (13:13 +0000)]
Removed a parameter from handleAttrWithMessage to make it more consistent with other attribute handlers, as well as other attribute error messages.  Added missing test cases for the unavailable attribute, and updated the deprecated test case.

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

11 years agoFix volatile _Complex alignment test on platforms where 64-bit floating point isn...
JF Bastien [Thu, 18 Jul 2013 06:11:45 +0000 (06:11 +0000)]
Fix volatile _Complex alignment test on platforms where 64-bit floating point isn't 64-bit aligned

Add x86-64 triple, and check its datalayout. Also add some comments, and use the new CHECK-LABEL.

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

11 years agos/BuiltinLocation/ArtificialLocation/
Adrian Prantl [Thu, 18 Jul 2013 01:36:04 +0000 (01:36 +0000)]
s/BuiltinLocation/ArtificialLocation/

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

11 years agoInstead of checking against some version of "isType()" go ahead and
Eric Christopher [Thu, 18 Jul 2013 00:52:50 +0000 (00:52 +0000)]
Instead of checking against some version of "isType()" go ahead and
use the conversion to bool to check if we've managed to get a type
that isn't default constructed - as we meant to in the first place.

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

11 years agoFix a compile error caught by bb-chapuni.
Adrian Prantl [Thu, 18 Jul 2013 00:47:12 +0000 (00:47 +0000)]
Fix a compile error caught by bb-chapuni.

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

11 years agoFix a compile error caught by bb-chapuni.
Adrian Prantl [Thu, 18 Jul 2013 00:43:29 +0000 (00:43 +0000)]
Fix a compile error caught by bb-chapuni.

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

11 years agoDon't generate bogus line table entries for __copy_helper_block_ and
Adrian Prantl [Thu, 18 Jul 2013 00:28:05 +0000 (00:28 +0000)]
Don't generate bogus line table entries for __copy_helper_block_ and
__destroy_helper_block_, but do generate scope information.

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

11 years agoReplace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces
Adrian Prantl [Thu, 18 Jul 2013 00:28:02 +0000 (00:28 +0000)]
Replace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces
inspired by CodegenFunction::LexicalScope.
- NoLocation temporarily turns off debug locations altogether.
  This is useful for emitting instructions that should be
  counted towards the function prologue.
- BuiltinLocation temporarily switches to an artificial debug location
  that has a valid scope, but no line information. This is useful when
  emitting compiler-generated helper functions that have no source
  location associated with them.

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

11 years agoClarified documentation.
Adrian Prantl [Thu, 18 Jul 2013 00:27:59 +0000 (00:27 +0000)]
Clarified documentation.

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

11 years agoSimplify logic by using the appropriate function.
Adrian Prantl [Thu, 18 Jul 2013 00:27:56 +0000 (00:27 +0000)]
Simplify logic by using the appropriate function.

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

11 years agoAdd condition expression result to if and elif callbacks.
John Thompson [Thu, 18 Jul 2013 00:00:36 +0000 (00:00 +0000)]
Add condition expression result to if and elif callbacks.

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

11 years agoReinstate r186040, with additional fixes and more test coverage (reverted in
Richard Smith [Wed, 17 Jul 2013 23:53:16 +0000 (23:53 +0000)]
Reinstate r186040, with additional fixes and more test coverage (reverted in
r186331).

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@186546 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago80-column fixes.
Eric Christopher [Wed, 17 Jul 2013 22:52:53 +0000 (22:52 +0000)]
80-column fixes.

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

11 years agoEven more code conformance.
Robert Wilhelm [Wed, 17 Jul 2013 21:14:35 +0000 (21:14 +0000)]
Even more code conformance.

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

11 years agoMS wide bitfield error check in Sema
Reid Kleckner [Wed, 17 Jul 2013 20:46:03 +0000 (20:46 +0000)]
MS wide bitfield error check in Sema

cl.exe treats wide bitfields as an error. This patch causes them to be
an error if IsMsStruct is true, as it is in straight C.

Patch by Warren Hunt!

Reviewers: eli.friedman

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

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

11 years agoclang-format: Add space in corner case.
Daniel Jasper [Wed, 17 Jul 2013 20:25:02 +0000 (20:25 +0000)]
clang-format: Add space in corner case.

Before:
  SomeType s __attribute__((unused))(InitValue);
After:
  SomeType s __attribute__((unused)) (InitValue);

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

11 years agoConstify Replacements parameter to applyAllReplacements.
David Blaikie [Wed, 17 Jul 2013 18:29:58 +0000 (18:29 +0000)]
Constify Replacements parameter to applyAllReplacements.

http://llvm-reviews.chandlerc.com/D1169

Patch by Guillaume Papin.

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

11 years agoImprove idiomatic-parentheses by checking method family instead of relying on the...
Jean-Daniel Dupas [Wed, 17 Jul 2013 18:17:14 +0000 (18:17 +0000)]
Improve idiomatic-parentheses by checking method family instead of relying on the selector name.

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

11 years agoSemaDeclCXX.cpp: Dissolve a ligature "fi" in comment.
NAKAMURA Takumi [Wed, 17 Jul 2013 17:57:52 +0000 (17:57 +0000)]
SemaDeclCXX.cpp: Dissolve a ligature "fi" in comment.

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

11 years agoFixed source range of C++03 access declarations.
Enea Zaffanella [Wed, 17 Jul 2013 17:28:56 +0000 (17:28 +0000)]
Fixed source range of C++03 access declarations.

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

11 years ago[analyzer] Handle C++11 member initializer expressions.
Jordan Rose [Wed, 17 Jul 2013 17:16:42 +0000 (17:16 +0000)]
[analyzer] Handle C++11 member initializer expressions.

Previously, we would simply abort the path when we saw a default member
initialization; now, we actually attempt to evaluate it. Like default
arguments, the contents of these expressions are not actually part of the
current function, so we fall back to constant evaluation.

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

11 years ago[analyzer] Handle C string default values for const char * arguments.
Jordan Rose [Wed, 17 Jul 2013 17:16:38 +0000 (17:16 +0000)]
[analyzer] Handle C string default values for const char * arguments.

Previously, SValBuilder knew how to evaluate StringLiterals, but couldn't
handle an array-to-pointer decay for constant values. Additionally,
RegionStore was being too strict about loading from an array, refusing to
return a 'char' value from a 'const char' array. Both of these have been
fixed.

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

11 years ago[analyzer] Treat std::initializer_list as opaque rather than aborting.
Jordan Rose [Wed, 17 Jul 2013 17:16:33 +0000 (17:16 +0000)]
[analyzer] Treat std::initializer_list as opaque rather than aborting.

Previously, the use of a std::initializer_list (actually, a
CXXStdInitializerListExpr) would cause the analyzer to give up on the rest
of the path. Now, it just uses an opaque symbolic value for the
initializer_list and continues on.

At some point in the future we can add proper support for initializer_list,
with access to the elements in the InitListExpr.

<rdar://problem/14340207>

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

11 years agoOption parsing tables: remove some unnecessary #defines
Hans Wennborg [Wed, 17 Jul 2013 16:54:06 +0000 (16:54 +0000)]
Option parsing tables: remove some unnecessary #defines

Also make some strings static and add missing #undef's

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

11 years agoImprove line breaking before multi-line strings.
Daniel Jasper [Wed, 17 Jul 2013 15:38:19 +0000 (15:38 +0000)]
Improve line breaking before multi-line strings.

The AlwaysBreakBeforeMultilineStrings rule does not really make sense
if it does not a column gain.

Before (in Google style):
  f(
      "aaaa"
      "bbbb");

After:
  f("aaaa"
    "bbbb");

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

11 years agoAdd TemplateArgument related matchers to the registry.
Samuel Benzaquen [Wed, 17 Jul 2013 15:11:30 +0000 (15:11 +0000)]
Add TemplateArgument related matchers to the registry.

Summary:
Continue adding more matchers to the dynamic registry.
This time, we add TemplateArgument matchers.

Reviewers: klimek

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

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

11 years agoAdd CXXCtorInitializer related matchers to the dynamic matcher registry.
Samuel Benzaquen [Wed, 17 Jul 2013 14:28:00 +0000 (14:28 +0000)]
Add CXXCtorInitializer related matchers to the dynamic matcher registry.

Summary: Now that CXXCtorInitializer is already supported in ASTNodeKind, add CXXCtorInitializer matchers to the dynamic matcher registry.

Reviewers: klimek

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

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

11 years agoReplace TEST* with CHECK-DAG in vbtable tests
Timur Iskhodzhanov [Wed, 17 Jul 2013 12:23:51 +0000 (12:23 +0000)]
Replace TEST* with CHECK-DAG in vbtable tests

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

11 years ago[analyzer] Add very limited support for temporary destructors
Pavel Labath [Wed, 17 Jul 2013 08:33:58 +0000 (08:33 +0000)]
[analyzer] Add very limited support for temporary destructors

Summary:
This patch enables ExprEndgine to reason about temporary object destructors.
However, these destructor calls are never inlined, since this feature is still
broken. Still, this is sufficient to properly handle noreturn temporary
destructors and close bug #15599. I have also enabled the cfg-temporary-dtors
analyzer option by default.

Reviewers: jordan_rose

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1131

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

11 years agoclang/test/CodeGen/volatile-complex.c: Loosen CHECKs for -Asserts.
NAKAMURA Takumi [Wed, 17 Jul 2013 06:39:40 +0000 (06:39 +0000)]
clang/test/CodeGen/volatile-complex.c: Loosen CHECKs for -Asserts.

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

11 years agoPropagate alignment for _Complex
JF Bastien [Wed, 17 Jul 2013 05:57:42 +0000 (05:57 +0000)]
Propagate alignment for _Complex

_Complex load/store didn't have their alignment set properly, which was visible when GCC's torture tests use volatile _Complex.

Update some existing tests to check for alignment, and add a new test which also has over-aligned volatile _Complex (since the imaginary part shouldn't be overaligned, only the real part).

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

11 years agoUse the simpler is_directory.
Rafael Espindola [Wed, 17 Jul 2013 04:23:07 +0000 (04:23 +0000)]
Use the simpler is_directory.

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

11 years agoMore code conformance.
Fariborz Jahanian [Wed, 17 Jul 2013 00:05:08 +0000 (00:05 +0000)]
More code conformance.

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

11 years agoObjectiveC migrator: When adding conforming protocol,
Fariborz Jahanian [Wed, 17 Jul 2013 00:02:22 +0000 (00:02 +0000)]
ObjectiveC migrator: When adding conforming protocol,
only add outer-most conforming protocols as adding
others are redundant.

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

11 years agoAvoid breaking non-trailing block comments.
Alexander Kornienko [Tue, 16 Jul 2013 23:47:22 +0000 (23:47 +0000)]
Avoid breaking non-trailing block comments.

Motivating example:
// column limit ------------------->
void ffffffffffff(int aaaaaa /* test */);

Formatting before the patch:
void ffffffffffff(int aaaaaa /* test
                              */);

Formatting after the patch:
void
ffffffffffff(int aaaaaa /* test */);

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

11 years agoFollow coding convention in argument decl.
Fariborz Jahanian [Tue, 16 Jul 2013 23:01:33 +0000 (23:01 +0000)]
Follow coding convention in argument decl.

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

11 years agoMake Expr::isConstantInitializer match IRGen.
Eli Friedman [Tue, 16 Jul 2013 22:40:53 +0000 (22:40 +0000)]
Make Expr::isConstantInitializer match IRGen.

Sema needs to be able to accurately determine what will be
emitted as a constant initializer and what will not, so
we get accurate errors in C and accurate -Wglobal-constructors
warnings in C++.  This makes Expr::isConstantInitializer match
CGExprConstant as closely as possible.

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

11 years ago[arcmt] Remove some dead code.
Argyrios Kyrtzidis [Tue, 16 Jul 2013 22:24:06 +0000 (22:24 +0000)]
[arcmt] Remove some dead code.

Patch by Rafael Espíndola.

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

11 years agoObjectiveC migrator. If a class implements a protocol's
Fariborz Jahanian [Tue, 16 Jul 2013 21:59:42 +0000 (21:59 +0000)]
ObjectiveC migrator. If a class implements a protocol's
properties, then class conforms to that protocol.

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

11 years agoDon't break line comments with escaped newlines.
Alexander Kornienko [Tue, 16 Jul 2013 21:06:13 +0000 (21:06 +0000)]
Don't break line comments with escaped newlines.

Summary:
These can appear when comments contain command lines with quoted line
breaks. As the text (including escaped newlines and '//' from consecutive lines)
is a single line comment, we used to break it even when it didn't exceed column
limit. This is a temporary solution, in the future we may want to support this
case completely - at least adjust leading whitespace when changing indentation
of the first line.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1146

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

11 years agoclang-format: Improve handling of unterminated string literals.
Daniel Jasper [Tue, 16 Jul 2013 20:28:33 +0000 (20:28 +0000)]
clang-format: Improve handling of unterminated string literals.

Before, clang-format would simply eat these as they were recognized as
whitespace. With this patch, they are mostly left alone.

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

11 years agoFix crash on complex constant zero.
Eli Friedman [Tue, 16 Jul 2013 20:19:04 +0000 (20:19 +0000)]
Fix crash on complex constant zero.

Fixes <rdar://problem/14442543>.

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

11 years agoUpdate for llvm API change.
Rafael Espindola [Tue, 16 Jul 2013 19:44:23 +0000 (19:44 +0000)]
Update for llvm API change.

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

11 years agoObjectiveC migration: complete migrating class
Fariborz Jahanian [Tue, 16 Jul 2013 18:58:41 +0000 (18:58 +0000)]
ObjectiveC migration: complete migrating class
declaration to include list of protocols class
conforms to.

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

11 years agoFileCheckize test/Driver/immediate-options.c
Hans Wennborg [Tue, 16 Jul 2013 18:27:29 +0000 (18:27 +0000)]
FileCheckize test/Driver/immediate-options.c

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

11 years agoFix formatting. No functional change.
Craig Topper [Tue, 16 Jul 2013 18:27:27 +0000 (18:27 +0000)]
Fix formatting. No functional change.

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

11 years agoRevamp the formatting of C++11 braced init lists.
Daniel Jasper [Tue, 16 Jul 2013 18:22:10 +0000 (18:22 +0000)]
Revamp the formatting of C++11 braced init lists.

The fundamental concept is:
Format as if the braced init list was a function call (with parentheses
replaced by braces). If there is no name/type before the opening brace
(e.g. if the braced list is nested), assume a zero-length identifier
just before the opening brace.

This behavior is gated on a new style flag, which for now replaces the
SpacesInBracedLists style flag. Activate this style flag for Google
style to reflect recent style guide changes.

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

11 years agoAdd more types to ASTNodeKind. Refactor common instantiation code.
Samuel Benzaquen [Tue, 16 Jul 2013 15:47:24 +0000 (15:47 +0000)]
Add more types to ASTNodeKind. Refactor common instantiation code.

Summary:
Add support for CXXCtorInitializer and TemplateArgument types to ASTNodeKind.
This change is to support more matchers from clang/ASTMatchers/ASTMatchers.h in the dynamic layer (clang/ASTMatchers/Dynamic).

Reviewers: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1143

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

11 years agoThis patch removes unused parameter allProperties and converts remaining
Fariborz Jahanian [Tue, 16 Jul 2013 15:33:19 +0000 (15:33 +0000)]
This patch removes unused parameter allProperties and converts remaining
parameters in ArrayRef'ize Sema::ActOnAtEnd  to ArrayRef.
Patch by Robert Wilhelm.

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

11 years agoRemove unnecessary assignment.
Manuel Klimek [Tue, 16 Jul 2013 13:58:44 +0000 (13:58 +0000)]
Remove unnecessary assignment.

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

11 years agoFixes another hard to test problem with iterator invalidation.
Manuel Klimek [Tue, 16 Jul 2013 13:20:30 +0000 (13:20 +0000)]
Fixes another hard to test problem with iterator invalidation.

As every match call can recursively call back into the memoized match
via a nested traversal matcher (for example:
stmt(hasAncestor(stmt(hasDescendant(stmt(hasDescendant(stmt()))))))),
and every memoization step might clear the cache, we must not store
iterators into the result cache when calling match on a submatcher.

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

11 years agoclang-format: Improve detection of function types.
Daniel Jasper [Tue, 16 Jul 2013 11:37:21 +0000 (11:37 +0000)]
clang-format: Improve detection of function types.

This fixes an incorrect detection that led to a formatting error.
Before:
  some_var = function (*some_pointer_var)[0];
After:
  some_var = function(*some_pointer_var)[0];

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

11 years agoFix test on release builds.
Tim Northover [Tue, 16 Jul 2013 10:22:19 +0000 (10:22 +0000)]
Fix test on release builds.

Unfortunately I don't think there's a good way to validate branch targets on
release builds. Fortunately it's a minor part of this test (and based on
generic code) so I don't mind dropping it.

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

11 years agoARM: implement low-level intrinsics for the atomic exclusive operations.
Tim Northover [Tue, 16 Jul 2013 09:47:53 +0000 (09:47 +0000)]
ARM: implement low-level intrinsics for the atomic exclusive operations.

This adds three overloaded intrinsics to Clang:
    T __builtin_arm_ldrex(const volatile T *addr)
    int __builtin_arm_strex(T val, volatile T *addr)
    void __builtin_arm_clrex()

The intent is that these do what users would expect when given most sensible
types. Currently, "sensible" translates to ints, floats and pointers.

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

11 years agoLimit number of bits in size representation so that bit size fit 64 bits.
Serge Pavlov [Tue, 16 Jul 2013 07:14:18 +0000 (07:14 +0000)]
Limit number of bits in size representation so that bit size fit 64 bits.
This fixes PR8256 and some others.

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

11 years agoAdd 'const' qualifiers to static const char* variables.
Craig Topper [Tue, 16 Jul 2013 05:03:10 +0000 (05:03 +0000)]
Add 'const' qualifiers to static const char* variables.

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

11 years agoMerge attributes on typedef decls.
Eli Friedman [Tue, 16 Jul 2013 02:07:49 +0000 (02:07 +0000)]
Merge attributes on typedef decls.

Not completely sure this is right, but it's clearly better than what
we did before this commit (effectively dropping the attribute).

<rdar://problem/14413117>

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

11 years agoFix alignment of class derived from empty class.
Eli Friedman [Tue, 16 Jul 2013 00:21:28 +0000 (00:21 +0000)]
Fix alignment of class derived from empty class.

The record layout code didn't properly take into account that
an empty class at offset 0 can have an alignment greater than 1.

Patch by Andrea Di Biagio.

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

11 years agoObjC migrator: build conforming interface
Fariborz Jahanian [Tue, 16 Jul 2013 00:20:21 +0000 (00:20 +0000)]
ObjC migrator: build conforming interface
declaration (not yet used). wip.

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

11 years agoFix member refs with using decl + anonymous union.
Eli Friedman [Tue, 16 Jul 2013 00:01:31 +0000 (00:01 +0000)]
Fix member refs with using decl + anonymous union.

Make sure we call BuildFieldReferenceExpr with the appropriate decl
when a member of an anonymous union is made public with a using decl.
Also, fix a crash on invalid field access into an anonymous union.

Fixes PR16630.

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

11 years agoTest case for r18266 (serialization support for TagDecl:IsCompleteDefinitionRequired)
David Blaikie [Mon, 15 Jul 2013 21:33:26 +0000 (21:33 +0000)]
Test case for r18266 (serialization support for TagDecl:IsCompleteDefinitionRequired)

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

11 years agoObjC migrator: finding conforming protocol
Fariborz Jahanian [Mon, 15 Jul 2013 21:22:08 +0000 (21:22 +0000)]
ObjC migrator: finding conforming protocol
candidates for each class. wip.

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

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