Include types when a definition's type differs from a prior declaration.

This is some really old code (took me a while to find the test cases) & the
diagnostic text is slightly incorrect (it should really only apply to
re/declarations/, redefinitions are an error regardless of whether the types
match). Not sure if anyone cares about it, though.

For now this just makes the diagnostic more clear in less obvious cases where
the type of a declaration might not be explicitly written (eg: because it
uses decltype)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164313 91177308-0d34-0410-b5e6-96231b3b80d8
Remove a test that is non-portable (cannot be execute on cross builds, for example)

While it might be nice to have a quick end-to-end sanity test, it's just not
really the right place for it & would require more work to enable lit to
provide a detection flag ("XFAIL: cross" or similar) than the value we get from
having this test. Early on it might've made more sense, but these days we've
got some pretty good coverage across the stack with more targeted tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164314 91177308-0d34-0410-b5e6-96231b3b80d8
Make the wchar_t promotion test consistent across different hosts by specifying a target triple.

This test behavior differs depending (at least) on whether
sizeof(wchar_t) == sizeof(int) or not.

When they are equal, the first redeclaration will fail because decltype(+L'x')
is unsigned int instead of the expected int. This occurs on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164315 91177308-0d34-0410-b5e6-96231b3b80d8
Improvements to my patch in r164143 per
Richard's comments. // rdar://12202422


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164316 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typo. (s/Explided/Exploded/)

Patch by Sean McBride.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164318 91177308-0d34-0410-b5e6-96231b3b80d8
If the range in a for range statement doesn't have a viable begin/end function,
but can be dereferenced to form an expression which does have viable begin/end
functions, then typo-correct the range, even if something else goes wrong with
the statement (such as inaccessible begin/end or the wrong type of loop
variable).

In order to ensure we recover correctly and produce any followup diagnostics in
this case, redo semantic analysis on the for-range statement outside of the
diagnostic trap, after issuing the typo-correction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164323 91177308-0d34-0410-b5e6-96231b3b80d8
Thread safety analysis: properly canonicalize calls to virtual methods within
lock expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164324 91177308-0d34-0410-b5e6-96231b3b80d8
Thread-safety analysis: fix bug where shared trylock was treated
as exclusive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164332 91177308-0d34-0410-b5e6-96231b3b80d8
Serialize the 'IsConstexpr' bit of VarDecls. Fixes <rdar://problem/12328814>.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164336 91177308-0d34-0410-b5e6-96231b3b80d8
Ensure that the Decl* wrapped by an AnalysisDeclContext cannot be changed after
construction.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164338 91177308-0d34-0410-b5e6-96231b3b80d8
Implement faux-body-synthesis of well-known functions in the static analyzer when
their implementations are unavailable.  Start by simulating dispatch_sync().

This change is largely a bunch of plumbing around something very simple.  We
use AnalysisDeclContext to conjure up a fake function body (using the
current ASTContext) when one does not exist.  This is controlled
under the analyzer-config option "faux-bodies", which is off by default.

The plumbing in this patch is largely to pass the necessary machinery
around.  CallEvent needs the AnalysisDeclContextManager to get
the function definition, as one may get conjured up lazily.

BugReporter and PathDiagnosticLocation needed to be relaxed to handle
invalid locations, as the conjured body has no real source locations.
We do some primitive recovery in diagnostic generation to generate
some reasonable locations (for arrows and events), but it can be
improved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164339 91177308-0d34-0410-b5e6-96231b3b80d8
Tidy up. Trailing whitespace and 80 columns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164341 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: Use a dedicated intrinsic for vector bitwise select.

The expression based expansion too often results in IR level optimizations
splitting the intermediate values into separate basic blocks, preventing
the formation of the VBSL instruction as the code author intended. In
particular, LICM would often hoist part of the computation out of a loop.

rdar://11011471

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164342 91177308-0d34-0410-b5e6-96231b3b80d8
Add faux-body support for dispatch_once().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164348 91177308-0d34-0410-b5e6-96231b3b80d8
[PCH] After deserializing a DeclContext, if it has external lexical decls but not
external visible decls, call DeclContext::setMustBuildLookupTable so that the
"lazy decls" bit of the LookupPtr is set.

Previously, in non-C++, if there were no new declarations causing the "lazy decls" bit
to be set, then DeclContext::lookups_begin() would fail to return the decls from the PCH.

Fixes rdar://12316296.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164351 91177308-0d34-0410-b5e6-96231b3b80d8
PR13890: Warn on abstract final classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164359 91177308-0d34-0410-b5e6-96231b3b80d8
Doxygen-ify a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164360 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify getRuntimeDefinition() back to taking no arguments.

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