Allow empty statements in naked functions in addition to ASM statements

Summary: This fixes PR20883.

Test Plan: The patch includes an automated test.

Reviewers: hansw

Differential Revision: http://reviews.llvm.org/D5256

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217413 91177308-0d34-0410-b5e6-96231b3b80d8
Tooling: Ignore file names in tooling::deduplicate.

This was horribly broken due to how the sort predicate works. We would
report a conflict for files with a replacement in the same position but
different names if the length differed. Just ignore paths as this is often
what the user wants. Files can occur with different names (due to symlinks
or relative paths) and we don't ever want to do the same edit in one file
twice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217439 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: [JS] Support regex literals with trailing escaped slash.

Before:
  var regex = / a\//; int i;

After:
  var regex = /a\//;
  int i;

This required pushing the Lexer into its wrapper class and generating a
new one in this specific case. Otherwise, the sequence get lexed as a
//-comment. This is hacky, but I don't know a better way (short of
supporting regex literals in the Lexer).

Pushing the Lexer down seems to make all the call sites simpler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217444 91177308-0d34-0410-b5e6-96231b3b80d8
Teach the analyzer that __builtin_assume_aligned returns its first argument.

Patch by Daniel Fahlgren!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217461 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C. Under a special flag, -Wcstring-format-directive,
off by default, issue a warning if %s directive is used in
certain CF/NS formatting APIs, to assist user in deprecating
use of such %s in these APIs. rdar://18182443


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217467 91177308-0d34-0410-b5e6-96231b3b80d8
Don't crash on access decls with invalid scope specifier, PR20887.

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

Unique_ptr creation stil needs to be moved earlier at some of the call sites.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217474 91177308-0d34-0410-b5e6-96231b3b80d8
Revert over-eager unique_ptr conversion.

This test wants to observe PPCallbacks after they have been moved into the
preprocessor. That doesn't work if the pointer has been moved away.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217481 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: Use a fixed alignment for vtables.

Pointer-sized alignment is sufficient as we only ever read single values
from the table. Otherwise we'd bump the alignment to 16 bytes in the
backend if the vtable is larger than 16 bytes. This is great for
structures that are accessed with vector instructions or copied around, but
that's simply not the case for vtables.

Shrinks the data segment of a Release x86_64 clang by 0.3%. The wins are
larger for i386 and code bases that use vtables more often than we do.

This matches the behavior of GCC 5.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217495 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Add option to allow short case labels on a single line.

On a single line:
  switch (a) {
  case 1: x = 1; return;
  case 2: x = 2; return;
  default: break;
  }

Not on a single line:
  switch (a) {
  case 1:
    x = 1;
    return;
  case 2:
    x = 2;
    return;
  default:
    break;
  }

This partly addresses llvm.org/PR16535. In the long run, we probably want to
lay these out in columns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217501 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Fix pthread lock tests so that the API comes from a system header.

...and verify that a global mutex in user code can be used without warnings.

Patch by Aleksei Sidorin!

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217517 91177308-0d34-0410-b5e6-96231b3b80d8
Add a test for an operator access decl.

In Parser::ParseCXXClassMemberDeclaration(), it was possible to change
      isAccessDecl = NextToken().is(tok::kw_operator);
to
      isAccessDecl = false;
and no tests would fail. Now there's coverage for this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217519 91177308-0d34-0410-b5e6-96231b3b80d8
Recognize .lib files as linker input explicitly

Summary:
Currently, this is done implicitly in Driver::BuildInputs by considering
any invalid input type as linker input.

Test Plan: I don't think this behavior is observable for the reason stated above.

Reviewers: hansw

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5294

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217522 91177308-0d34-0410-b5e6-96231b3b80d8
[sphinx cleanup]
Fix sphinx warning introduced by r217501.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217524 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C arc. Fixes a crash when issuing diagnostic for
passing parameter to an audited CF API. rdar://18222007


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217530 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Emit dynamic initializers for selectany globals in comdat-associative sections (PR20889)

This prevents initializers for comdat-folded globals from running multiple times.

Differential Revision: http://reviews.llvm.org/D5281

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217534 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C. Accept 'nil' as indexing argument to
dictionary literals since the API which implements 
them accepts it too.  // rdar://18254621


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217543 91177308-0d34-0410-b5e6-96231b3b80d8
Only override the target architecture on -m32 and friends if it is
actually different. Fixes a surprising link error with nodejs on rpi,
where armv6-netbsd-eabihf turned into armv5e-netbsd-eabihf, which
doesn't lacks the necessary VFP support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217546 91177308-0d34-0410-b5e6-96231b3b80d8
Update for llvm api change.

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