Updating Subjects definitions for attributes based on semantic handling. Removes Subjects for things we cannot currently check, adds Subjects for things we can, and rectifies most discrepancies. Since Subjects are not currently handled in tablegen, there are no functional changes with this patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195508 91177308-0d34-0410-b5e6-96231b3b80d8
Make the negative test more specific.

Summary:
Make the negative test more specific.
Otherwise it can accidentally match injected code.

Reviewers: aaron.ballman

CC: klimek, cfe-commits, revane

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195512 91177308-0d34-0410-b5e6-96231b3b80d8
ObjectiveC. Remove warning diagnostic which checks
attribute on method declaration and implementation
match. This makes no sense. Most annotations are
meant for declarations only and one is for implementation.
This has been constant source of regresions and hackery to
get around special cases. I am removing this check.
Such checks must be done on a case by case basis and
when it makes sense. For example, it makes sense
for availability/deprecated and I will file a radar
for that. // rdar://15531984


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195524 91177308-0d34-0410-b5e6-96231b3b80d8
Remove uninstantiable constructor from DeclTemplate.h

Patch by Kim Gräsman!

Laszlo Nagy and me both ran into the same issue with SpecIterator from DeclTemplate.h causing an error:

tools/clang/include/clang/AST/DeclTemplate.h:560:22: error:
      no matching constructor for initialization of 'SetIteratorType' (aka
      'FoldingSetVectorIterator<clang::FunctionTemplateSpecializationInfo,
      typename SmallVector<FunctionTemplateSpecializationInfo *, 8>::iterator>')
    SpecIterator() : SetIter() {}

(see e.g. http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-November/033642.html)

The problem is the SpecIterator default constructor which needs a non-existent SetIter default constructor. SpecIterator's default constructor is evidently dead code as any call to it would fail with the above error.

This patch removes it.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195526 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r195526, "Remove uninstantiable constructor from DeclTemplate.h"

It apparently causes some versions of GCC to segfault.
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/17175/steps/build_clang/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195529 91177308-0d34-0410-b5e6-96231b3b80d8
Change ObjCIntefaceDecl::lookupMethod() to have optional 'followsSuper' argument.

This enables a micro-optimization in protocol conformance checking
to not examine the class hierarchy twice per method.

As part of this change, remove the default arguments from lookupInstanceMethod()
and lookupClassMethod().  It was becoming very redundant.  For clients
needing the default arguments, have them use the full API instead of
these convenience methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195532 91177308-0d34-0410-b5e6-96231b3b80d8
Add back experimental attribute objc_suppress_protocol_methods (slightly renamed).

This is still an experimental attribute, but I wanted it in tree
for review.  It may still get yanked.

This attribute can only be applied to a class @interface, not
a class extension or category.  It does not change the type
system rules for Objective-C, but rather the implementation checking
for Objective-C classes that explicitly conform to a protocol.
During protocol conformance checking, clang recursively searches
up the class hierarchy for the set of methods that compose
a protocol.  This attribute will cause the compiler to not consider
the methods contributed by a super class, its categories, and those
from its ancestor classes.  Thus this attribute is used to force
subclasses to redeclare (and hopefully re-implement) methods if
they decide to explicitly conform to a protocol where some of those
methods may be provided by a super class.

This attribute intentionally leaves out properties, which are associated
with state.  This attribute only considers methods (at least right now)
that are non-property accessors.  These represent methods that "do something"
as dictated by the protocol.  This may be further refined, and this
should be considered a WIP until documentation gets written or this
gets removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195533 91177308-0d34-0410-b5e6-96231b3b80d8
Split registry matcher resolution into a lookup phase and a construction phase.

The looked-up matchers will be used during code completion.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195534 91177308-0d34-0410-b5e6-96231b3b80d8
Rename *MatcherCreateCallback to *MatcherDescriptor, and its member run() to create().

The new names will be more appropriate when the objects are taught to return
type information for the code completer.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195539 91177308-0d34-0410-b5e6-96231b3b80d8
Add Distance parameter to ASTNodeKind::isBaseOf.

This will allow the completer to order results by relevance.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195540 91177308-0d34-0410-b5e6-96231b3b80d8
Generate a marker token when entering or leaving a submodule when building a
module. Use the marker to diagnose cases where we try to transition between
submodules when not at the top level (most likely because a closing brace was
missing at the end of a header file, but is also possible if submodule headers
attempt to do something fundamentally non-modular, like our .def files).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195543 91177308-0d34-0410-b5e6-96231b3b80d8
Fix module name collision in tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195545 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Prefer column layout if possible.

Add a severe penalty for not using column layout for braced lists. If
there are solutions with column layout, these are generally preferable
over bin-packed solutions.

Before:
  std::vector<MyValues> aaaaaaaaaaaaaaaaaaa{ aaaaaaa, aaaaaaaaaa, aaaaa,
                                             aaaaaaaaaaaaaaa, aaa, aaaaaaaaaa, a,
                                             aaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaa,
                                             aaaaaaaaaaaaaaaaaaa +
                                                 aaaaaaaaaaaaaaaaaaa,
                                             aaaaaaa, a };
After:
  std::vector<MyValues> aaaaaaaaaaaaaaaaaaa{
    aaaaaaa,      aaaaaaaaaa,
    aaaaa,        aaaaaaaaaaaaaaa,
    aaa,          aaaaaaaaaa,
    a,            aaaaaaaaaaaaaaaaaaaaa,
    aaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaa,
    aaaaaaa,      a
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195546 91177308-0d34-0410-b5e6-96231b3b80d8
Enable non-fragile ABI for the ObjFW runtime

The following patch enables the non-fragile ABI for the ObjFW runtime.

However, I noticed that it is not possible anymore to disable it with
-fno-objc-nonfragile-abi like it was before. I think this functionality should
be restored, but I guess this is not in scope for 3.4 anymore.

Patch by Jonathan Schleifer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195547 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Fix bug in ObjC method declaration formatting.

Also disallow breaking between "@" and "{" or "[".

Before:
  - (NSAttributedString *)attributedStringForSegment:(NSUInteger)segment
                                               index:(NSUInteger)index
                                          attributes:(NSDictionary *)attributes
                                  nonDigitAttributes:(NSDictionary *)
      nonDigitAttributes;
  [mailComposeViewController
     setToRecipients:@
     [ NSBundle.mainBundle.infoDictionary[@"ABBFeedbackEmail"] ]];

After:
  - (NSAttributedString *)attributedStringForSegment:(NSUInteger)segment
                                               index:(NSUInteger)index
                                          attributes:(NSDictionary *)attributes
                                  nonDigitAttributes:
                                      (NSDictionary *)nonDigitAttributes;
  [mailComposeViewController
      setToRecipients:
          @[ NSBundle.mainBundle.infoDictionary[@"ABBFeedbackEmail"] ]];

This fixes llvm.org/PR18030.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195550 91177308-0d34-0410-b5e6-96231b3b80d8
Don't pass +soft-float, +soft-float-abi to the arm assembler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195551 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: The "<" of a template argument is not a binary operator.

With Style.BreakBeforeBinaryOperators, clang-format breaks incorrectly.
This fixes llvm.org/PR17994.

Before:
  return boost::fusion::at_c<0>(iiii).second == boost::fusion::at_c
                                                <1>(iiii).second;

After:
  return boost::fusion::at_c<0>(iiii).second ==
         boost::fusion::at_c<1>(iiii).second;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195552 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Fix incorrect space in parameters named by comment.

This fixes llvm.org/PR17979.

Before:
  void f() { g(/*aaa=*/x, /*bbb=*/ !y); }

After:
  void f() { g(/*aaa=*/x, /*bbb=*/!y); }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195553 91177308-0d34-0410-b5e6-96231b3b80d8
Don't use the gcc driver for assembling.

Clang knows how to use the gnu assembler directly from doing so on linux and
hurd. The existing support worked out of the box on cygwin and mingw and I was
able to bootstrap clang with it in both systems (with pending patches for the
new mingw abi, but that is independent of the assembler).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195554 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Support Qt's slot access specifiers.

This fixes llvm.org/PR17241.

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