Since this change is generating a considerable amount of discussion (and possibly even a regression for known bad versions), I'm reverting it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153420 91177308-0d34-0410-b5e6-96231b3b80d8
Delay checking of dependent underlying types for redeclarations of member
enumerations in templates until the template is instantiated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153426 91177308-0d34-0410-b5e6-96231b3b80d8
Handle instantiations of redeclarations of forward-declared enumerations within
templated functions. Build a redeclaration chain, and only instantiate the
definition of the enum when visiting the defining declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153427 91177308-0d34-0410-b5e6-96231b3b80d8
ThreadSafetyReporter: Manage diagnostics in a std::list.

std::list is expensive, but so is std::sorting a SmallVector of SmallVectors of
heavyweight PartialDiagnostics.

Saves ~30k in a i386-linux-Release+Asserts clang build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153437 91177308-0d34-0410-b5e6-96231b3b80d8
Driver: Factor string vector push_back into a helper class and optimize it.

Due to lack of move semantics we would create a temporary std::string from the
string literal, copy it into the vector and discard the temporary. This leads
to massive code bloat, optimizing it saves 50k on i386-linux-Release+Asserts.

While there add a two-element overload for push_back, simplifying code a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153441 91177308-0d34-0410-b5e6-96231b3b80d8
Canonicalize the declaration we write to a PCH file for an
InjectedClassNameType; otherwise, it won't be properly wired to the
original (canonical) declaration when it is deserialized. Fixes
<rdar://problem/11112464>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153442 91177308-0d34-0410-b5e6-96231b3b80d8
objective-c modern translator: extern "C" exported
symbols. // rdar://11103982


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153443 91177308-0d34-0410-b5e6-96231b3b80d8
When diagnosing an invalid out-of-line redeclaration, don't permit
typo correction to introduce a nested-name-specifier; we aren't
prepared to handle it here. Fixes PR12297 / <rdar://problem/11075219>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153445 91177308-0d34-0410-b5e6-96231b3b80d8
Move CodeCompletionBuilder's chunk adding methods out of line.

This makes sense because chunk's ctor is also out of line and simplifies considerably
when inlined with a constant parameter. Shrinks clang on i386-linux-Release+Asserts by 65k.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153446 91177308-0d34-0410-b5e6-96231b3b80d8
add tbaa metadata to vtable pointer loads/stores

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153447 91177308-0d34-0410-b5e6-96231b3b80d8
Test case for r153348.
 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153449 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Malloc: Allow a pointer to escape through OSAtomicEnqueue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153453 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r153443 "objective-c modern translator: extern "C" exported", it fails in testing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153454 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify code, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153459 91177308-0d34-0410-b5e6-96231b3b80d8
[tests] Fix test failure in release mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153460 91177308-0d34-0410-b5e6-96231b3b80d8
Add a special-case diagnostic for one of the more obnoxious special cases of
unscoped enumeration members: an enumerator name which is visible in the
out-of-class definition of a member of a templated class might not actually
exist in the instantiation of that class, if the enumeration is also lexically
defined outside the class definition and is explicitly specialized.

Depending on the result of a CWG discussion, we may have a different resolution
for a class of problems in this area, but this fixes the immediate issue of a
crash-on-invalid / accepts-invalid (depending on +Asserts). Thanks to Johannes
Schaub for digging into the standard wording to find how this case is currently
specified to behave.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153461 91177308-0d34-0410-b5e6-96231b3b80d8
Forward-declared enumerations are now complete, except for an interaction
between unscoped enumerations and class template member specializations,
whose behavior is currently under discussion in CWG (and for which there
is a preference to not implement the currently-standardized wording).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153464 91177308-0d34-0410-b5e6-96231b3b80d8
[driver] -mkernel implies -fno-builtin, so claim the arg to avoid an unused
argument warning.
Part of rdar://11120518


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153469 91177308-0d34-0410-b5e6-96231b3b80d8
[driver] -mkernel implies -fno-common, so claim the arg to avoid an unused
argument warning.
Part of rdar://11120518


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153470 91177308-0d34-0410-b5e6-96231b3b80d8
[driver]  Fix unused argument warnings.

1. Don't short-circuit conditional statements that are checking flags.
Otherwise, the driver emits warnings about unused arguments.

2. -mkernel and -fapple-kext imply no exceptions, so claim exception related
 arguments now to avoid warnings about unused arguments.

rdar://11120518


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