When we suppress an error due to SFINAE, stash the diagnostic away with the
overload candidate, and include its message in any subsequent 'candidate not
viable due to substitution failure' note we may produce.

To keep the note small (since the 'overload resolution failed' diagnostics are
often already very verbose), the text of the SFINAE diagnostic is included as
part of the text of the note, and any notes which were attached to it are
discarded.

There happened to be spare space in OverloadCandidate into which a
PartialDiagnosticAt could be squeezed, and this patch goes to lengths to avoid
unnecessary PartialDiagnostic copies, resulting in no slowdown that I could
measure. (Removal in passing of some PartialDiagnostic copies has resulted in a
slightly smaller clang binary overall.) Even on a torture test, I was unable to
measure a memory increase of above 0.2%.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156297 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed UserDefinedLiteral source locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156298 91177308-0d34-0410-b5e6-96231b3b80d8
Fixes resolution of relative paths when running clang tools.

The chdir is not the perfect fix, as it is thread hostile. The
real fix will be to make -working-dir work correctly, which will
take time to implement. Before that, the tooling library cannot
be used concurrently.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156299 91177308-0d34-0410-b5e6-96231b3b80d8
Includes direct.h for windows compilation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156301 91177308-0d34-0410-b5e6-96231b3b80d8
Fix includes for unices that don't have chdir declared transitively.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156302 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r156097, which appears to be causing some breakage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156304 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer]Fixup r156215: use StopTracking summary instead of ScratchArgs

As per Jordy's and Ted's comment, use the default StopTracking summary
instead of adding all arguments to ScratchArs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156310 91177308-0d34-0410-b5e6-96231b3b80d8
remove code to add bound checks for simple array accesses, since those are already covered by the check with the objectsize builtin
remove the comparison of objectsize with -1. since it's an unsigned comparison, it will always succeed if objectsize returns -1, which is enough to have the check removed

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156311 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Fixup for r155244: PurgeDeadSymbols should subclass StmtPoint

To solve the inconsistency pointed out in Erik's review, refactor class
hierarchy of ProgramPoints so that PreStmtPurgeDeadSymbols and
PostStmtPurgeDeadSymbols both subclass from StmtPoint instead of
PostStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156315 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Fix a crash in triggered by OSAtomicChecker.

SValBuilder should return an UnknownVal() when comparison of int and ptr
fails. Previous to this commit, it went on assuming that we are dealing
with pointer arithmetic.

PR12509, radar://11390991

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156320 91177308-0d34-0410-b5e6-96231b3b80d8
make this test a little more useful. I'll add more tests for bound checking once -fbounds-checking patch gets in

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156321 91177308-0d34-0410-b5e6-96231b3b80d8
Remove the 'intrin.h' builtin header file and its tests for now.

After discussion with several people, including Doug Gregor, we've
decided to change our approach here. If you have questions about this
header file, the commit removing it, etc., please reach out to me
off-list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156322 91177308-0d34-0410-b5e6-96231b3b80d8
[libclang] Use a copy of the data-recursive RecursiveASTVisitor inside libclang.

This is temporary until we settle on how to make the main RecursiveASTVisitor safe.
There are some modifications on the original version, to avoid extreme memory usage
when compiling for release.

rdar://11179167

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156329 91177308-0d34-0410-b5e6-96231b3b80d8
Un-revert r156142, "[libclang] Bring back BodyIndexer::TraverseCXXOperatorCallExpr".

It was reverted on r156253.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156330 91177308-0d34-0410-b5e6-96231b3b80d8
[libclang] Put the RecursiveASTVisitor in libclang in a cxindex namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156331 91177308-0d34-0410-b5e6-96231b3b80d8
[libclang] Actually commit the changes to make libclang's RecursiveASTVisitor
data-recursive for statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156339 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer]Turn on MallocSizeOfChecker by default; shorten the diagnostic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156341 91177308-0d34-0410-b5e6-96231b3b80d8
Process attributes in the order they appear in the source code. This make clang
match gcc behavior for two conflicting visibilities in the same decl. It also
makes handling of dllimport/dllexport more natural.

As a bonus we now warn on the dllimport in

void __attribute__((dllimport)) foo13();
void __attribute__((dllexport)) foo13();

as does gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156343 91177308-0d34-0410-b5e6-96231b3b80d8
Teach the static analyzer that NSLog() and friends do not hold on to object references (thus extending their lifetime).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156346 91177308-0d34-0410-b5e6-96231b3b80d8
Introduce a new libclang API to determine the platform availability of
a given entity, so that we can tell when the entity was
introduced/deprecated/obsoleted on each platform for which we have an
annotation. Addresses <rdar://problem/11365715>.


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