Pare back r164351 somewhat. The problem that change was addressing was that we
don't serialize a lookup map for the translation unit outside C++ mode, so we
can't tell when lookup within the TU needs to look within modules. Only apply
the fix outside C++ mode, and only to the translation unit.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178707 91177308-0d34-0410-b5e6-96231b3b80d8
<rdar://problem/13560075> Teach name lookup for builtin names to find hidden declarations.

Normal name lookup ignores any hidden declarations. When name lookup
for builtin declarations fails, we just synthesize a new
declaration at the point of use. With modules, this could lead to
multiple declarations of the same builtin, if one came from a (hidden)
submodule that was later made visible. Teach name lookup to always
find builtin names, so we don't create these redundant declarations in
the first place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178711 91177308-0d34-0410-b5e6-96231b3b80d8
Update OpenCL comments to mention spec section and version.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178716 91177308-0d34-0410-b5e6-96231b3b80d8
Make the ObjC attributes diagnostics a bit more informative.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178720 91177308-0d34-0410-b5e6-96231b3b80d8
Protect the values of array and dictionary literals from the
ARC optimizer while they're held in local unsafe buffers.

Based on a patch by Jesse Rusak!

rdar://13573224

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178721 91177308-0d34-0410-b5e6-96231b3b80d8
cmake: mark clang as needing exported symbol.

This is a nop right now, but committing this first avoids a temporary breakage
when the llvm files change to not default to exporting symbols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178723 91177308-0d34-0410-b5e6-96231b3b80d8
Be sure to check ARC conventions on the implicit method declarations
of a property just in case the property's getter happens to be +1.
We won't synthesize a getter for such a property, but we will allow
the user to define a +1 method for it.
rdar://13115896

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178731 91177308-0d34-0410-b5e6-96231b3b80d8
Fix 41 of the 61 tests which fail with modules enabled: we were computing and
caching the linkage for a declaration before we set up its redeclaration chain,
when determining whether a declaration could be a redeclaration of something
from an unimported submodule. We actually want to look at the declaration as if
it were not a redeclaration here, so compute the linkage but don't cache it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178733 91177308-0d34-0410-b5e6-96231b3b80d8
Fix linkage related crash.

This test was exactly the opposite of what it should be. We should check if
there old decl has linkage (where it makes sense) and if the new decl has
the extern keyword.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178735 91177308-0d34-0410-b5e6-96231b3b80d8
Add tests that build modules for our builtin headers, and fix two buglets exposed by doing so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178736 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid computing the linkage instead of avoiding caching it.

This mostly reverts 178733, but keeps the tests.

I don't claim to understand how hidden sub modules work or when we need to see
them (is that documented?), but this has the same semantics and avoids adding
hasExternalLinkageUncached which has the same foot gun potential as the old
hasExternalLinkage.

Last but not least, not computing linkage when it is not needed is more
efficient.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178739 91177308-0d34-0410-b5e6-96231b3b80d8
Don't build this test with modules for now, it's causing buildbot failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178740 91177308-0d34-0410-b5e6-96231b3b80d8
Add hasExternalLinkageUncached back with the test that Richard provided, but
keep the call at the current location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178741 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r177948.  We decided that we do not want ObjC property redeclarations to inherit "deprecated".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178743 91177308-0d34-0410-b5e6-96231b3b80d8
Plumb through the -fsplit-stack option using the existing backend
support.

Caveat: Other than the existing segmented stacks support, no
claims are made of this working.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178744 91177308-0d34-0410-b5e6-96231b3b80d8
Propagate path to ASan/MSan symbolizer into test environment to produce useful reports on errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178750 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a recent linkage regression.

Now that we don't have a semantic storage class, use the linkage.

Thanks to Bruce Stephens for reporting this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178766 91177308-0d34-0410-b5e6-96231b3b80d8
Make helpers static & 80 cols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178767 91177308-0d34-0410-b5e6-96231b3b80d8
Use isExternalLinkage instead of hasExternalLinkage.

Having these not be the same makes an easy to misuse API. We should audit the
uses and probably rename to something like

foo->hasExternalLinkage():
  The c++ standard one. That is UniqueExternalLinkage or ExternalLinkage.

foo->hasUniqueExternalLinkage():
  Is UniqueExternalLinkage.

foo->hasCogeGenExternalLinkage():
  Is ExternalLinkage.

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