Fix formatting of complex #if expressions.

Before:
  #if !defined(AAAAAAAAAAAAAAAA) && (defined CCCCCCCC ||                         \
                                     defined DDDDDDDD) && defined(BBBBBBBB)

After:
  #if !defined(AAAAAAAAAAAAAAAA) && (defined CCCCCCCC || defined DDDDDDDD) &&    \
      defined(BBBBBBBB)

This fixes llvm.org/PR15828.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180105 91177308-0d34-0410-b5e6-96231b3b80d8
Make compares unsigned. The expression can't become negative anyways.

Silences a sign compare warning on 32 bit archs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180110 91177308-0d34-0410-b5e6-96231b3b80d8
[libclang] Introduce a CXCursor_ObjCSelfExpr cursor, which is the equivalent of CXCursor_CXXThisExpr for C++ code.

rdar://13717006

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180164 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Refactor BugReport::getLocation and PathDiagnosticLocation::createEndOfPath for greater code reuse

The 2 functions were computing the same location using different logic (each one had edge case bugs that the other
one did not). Refactor them to rely on the same logic.

The location of the warning reported in text/command line output format will now match that of the plist file.

There is one change in the plist output as well. When reporting an error on a BinaryOperator, we use the location of the
operator instead of the beginning of the BinaryOperator expression. This matches our output on command line and
looks better in most cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180165 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Set the allocation site to be the uniqueing location for retain count checker leaks.

The uniqueing location is the location which is part of the hash used to determine if two reports are
the same. This is used by the CmpRuns.py script to compare two analyzer runs and determine which
warnings are new.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180166 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] IvarInvalidation: correctly handle cases where only partial invalidators exist

 - If only partial invalidators exist and there are no full invalidators in @implementation, report every ivar that has
not been invalidated. (Previously, we reported the first Ivar in the list, which could actually have been invalidated
by a partial invalidator. The code assumed you cannot have only partial invalidators.)

- Do not report missing invalidation method declaration if a partial invalidation method declaration exists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180170 91177308-0d34-0410-b5e6-96231b3b80d8
Add some more required SPARC v9 predefined macros.

Solaris/AuroraUX only need __arch64__, the BSDs need the other variants.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180172 91177308-0d34-0410-b5e6-96231b3b80d8
Fix comment alignment behavior.

In the following snippet, clang-format incorrectly aligned the
trailing comment, when only the last line was formatted:

  int aaaaaa; // comment
  int b;
  int c; // Formatting only this line moved this comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180173 91177308-0d34-0410-b5e6-96231b3b80d8
Remove CXCursorSet and related APIs.  There are no known clients.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180174 91177308-0d34-0410-b5e6-96231b3b80d8
Add test case for -Wdeprecated-objc-pointer-introspection, and
tweak warning to suggest that it is just a bad thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180175 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Remove CXCursorSet and related APIs.  There are no known clients."

Apparently there are...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180176 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typo in comparison in clang_CXCursorSet_contains().

Fixes PR 10124.

Patch by Jens Kilian.

Thanks to Nikola Smiljanic for following up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180177 91177308-0d34-0410-b5e6-96231b3b80d8
Release note the change to clang_CXCursorSet_contains().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180178 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Refactoring + explanatory comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180181 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format support for multiple input files.

Summary:
Added support for multiple input files, that can be used both with and
without in-place edit (-i) option. Added checks for -offset and -length options:
don't allow them on multiple files, check that they don't fall outside input
file, made both options unsigned, so that there's no need to check for negative
values. Removed "-1 can be used for end-of-file" from -length description.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180185 91177308-0d34-0410-b5e6-96231b3b80d8
Flip flag to merge short if-statements into one line for Google style.

This now allows clang-format to do:
if (a) return;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180187 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C: When reporting on missing property accessor implementation in
categories, do not report when they are declared in primary class,
class's protocol, or one of it super classes. This is because,
its class is going to implement them. // rdar://13713098


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180198 91177308-0d34-0410-b5e6-96231b3b80d8
[driver] Add a hasFlag API that accepts a positive alias.
Part of rdar://13622687

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180203 91177308-0d34-0410-b5e6-96231b3b80d8
[driver] Improve the implementation of the -Ofast option.

Specifically, allow the flags that fall under this umbrella (i.e., -O3,
-ffast-math, and -fstrict-aliasing) to be overridden/disabled with the
individual -O[0|1|2|s|z]/-fno- flags.

This also fixes the handling of various floating point optimization
flags that are modified by -ffast-math (and thus -Ofast as well).
Part of rdar://13622687

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