Reinstate "Update for llvm API change.""

This reinstates r215113.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216986 91177308-0d34-0410-b5e6-96231b3b80d8
[modules] Use DeclContext::equals rather than == on DeclContext* when
determining whether a declaration is out of line, instead of assuming
that the semantic and lexical DeclContext will be the same declaration
whenever they're the same entity.

This fixes behavior of declarations within merged classes and enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217008 91177308-0d34-0410-b5e6-96231b3b80d8
Allow a scoped lockable object to acquire/release multiple locks.

Scoped lockable objects (mutex guards) are implemented as if it is a
lock itself that is acquired upon construction and unlocked upon
destruction. As it if course needs to be used to actually lock down
something else (a mutex), it keeps track of this knowledge through its
underlying mutex field in its FactEntry.

The problem with this approach is that this only allows us to lock down
a single mutex, so extend the code to use a vector of underlying
mutexes. This, however, makes the code a bit more complex than
necessary, so subclass FactEntry into LockableFactEntry and
ScopedLockableFactEntry and move all the logic that differs between
regular locks and scoped lockables into member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217016 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Add an option 'SpaceAfterCStyleCast'.

This permits to add a space after closing parenthesis of a C-style cast.
Defaults to false to preserve old behavior.

Fixes llvm.org/PR19982.

Before:
  (int)i;

After:
  (int) i;

Patch by Marek Kurdej.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217022 91177308-0d34-0410-b5e6-96231b3b80d8
Parse: Replace polymorphic functor objects with lambdas and llvm::function_ref.

No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217025 91177308-0d34-0410-b5e6-96231b3b80d8
ASTMatchers: Add a matcher to detect whether a decl or stmt is inside a template instantiation.

This is hoisted from clang-tidy where it's used everywhere. The implementation
is not particularly efficient right now, but there is no easy fix for that.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217029 91177308-0d34-0410-b5e6-96231b3b80d8
Fix configure and make build of clang-interpreter.

Replaced 'jit' link component with 'mcjit'.
Updated the required libraries.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217033 91177308-0d34-0410-b5e6-96231b3b80d8
CGBuiltin: Use @llvm.fabs rather than fabs libcall when emitting builtins

Using the intrinsic allows the SelectionDAGBuilder to turn this call
into the FABS Node and also the intrinsic is something the vectorizer knows
how to vectorize.

This patch also sets the readnone attribute on this call, which should
enable additional optmizations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217042 91177308-0d34-0410-b5e6-96231b3b80d8
Split off CUDA-specific Sema parts to a new file

In line with SemaOpenMP.cpp, etc. CUDA-specific semantic analysis code goes into
a separate file. This is in anticipation of adding extra functionality here in
the near future.

No change in functionality.

Review: http://reviews.llvm.org/D5160



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217043 91177308-0d34-0410-b5e6-96231b3b80d8
Fix indentation. No behavior change.

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