Added a test case for the fix to bug 17632 in r193751

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194212 91177308-0d34-0410-b5e6-96231b3b80d8
PR17615: A delegating constructor initializer is a full-expression. Don't
forget to clean up temporaries at the end of it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194213 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Improve ObjC variadic and binary expression parameters.

Before:
  [self aaaaaaaaaaaaaaa:aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa |
                           aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa |
                           aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa];
  [self aaaaaaaaaaaaaaa:aaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa];

After:
  [self aaaaaaaaaaaaaaa:aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa |
                        aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa |
                        aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa];
  [self aaaaaaaaaaaaaaa:aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa,
                        aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa,
                        aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa];

This addresses llvm.org/PR15349 and llvm.org/PR16185.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194214 91177308-0d34-0410-b5e6-96231b3b80d8
Tests for CWG issue 165-170.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194215 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Improve binary operator detection in macros.

Before:
  #define M(NAME) assert(!Context.Verifying &&#NAME);

After:
  #define M(NAME) assert(!Context.Verifying && #NAME);

This fixes llvm.org/PR16156.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194216 91177308-0d34-0410-b5e6-96231b3b80d8
PR17800: When performing pack expansion, we must always rebuild the AST nodes
to avoid breaking AST invariants by reusing Stmt nodes within the same
function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194217 91177308-0d34-0410-b5e6-96231b3b80d8
Re-introduce MatchFinder::addDynamicMatcher.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194223 91177308-0d34-0410-b5e6-96231b3b80d8
Re-instate contextual conversion to Objective-C pointers in message sends.

When performing an Objective-C message send to a value of class type,
perform a contextual conversion to an Objective-C pointer type. We've
had this for a long time, but it recently regressed. Fixes
<rdar://problem/15234703>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194224 91177308-0d34-0410-b5e6-96231b3b80d8
Modules: Teach the preprocessor to recognize 'import' only after an '@'.

The preprocessor currently recognizes module declarations to load a
module based on seeing the 'import' keyword followed by an
identifier. This sequence is fairly unlikely in C (one would need a
type named 'import'), but is more common in Objective-C (where a
variable named 'import' can cause problems). Since import declarations
currently require a leading '@', recognize that in the preprocessor as
well. Fixes <rdar://problem/15084587>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194225 91177308-0d34-0410-b5e6-96231b3b80d8
 Adds the ability to inject a DiagnosticConsumer into ClangTools.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194226 91177308-0d34-0410-b5e6-96231b3b80d8
Eliminate an unnecessary .c_str()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194228 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Make breaking before ternary operators configurable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194229 91177308-0d34-0410-b5e6-96231b3b80d8
ubsan: Only emit constants for filenames and type descriptors once.

Produces neater IR in significantly less time.

(~18% faster -O0 compile time for sqlite3 with -fsanitize=undefined)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194231 91177308-0d34-0410-b5e6-96231b3b80d8
ObjectiveC migrator. Fixes an obscure bug where
NS_RETURNS_INNER_POINTER ends up unintentionally 
on the @property under -objcmt-migrate-all 
// rdar://15396636


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194233 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Specialize "loop executed 0 times" for for-in and for-range loops.

The path note that says "Loop body executed 0 times" has been changed to
"Loop body skipped when range is empty" for C++11 for-range loops, and to
"Loop body skipped when collection is empty" for Objective-C for-in loops.

Part of <rdar://problem/14992886>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194234 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Track whether an ObjC for-in loop had zero iterations.

An Objective-C for-in loop will have zero iterations if the collection is
empty. Previously, we could only detect this case if the program asked for
the collection's -count /before/ the for-in loop. Now, the analyzer
distinguishes for-in loops that had zero iterations from those with at
least one, and can use this information to constrain the result of calling
-count after the loop.

In order to make this actually useful, teach the checker that methods on
NSArray, NSDictionary, and the other immutable collection classes don't
change the count.

<rdar://problem/14992886>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194235 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Add IdenticalExprChecker, to find copy-pasted code.

This syntactic checker looks for expressions on both sides of comparison
operators that are structurally the same. As a special case, the
floating-point idiom "x != x" for "isnan(x)" is left alone.

Currently this only checks comparison operators, but in the future we could
extend this to include logical operators or chained if-conditionals.

Checker by Per Viberg!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194236 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a bogus assert I introduced in r194224

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194237 91177308-0d34-0410-b5e6-96231b3b80d8
ObjectiveC migrator. Added a dropped check in my
last patch.


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