Don't emit -Wnon-virtual-dtor on final classes, since it's not a problem there.

The base class is the culprit/risk here - a sealed/final derived class
with virtual functions and a non-virtual dtor can't accidentally be
polymorphically destroyed (if the base class's dtor is protected - which
also suppresses this warning).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208449 91177308-0d34-0410-b5e6-96231b3b80d8
Don't leak the CXStoredDiagnostics returned by clang_codeCompleteGetDiagnostic()

r144269 changed clang_disposeDiagnostic() to be a no-op, but didn't update
code completion diagnostics.  Let CXCodeCompleteResults store all diagnostics
returned by clang_codeCompleteGetDiagnostic() and then free them up in
clang_disposeCodeCompleteResults().

Code completion diagnostics referred to data stored in CXCodeCompleteResults
before already, so it wasn't possible to refer to the results of
clang_codeCompleteGetDiagnostic() after clang_disposeCodeCompleteResults()
before this change already -- hence this should be a safe, backwards-compatible
change.

Leak found by LSan, fixes PR19690.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208454 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Pass 'sret' as the second parameter of instance methods

Summary:
MSVC always passes 'sret' after 'this', unlike GCC.  This required
changing a number of places in Clang that assumed the sret parameter was
always first in LLVM IR.

This fixes win64 MSVC ABI compatibility for methods returning structs.

Reviewers: rsmith, majnemer

Subscribers: cfe-commits

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

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