CodeGen: Don't emit linkage on thunks that aren't emitted because they're vararg.

This can happen when we're trying to emit a thunk with available_externally
linkage with optimization enabled but bail because it doesn't make sense
for vararg functions.

PR18098.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196658 91177308-0d34-0410-b5e6-96231b3b80d8
[REFACTOR] Refactored some of the generic-lambda capturing code.

Employed the following refactorings:
  - Renamed some functions
  - Introduced explaining variables
  - Cleaned up & added comments
  - Used Optional<unsigned> for return value instead of an out parameter
  - Added assertions
  - Constified a few member functions
  
No functionality change.
All regressions pass.  



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196662 91177308-0d34-0410-b5e6-96231b3b80d8
Delete the now unnecessary test/generic-lambda-unimplemented-1y.cpp



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

Clang outputs LLVM one top level decl at a time. This combined with the
visibility computation code looking for the newest NamespaceDecl would cause
it to produce different results for nested namespaces.

The two options for producing consistent results are
* Delay codegen of anything inside a namespace until the end of the file.
* Don't look for the newest NamespaceDecl.

This patch implements the second option.
This matches the gcc behavior too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196712 91177308-0d34-0410-b5e6-96231b3b80d8
Extend assembler handling for NetBSD/MIPS to pass down the correct ABI,
architecture and PIC flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196720 91177308-0d34-0410-b5e6-96231b3b80d8
Fix an assertion introduced by my previous refactoring.

Add back the test that was triggering the assertion (which I removed mistakenly thinking it was triggering just a warning and not an assertion).  My error was brought to my attention by Rafael (Thanks!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196721 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the message to go along with the assertion that was just fixed.

argh!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196722 91177308-0d34-0410-b5e6-96231b3b80d8
Move a generic lambda test into the more logical test file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196723 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: teach Sema that "r" can match 64-bit values

We already support using "r" on 64-bit values (a GPRPair is
allocated), but Sema doesn't know this yet so issues a warning. This
should fix it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196724 91177308-0d34-0410-b5e6-96231b3b80d8
GlobalAlias::isDeclaration is always false. Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196727 91177308-0d34-0410-b5e6-96231b3b80d8
Remove duplicated -cc1 in tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196728 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a test that hasn't worked since 2007

Due to a missing -verify, 2007-10-01-BuildArrayRef.c was a no-op.

The message was changed 5 years ago so also update the test to reflect the new wording.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196729 91177308-0d34-0410-b5e6-96231b3b80d8
There's no such thing as %clang_cc1_only

These were being substituted into approximately the following:

  clang -cc1 -internal-isystem ../lib/clang/3.5/include_only

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196730 91177308-0d34-0410-b5e6-96231b3b80d8
Remove all DISABLE lines from tests

There's no evidence that a 'DISABLE' directive ever existed.

Let's see if anything breaks..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196733 91177308-0d34-0410-b5e6-96231b3b80d8
Re-enable ms inline asm parser test.

LLVM r196044 should make it pass.

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