Fix for corner cases in code handling leading "* " decorations in block comments

Summary:
Fixes problems that lead to incorrect formatting of these and similar snippets:
/*
 **
 */

/*
 **/

/*
 * */

/*
 *test
 */

Clang-format used to think that all the cases above use "* " decoration, and
failed to calculate insertion position properly. It also used to remove leading 
"* " in the last line.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

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

git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@185818 91177308-0d34-0410-b5e6-96231b3b80d8
Fix use of invalidated iterator bug in AST match finder.

Pulled out the cache clearing in the case of descendant matching, too,
for consistency, also it is not technically needed there.

FIXME: Make cache size configurable and add unit test.

git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@185820 91177308-0d34-0410-b5e6-96231b3b80d8
Prefer similar line breaks.

This adds a penalty for clang-format for each break that occurs in
a set of parentheses (including fake parenthesis that determine
the range of certain operator precendences) that have not yet been
broken. Thereby, clang-format prefers similar line breaks.

This fixes llvm.org/PR15506.

Before:
const int kTrackingOptions =
    NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited |
    NSTrackingActiveAlways;

After:
const int kTrackingOptions = NSTrackingMouseMoved |
                             NSTrackingMouseEnteredAndExited |
                             NSTrackingActiveAlways;

Also removed ParenState::ForFakeParenthesis which has become unused.

git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@185822 91177308-0d34-0410-b5e6-96231b3b80d8
Reformat clang-format's source files after r185822 and others.

git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@185823 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed testcase failing under MS by adding "-fno-delayed-template-parsing",
as suggested by Takumi. To this end, added a MatchVerifier::match()
overload accepting a vector of invocation arguments.



git-svn-id: http://llvm.org/svn/llvm-project/cfe/trunk@185827 91177308-0d34-0410-b5e6-96231b3b80d8
Fix incorrect incorrect cast identification in clang-format.

This fixes llvm.org/PR16534.

Before:
aaaaa& operator+(const aaaaa&)LLVM_DELETED_FUNCTION;
After:
aaaaa& operator+(const aaaaa&) LLVM_DELETED_FUNCTION;

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