Fix a gcc warning.

In r181677 I removed this llvm_unreachable and it introduced a gcc
warning. Add it back.

Thanks to Patrik Hägglund for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181704 91177308-0d34-0410-b5e6-96231b3b80d8
Fix test/CodeGenCXX/captured-statements.cpp on powerpc64

Generalize some attributes that differ on powerpc64 (i32 vs signext i32). Also
fix some copy-and-pasted code that didn't get updated properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181707 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C error recovery. This patch makes a quick
recovery form duplicate method definition error thus
preventing doc parsing to loop trying to find comment
for the invalid redefinition in a previous declaration.
// rdar://13836387


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181710 91177308-0d34-0410-b5e6-96231b3b80d8
Use atomic instructions on ARM linux.

This is safe given how the pre-v6 atomic ops funcions in libgcc are
implemented.

This fixes pr15429.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181728 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a wrong and confusing comment in CharUnits.h. Neither C nor C++ allows
bytes and character units to be different sizes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181730 91177308-0d34-0410-b5e6-96231b3b80d8
Suppress GCC warning for no return after covered switch, and remove some
debugging code from an unreachable codepath.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181731 91177308-0d34-0410-b5e6-96231b3b80d8
Align a multiline string literal with the first part.

Before:
  #define A(X)          \
    "aaaaa" #X "bbbbbb" \
               "ccccc"

After:
  #define A(X)          \
    "aaaaa" #X "bbbbbb" \
    "ccccc"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181732 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Warn about nil elements/keys/values in array and dictionary literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181738 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Refactor: address Jordan’s code review of r181738.

(Modifying the checker to record that the values are no longer nil will be done separately.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181744 91177308-0d34-0410-b5e6-96231b3b80d8
PR15956: Debug Info: Include the appropriate file location in types created due to using declarations

We might benefit from API refactoring here (why pass in a value that's
derived from another parameter?) but this is the immediate issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181747 91177308-0d34-0410-b5e6-96231b3b80d8
Use atomic instructions on linux thumb v7.

This matches gcc's behaviour. The patch also explicitly parses the version so
that this keeps working when we add support for v8.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181750 91177308-0d34-0410-b5e6-96231b3b80d8
Suppress bogus "use of undefined constexpr function" error if the function body
was erroneous and got discarded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181758 91177308-0d34-0410-b5e6-96231b3b80d8
Replace EXPECT_EQ with EXPECT_FALSE to avoid gcc warning
[-Wconversion-null], introduced in r181326.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181761 91177308-0d34-0410-b5e6-96231b3b80d8
AArch64: correct definition of __clear_cache

According to libgcc document __clear_cache takes two char*
pointers. I suspect GCC's actual behaviour is more subtle than that,
but char* should clearly be preferred to void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181762 91177308-0d34-0410-b5e6-96231b3b80d8
Don't format sizeof/alignof as function types.

Before: A<sizeof (*x)> a;
After:  A<sizeof(*x)> a;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181764 91177308-0d34-0410-b5e6-96231b3b80d8
AArch64: add test for updated __clear_cache definition

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181765 91177308-0d34-0410-b5e6-96231b3b80d8
Update clang-format emacs integration.

- Remove free variables
- Add function clang-format-buffer, e.g. for before-save-hooks
- Wrap restoring windows in an unwind-protect

Patch by Stephen Gildea!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181766 91177308-0d34-0410-b5e6-96231b3b80d8
Implement string literal breaking on unbreakable token sequences.

This fixes indentation where there are for example multiple closing
parentheses after a string literal, and where those parentheses
run over the end of the line.

During testing this revealed a bug in the implementation of
breakProtrudingToken: we don't want to change the state if we didn't
actually do anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181767 91177308-0d34-0410-b5e6-96231b3b80d8
First revision of the dynamic ASTMatcher library.

This library supports all the features of the compile-time based ASTMatcher
library, but allows the user to specify and construct the matchers at runtime.
It contains the following modules:
 - A variant type, to be used by the matcher factory.
 - A registry, where the matchers are indexed by name and have a factory method
   with a generic signature.
 - A simple matcher expression parser, that can be used to convert a matcher
   expression string into actual matchers that can be used with the AST at
   runtime.

Many features where omitted from this first revision to simplify this code
review. The main ideas are still represented in this change and it already has
support working use cases.
Things that are missing:
 - Support for polymorphic matchers. These requires supporting code in the
   registry, the marshallers and the variant type.
 - Support for numbers, char and bool arguments to the matchers. This requires
   supporting code in the parser and the variant type.
 - A command line program putting everything together and providing an already
   functional tool.

Patch by Samuel Benzaquen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181768 91177308-0d34-0410-b5e6-96231b3b80d8
Fix clang-format bug in unwrapped-line merging.

Before (in styles that allow it), clang-format would not merge an
if statement onto a single line, if only the second line was format
(e.g. in an editor integration):

if (a)
  return; // clang-format invoked on this line.

With this patch, this gets properly merged to:

if (a) return; // ...

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