Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207867 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unused typedef found by gcc's -Wunused-local-typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207870 91177308-0d34-0410-b5e6-96231b3b80d8
[leaks] Fix a leak recently introduced to the pragma handling. This
whole code would be better with std::unique_ptr managing the lifetimes
of the handlers, but I wanted to make a targeted fix to the leaks first.
With this change, all of the Clang preprocessor tests are leak free with
LSan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207872 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizers] Propagate the sanitizer options through to the lit context.
This makes it *really* easy to debug leaks FYI:

ASAN_OPTIONS=detect_leaks=1 ./bin/llvm-lit -v <path to test>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207873 91177308-0d34-0410-b5e6-96231b3b80d8
clang-c: Fix a typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207879 91177308-0d34-0410-b5e6-96231b3b80d8
Fix clang-cl Driver leak

We were synthesizing new arguments from e.g. '/Tcfile.c' arguments,
but didn't handle ownership correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207880 91177308-0d34-0410-b5e6-96231b3b80d8
[leaks] Parse the schema file every time we try to verify the XML. Yes,
this is wasteful, blah blah, but this is a test utility only. It turns
out that without doing this, libxml2 will always leak a bunch of the XML
data, and that is causing failures with LSan. This is also quite a bit
simpler and I don't think it is slow enough to really be a show stopper.
If someone yells about the runtime of c-index-test, we can do other
things to try to mitigate it, but the current strategy wasn't working
well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207882 91177308-0d34-0410-b5e6-96231b3b80d8
Fix PR 19630, don't crash when file ends with whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207883 91177308-0d34-0410-b5e6-96231b3b80d8
[leaks] Fix a leak of a basic block when we successfully fold a switch
condition to a constant and emit only the relevant statement. In that
case, we were previously creating the epilog jump destination, a cleanup
scope, and emitting any condition variable into it. Instead, we can emit
the condition variable (if we have one) into the cleanup scope used for
the entire folded case sequence. We avoid creating a jump dest, a basic
block, and an extra cleanup scope. Win!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207888 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI x64: Pass small objects with dtors but no copy ctors directly

Passing objects directly (in registers or memory) creates a second copy
of the object in the callee.  The callee always destroys its copy, but
we also have to destroy any temporary created in the caller.  In other
words, copy elision of these kinds of objects is impossible.

Objects larger than 8 bytes with non-trivial dtors and trivial copy
ctors are still passed indirectly, and we can still elide copies of
them.

Fixes PR19640.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207889 91177308-0d34-0410-b5e6-96231b3b80d8
Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal.

Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207890 91177308-0d34-0410-b5e6-96231b3b80d8
Patched clang to emit x86 blends as shufflevectors.

Summary:
Most of the clang header patch by Simon Pilgrim @ SCEE.
Also fixed (or added) clang tests for these intrinsics.

LLVM tests to make sure we get the blend instruction out of these
shufflevectors are at http://reviews.llvm.org/D3600

Reviewers: eli.friedman, craig.topper

Subscribers: cfe-commits

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