Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173779 91177308-0d34-0410-b5e6-96231b3b80d8
Remove empty lines before "}".

Those empty lines waste vertical whitespace and almost never
increase readability.

Before:
void f() {
  DoSomething();

}

After:
void f() {
  DoSomething();
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173785 91177308-0d34-0410-b5e6-96231b3b80d8
Reverting changes from r173785 (removing empty lines before "}").

This needs some more thinking, e.g. for namespaces, chains of if-else
if, ...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173787 91177308-0d34-0410-b5e6-96231b3b80d8
Downgrade 'attribute ignored when parsing type' from error to warning, to match
the diagnostic's warn_ name. Switch some places (notably C++11 attributes)
which really wanted an error over to a different diagnostic. Finally, suppress
the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing
diagnostics in important system headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173788 91177308-0d34-0410-b5e6-96231b3b80d8
Produce a diagnostic if alignas is applied to an expression. Neither C11 nor
C++11 allows that.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173789 91177308-0d34-0410-b5e6-96231b3b80d8
Test update missed in r173789.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173790 91177308-0d34-0410-b5e6-96231b3b80d8
Add a diagnostic for an OpenCL kernel with a pointer pointer argument.
Also refactor the surrounding code a little.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173791 91177308-0d34-0410-b5e6-96231b3b80d8
Initial support for multiple variable declarations.

Before:
  SomeType aaaaaaaaaaaaaaaaa = aaaaaa->aaaaaaaaaaaaaaaaa(),
      aaaaaaaaaaa = aaaaaa->aaaaaaaaaaa();
After:
  SomeType aaaaaaaaaaaaaaaaa = aaaaaa->aaaaaaaaaaaaaaaaa(),
           aaaaaaaaaaa = aaaaaa->aaaaaaaaaaa();

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173792 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a comment and reformat clang-format with clang-format

Not all changes might be ideal, but IMO all are acceptable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173793 91177308-0d34-0410-b5e6-96231b3b80d8
Calculate the split penalty upfront.

This is
a) More efficient.
b) Important as we move forward with further metrics for penalty.

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173801 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a crash in OpenCL code by using the proper (RHS) bit-width.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173802 91177308-0d34-0410-b5e6-96231b3b80d8
Fix uninitialized error caused by r173801.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173803 91177308-0d34-0410-b5e6-96231b3b80d8
Split ">>" in "A<B<C> >" in Chromium style.

It needs to be compatible with C++03.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173805 91177308-0d34-0410-b5e6-96231b3b80d8
Allow all parameters on next line for function calls in Chrome.

The style guide only forbids this for function declarations. So,
now

someFunction(
    aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa, aaaaaaaaaaaa);

Is allowed in Chromium mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173806 91177308-0d34-0410-b5e6-96231b3b80d8
Mark a struct definition in an objc container with the TopLevelDeclInObjCContainer bit.

Fixes accurately getting a cursor inside an objc container containing a struct definition,
from a PCH/preamble file.

rdar://12584613

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173811 91177308-0d34-0410-b5e6-96231b3b80d8
Improve formatting of code with comments.

Before:
aaaaaaa(aaaaaa( // comment
                aaaaaaa));
<big mess>

After:
aaaaaaa(aaaaaa( // comment
    aaaaaaaa));
function(/* parameter 1 */ aaaaaaa,
         /* parameter 2 */ aaaaaaa,
         /* parameter 3 */ aaaaaaa,
         /* parameter 4 */ aaaaaaa);

(the latter example was only wrong in the one-arg-per-line mode, e.g. in
Google style).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173821 91177308-0d34-0410-b5e6-96231b3b80d8
[driver] Refactor the driver so that a failing commands doesn't prevent
subsequent commands from being executed.

The diagnostics generation isn't designed for this use case, so add a note to
fix this in the very near future.  For now, just generated the diagnostics for
the first failing command.
Part of rdar://12984531

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173825 91177308-0d34-0410-b5e6-96231b3b80d8
[Preprocessor] When checking if we can concatenate two tokens, check
if they were already concatenated in source using the spelling locations
even if they came from a macro expansion.

This fixes an issue where a GUID passed as macro argument ends up
malformed after preprocessing because we added spaces inside it.

rdar://13016645

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173826 91177308-0d34-0410-b5e6-96231b3b80d8
Move the token annotator into separate files.

No functional changes. Also removed experimental-warning from all of
clang-format's files, as it is no longer accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173830 91177308-0d34-0410-b5e6-96231b3b80d8
Don't fixit/recover from -Wstatic-float-init when it's not an error.

Fix to change r173414 that lead to Clang changing const to constexpr even under
-Wno-static-float-init.

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