Add additional test-case for one-line-function.

This ensures that we format:
void longFunctionName {
} // long comment here

And not:
void longFunctionName {}
// long comment here

As requested in post-commit-review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182024 91177308-0d34-0410-b5e6-96231b3b80d8
fix PR 15726: ptrdiff_t should be int on PowerPC Darwin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182029 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C arc: Diagnose when user attempts to
synthesize a property getter method that overrides
a method definition named 'retain' and the like.
Fixes // rdar://13885083


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182039 91177308-0d34-0410-b5e6-96231b3b80d8
Add testcase omitted from r181998.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182043 91177308-0d34-0410-b5e6-96231b3b80d8
[Lexer] Improve Lexer::getSourceText() when the given range deals with function macro arguments.

This is a modified version of a patch by Manuel Klimek.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182055 91177308-0d34-0410-b5e6-96231b3b80d8
Since we're counting number of steps, switch to turing machines which maximize
#steps not #1s, and use a more traditional step count where the 'halt' step is
not counted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182057 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Add an option to use the last location in the main source file as the report location.

Previously, we’ve used the last location of the analyzer issue path as the location of the
report. This might not provide the best user experience, when one analyzer a source
file and the issue appears in the header. Introduce an option to use the last location
of the path that is in the main source file as the report location.

New option can be enabled with -analyzer-config report-in-main-source-file=true.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182058 91177308-0d34-0410-b5e6-96231b3b80d8
AST dumping: if a declaration has an uncomputed or uninstantiated exception specification, include that in the dump.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182070 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Don't inline ~shared_ptr.

The analyzer can't see the reference count for shared_ptr, so it doesn't
know whether a given destruction is going to delete the referenced object.
This leads to spurious leak and use-after-free warnings.

For now, just ban destructors named '~shared_ptr', which catches
std::shared_ptr, std::tr1::shared_ptr, and boost::shared_ptr.

PR15987

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182071 91177308-0d34-0410-b5e6-96231b3b80d8
PR15757: When we instantiate an inheriting constructor template, also
instantiate the inherited constructor template and mark that as the constructor
which the instantiated specialization is inheriting. This fixes a
crash-on-valid when trying to compute the exception specification of a
specialization of the inheriting constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182072 91177308-0d34-0410-b5e6-96231b3b80d8
A little ArrayRef'ization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182074 91177308-0d34-0410-b5e6-96231b3b80d8
Use 'c++' not 'cxx' in these diagnostic group names for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182075 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer; alternate edges] don't add an edge incoming from the start of a function
for a nested call.  This matches what we do with the first stack frame.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182078 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer; alternate edges] treat 'if' statements the same way we do as 'for' or 'while'.

This means adding an extra edge from the 'if' to the condition,
which aesthetically looks more pleasing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182079 91177308-0d34-0410-b5e6-96231b3b80d8
Add embedded video for the AST tutorial.

As asked for by Sean, putting the video into the docs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182081 91177308-0d34-0410-b5e6-96231b3b80d8
Slightly modify the formatting rules for braced lists.

Basically, the new rule is: The opening "{" always has to be on the
same line as the first element if the braced list is nested
(e.g. in another braced list or in a function).

The solution that clang-format produces almost always adheres to this
rule anyway and this makes clang-format significantly faster for larger
lists. Added a test cases for the only exception I could find
(which doesn't seem to be very important at first sight).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182082 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer; alternate edges] improve support for edges with PseudoObjectExprs.

This optimizes some spurious edges resulting from PseudoObjectExprs.
This required far more changes than I anticipated.  The current
ParentMap does not record any hierarchy information between
a PseudoObjectExpr and its *semantic* expressions that may be
wrapped in OpaqueValueExprs, which are the expressions actually
laid out in the CFG.  This means the arrow pruning logic could
not map from an expression to its containing PseudoObjectExprs.

To solve this, this patch adds a variant of ParentMap that
returns the "semantic" parentage of expressions (essentially
as they are viewed by the CFG).  This alternate ParentMap is then
used by the arrow reducing logic to identify edges into pseudo
object expressions, and then eliminate them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182083 91177308-0d34-0410-b5e6-96231b3b80d8
Refactor diagnostics for MS attributes without -fms-extensions

This shares the warn_attribute_unused diagnostic and reduces the
indentation level.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182096 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C++ (and c++) Sema: Patch fixes a sema crash when gnu’s ?: extension 
is used for Objective-C++’s dictionary subscripting. This is done by filtering
out all placeholder types before check on lowering of the
common expression is done. // rdar://1374918.
Reviewed by John McCall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182120 91177308-0d34-0410-b5e6-96231b3b80d8
Move documentation to the constructor.  Fixes a -Wdocumentation warning


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