Fix another regression for pointer types.

Before: if (int * a = &b) ...
After:  if (int *a = &b) ...

Also changed all the existing tests to test the expressions in question
both in a declaration and in an expression context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173256 91177308-0d34-0410-b5e6-96231b3b80d8
Removing the penalty for breaking after "=".

Having seen more cases, this actually was not a good thing to do in the
first place. We can still improve on what we do now, but breaking after
the "=" is good in many cases.

Before:
aaaaaaaaaaaaa = aa->aaaaaaaaaaaaaaaaaaaa(
                    aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

After:
aaaaaaaaaaaaa =
    aa->aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173257 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the formatting of pointer/reference types in range-based for loops.

Before: for (int & a : Values) {}
After:  for (int &a : Values) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173259 91177308-0d34-0410-b5e6-96231b3b80d8
Fixes layouting regression and invalid-read.

Layouting would prevent breaking before + in
a[b + c] = d;
Regression detected by code review.

Also fixes an invalid-read found by the valgrind bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173262 91177308-0d34-0410-b5e6-96231b3b80d8
Fix handling of macro definitions.

Now correctly formats:
 #define A (1)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173264 91177308-0d34-0410-b5e6-96231b3b80d8
Don't try to do a hanging ident after assignments.

Before:
bool aaaa = aaaaaaaaaaa(
                aaaaaaaaaaaaaaaaa);

After:
bool aaaa = aaaaaaaaaaa(
    aaaaaaaaaaaaaaaaa);

The other indentation was a nice attempt but doesn't work in many cases.
Not sure what the right long term solution is as the "After: " is still
not nice. We either need to figure out what to do in the cases where it
"doesn't work" or come up with a third solution, e.g. falling back to:

bool aaaa =
    aaaaaaaaaaa(
        aaaaaaaaaaaaaaaaa);

which should always work and nicely highlight the structure.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173269 91177308-0d34-0410-b5e6-96231b3b80d8
Constify some getters in RedeclarableTemplateDecl


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173272 91177308-0d34-0410-b5e6-96231b3b80d8
Don't try to align builder-type continuations on assignments.

Before:
int aaaa = aaaaa().aaaaa() // force break
           .aaaaa();
After:
int aaaa = aaaaa().aaaaa() // force break
    .aaaaa();

The other indent is just wrong and confusing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173273 91177308-0d34-0410-b5e6-96231b3b80d8
Add constness for NestedNameSpecifier::Create parameter


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173274 91177308-0d34-0410-b5e6-96231b3b80d8
Use 'const Decl *' throughout code completion in Sema


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173277 91177308-0d34-0410-b5e6-96231b3b80d8
libclang: change return type of getCursorDecl() to 'const Decl *'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173278 91177308-0d34-0410-b5e6-96231b3b80d8
Documentation: add a note that -cc1 options are not guaranteed to be stable


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173280 91177308-0d34-0410-b5e6-96231b3b80d8
[PCH] Temporarily disable the "ambiguous macro" warning that is currently bogus with a PCH
that redefined a macro without undef'ing it first.

Proper reconstruction of the macro info history from modules will properly fix this in subsequent commits.

rdar://13016031

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173281 91177308-0d34-0410-b5e6-96231b3b80d8
docs: clear up ambiguity

Anybody using clang is a "developer".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173282 91177308-0d34-0410-b5e6-96231b3b80d8
Factor the trait for lookup into the on-based hash table of
identifiers into two parts: the part that involves dealing with the
key (which can be re-used) and the ASTReader-specific part that
creates the IdentifierInfos. While I'm at it, StringRef'ify this code,
which was using pair<const char*, unsigned>. No functionality change.



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

GCC implements -Wvla as "warn on every VLA" (this is useful to find every VLA,
for example, if they are forbidden by coding guidelines).  Currently Clang
implements -Wvla as "warn on VLA when it is an extension".

The attached patch makes our behavior match GCC.  The existing vla extwarn is
moved under -Wvla-extension and is still included into -Wgnu.

This fixes PR5953.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173286 91177308-0d34-0410-b5e6-96231b3b80d8
Add extra indent for nested calls inside if's.

Before:
if (aaaaaaaaaa(
    aaaaaaaaaa)) {}

After:
if (aaaaaaaaaa(
        aaaaaaaaaa)) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173290 91177308-0d34-0410-b5e6-96231b3b80d8
Honor attribute 'analyzer_noreturn' on Objective-C methods.

This isn't likely a full solution, but it catches the common cases
and can be refined over time.

Fixes <rdar://problem/11634353>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173291 91177308-0d34-0410-b5e6-96231b3b80d8
Add missing null check.  Not sure why my tests passed before.

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