Replace TypeLoc llvm::cast support to be well-defined.

The TypeLoc hierarchy used the llvm::cast machinery to perform undefined
behavior by casting pointers/references to TypeLoc objects to derived types
and then using the derived copy constructors (or even returning pointers to
derived types that actually point to the original TypeLoc object).

Some context is in this thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html
Though it's spread over a few months which can be hard to read in the mail
archive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175462 91177308-0d34-0410-b5e6-96231b3b80d8
Use LLVM_DELETED_FUNCTION rather than '// do not implement' comments.

Also removes some redundant DNI comments on function declarations already
using the macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175465 91177308-0d34-0410-b5e6-96231b3b80d8
Add a 'no-builtin' attribute if we do not want to simplify calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175471 91177308-0d34-0410-b5e6-96231b3b80d8
Temporarily revert r175471 for more review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175477 91177308-0d34-0410-b5e6-96231b3b80d8
Use the actual class visibility for the ObjC EHTYPE global,
not the global visibility mode.

Noticed by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175479 91177308-0d34-0410-b5e6-96231b3b80d8
Add support for -fvisibility-ms-compat.

We treat this as an alternative to -fvisibility=<?>
which changes the default value visibility to "hidden"
and the default type visibility to "default".

Expose a -cc1 option for changing the default type
visibility, repurposing -fvisibility as the default
value visibility option (also setting type visibility
from it in the absence of a specific option).

rdar://13079314

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175480 91177308-0d34-0410-b5e6-96231b3b80d8
Fixing a typo where FixIts was accidentally self-assigning instead of assigning in the parameter Fixits. This fixes several failed assertions with MSVC debug builds.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175492 91177308-0d34-0410-b5e6-96231b3b80d8
Fix bug in LineState comparison function.

The key bug was

  if (Other.StartOfLineLevel < StartOfLineLevel) ..

instead of

  if (Other.StartOfLineLevel != StartOfLineLevel) ..

Also cleaned up the function to be more consistent in the comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175500 91177308-0d34-0410-b5e6-96231b3b80d8
Add the missing 'static' keyword to the test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175502 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] If -fsanitize-blacklist= option is not explicitly specified, make Clang look for the default sanitizer-specific blacklist in the resource directory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175505 91177308-0d34-0410-b5e6-96231b3b80d8
[docs] Introduce ExternalProjectsUsingClang.rst

A couple concrete examples are sure to be a win. If you know of any
other external projects using Clang, please let me know!

Patch by Laszlo Nagy! (with a title tweak by me)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175529 91177308-0d34-0410-b5e6-96231b3b80d8
Support in hasDeclaration for types with getDecl()
    
Using a new metafunction for detecting the presence of the member
'getDecl' in a type T, added support to hasDeclaration for any such type
T. This allows hasDecl() to be replaced and enables several other
subclasses of clang::Type to use hasDeclaration.

Updated unittests and LibASTMatchersReference.html.

Reviewers: klimek


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175532 91177308-0d34-0410-b5e6-96231b3b80d8
Correctly format macro with unfinished template declaration.

We can now format:
  #define A template <typename T>

Before this created a segfault :-/.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175533 91177308-0d34-0410-b5e6-96231b3b80d8
[docs] Revise content on ExternalProjectsUsingClang page.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175534 91177308-0d34-0410-b5e6-96231b3b80d8
[docs] Rename to permit wider variety of  content.

I don't want to rule out the possibility of linking to e.g. interesting
blog posts about uses of Clang, so avoid restricting the content to
"projects".

This breaks URL compatibility, but this document was committed less than
an hour ago so hopefully nobody has linked to it yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175535 91177308-0d34-0410-b5e6-96231b3b80d8
Use MapVector::pop_back() per LLVM r175538.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175539 91177308-0d34-0410-b5e6-96231b3b80d8
[modules] Refactor code from ASTReader::makeModuleVisible() into a new function,
Module::getExportedModules() so it can be reused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175548 91177308-0d34-0410-b5e6-96231b3b80d8
[modules] Const'ify some functions of ModuleMap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175552 91177308-0d34-0410-b5e6-96231b3b80d8
Add missing clang-format null pointer check..

.. and a test that triggers it in valid albeit questionable code.

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