Since we're stuck with realpath for the header <-> module mapping,
factor the realpath calls into FileManager::getCanonicalName() so we
can cache the results of this epically slow operation. 5% speedup on
my modules test, and realpath drops out of the profile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173542 91177308-0d34-0410-b5e6-96231b3b80d8
Fix up the test.
for // rdar://11861085


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173543 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Rename PruneNullReturnPaths to SuppressNullReturnPaths.

"Prune" is the term for eliminating pieces of a path that are not
relevant to the user. "Suppress" means don't show that path at all.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173544 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Add 'prune-paths' config option to disable path pruning.

This should be used for testing only. Path pruning is still on by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173545 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] bugreporter::getDerefExpr now takes a Stmt, not an ExplodedNode.

This allows it to be used in places where the interesting statement
doesn't match up with the current node. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173546 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Track null object lvalues back through C++ method calls.

The expression 'a->b.c()' contains a call to the 'c' method of 'a->b'.
We emit an error if 'a' is NULL, but previously didn't actually track
the null value back through the 'a->b' expression, which caused us to
miss important false-positive-suppression cases, including
<rdar://problem/12676053>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173547 91177308-0d34-0410-b5e6-96231b3b80d8
Highlight various parts of the AST dump with color.  Colors are controlled by
-f(no-)color-diagnostics.  In addition, dumpColor() function calls are added
to force color printing.  No structural changes to -ast-dump.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173549 91177308-0d34-0410-b5e6-96231b3b80d8
Remove function that is newly dead as of r173538.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173550 91177308-0d34-0410-b5e6-96231b3b80d8
Fix test case by being more lenient on what to accept as a path name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173553 91177308-0d34-0410-b5e6-96231b3b80d8
Fix mismatch between pointer and pointee type when diagnosing an incorrect
object argument type for a member call.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173554 91177308-0d34-0410-b5e6-96231b3b80d8
Give a more informative error message when the dot or arrow operator is used
on a type.  Currently, it gives a generic "expected unqualified-id" error.
The new error message is "cannot use (dot|arrow) operator on a type".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173556 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] C++ initializers may require cleanups; look through these.

When the analyzer sees an initializer, it checks if the initializer
contains a CXXConstructExpr. If so, it trusts that the CXXConstructExpr
does the necessary work to initialize the object, and performs no further
initialization.

This patch looks through any implicit wrapping expressions like
ExprWithCleanups to find the CXXConstructExpr inside.

Fixes PR15070.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173557 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/Misc/ast-dump-color.cpp: Symbolize color sequences in FileCheck.

FIXME: If FileCheck had expressions something predefined well-known...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173558 91177308-0d34-0410-b5e6-96231b3b80d8
[libclang] Introduce clang_getFileUniqueID which returns a struct
for a CXFile containing device/inode/modification time.

Intended to be useful as a key associated with a unique file across
an indexing session.

rdar://13091837

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173559 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/Misc/diag-template-diffing-color.cpp: Symbolize color sequences in FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173561 91177308-0d34-0410-b5e6-96231b3b80d8
Constify some getters of DesignatedInitExpr


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173574 91177308-0d34-0410-b5e6-96231b3b80d8
Constify getOptionalExplicitTemplateArgs()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173575 91177308-0d34-0410-b5e6-96231b3b80d8
Specify non-GNU-ARM triples for key-function test.

Since ARM has diverging ABIs on this detail, it's probably worth
testing both it and a "normal" Itanium system.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173576 91177308-0d34-0410-b5e6-96231b3b80d8
libclang: make getCursorStmt() and getCursorExpr() return const pointers

Also change EnqueueVisitor to use ConstStmtVisitor as a consequence.


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