Reapply:

Author: Eric Christopher <echristo@apple.com>
Date:   Thu Aug 16 23:50:46 2012 +0000

    Add some caching here for the builtin types.

    rdar://12117935

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

after fixing a thinko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162243 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a pair of bugs relating to properties in ARC.

First, when synthesizing an explicitly strong/retain/copy property
of Class type, don't pretend during compatibility checking that the
property is actually assign.  Instead, resolve incompatibilities
by secretly changing the type of *implicitly* __unsafe_unretained
Class ivars to be strong.  This is moderately evil but better than
what we were doing.

Second, when synthesizing the setter for a strong property of
non-retainable type, be sure to use objc_setProperty.  This is
possible when the property is decorated with the NSObject
attribute.  This is an ugly, ugly corner of the language, and
we probably ought to deprecate it.

The first is rdar://problem/12039404;  the second was noticed by
inspection while fixing the first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162244 91177308-0d34-0410-b5e6-96231b3b80d8
DeclPrinter: add terse output mode and lots of tests

Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output
from DeclPrinter.  The motivation is to use DeclPrinter to print declarations
in user-friendly format, without overwhelming user with inner detail of the
declaration being printed.

Also add many tests for DeclPrinter.  There are quite a few things that we
print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests
check our output against incorrect output, so that we can fix/refactor/rewrite
the DeclPrinter later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162245 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Assume that reference symbols are non-null.

By doing this in the constraint managers, we can ensure that ANY reference
whose value we don't know gets the effect, even if it's not a top-level
parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162246 91177308-0d34-0410-b5e6-96231b3b80d8
Better diagnostics for range-based for loops with bad range types.

The old error message stating that 'begin' was an undeclared identifier
is replaced with a new message explaining that the error is in the range
expression, along with which of the begin() and end() functions was
problematic if relevant.

Additionally, if the range was a pointer type or defines operator*,
attempt to dereference the range, and offer a FixIt if the modified range
works.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162248 91177308-0d34-0410-b5e6-96231b3b80d8
When this test case was first created it was
just trying to show it did not crash and burn.

This patch checks that the resultant .ll contents
are correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162249 91177308-0d34-0410-b5e6-96231b3b80d8
DeclPrinter: describe what 'terse' output is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162251 91177308-0d34-0410-b5e6-96231b3b80d8
Screw around with ObjCRuntime some more, changing the
diagnostics for bad deployment targets and adding a few
more predicates.  Includes a patch by Jonathan Schleifer
to enable ARC for ObjFW.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162252 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid binding a reference to a dereferenced pointer in diagnostic serialization
if a diagnostic is emitted outside of any source file. The fix mirrors the
corresponding code in TextDiagnosticPrinter. This required moving the
functional parts of SDiagRenderer into SDiagWriter so they can be reused in the
non-rendering codepath.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162253 91177308-0d34-0410-b5e6-96231b3b80d8
When performing a trivial copy of a C++ type, we must be careful not
to overwrite objects that might have been allocated into the type's
tail padding.  This patch is missing some potential optimizations where
the destination is provably a complete object, but it's necessary for
correctness.

Patch by Jonathan Sauer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162254 91177308-0d34-0410-b5e6-96231b3b80d8
Fix alignment of array of VarDecl* following array of unsigned in LambdaExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162255 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] If we are compiling with ASan, add metadata indicating dynamically initialized globals. Patch by Reid Watson, reviewed by Richard Smith

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162259 91177308-0d34-0410-b5e6-96231b3b80d8
[driver] Add support for the --param ssp-buffer-size= driver option.
PR9673


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162285 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Remove this test case and the associated special case code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162288 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Append identifier for better debugging.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162289 91177308-0d34-0410-b5e6-96231b3b80d8
Rename PrintingPolicy::DontRecurseInDeclContext to PrintingPolicy::TerseOutput
to reflect the intention, not the implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162293 91177308-0d34-0410-b5e6-96231b3b80d8
DeclPrinter, terse mode: don't print function bodies


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162294 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl.  In general,
this is the index of the operand that failed to match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162296 91177308-0d34-0410-b5e6-96231b3b80d8
Switch some realignment calculations over to llvm::RoundUpToAlignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162297 91177308-0d34-0410-b5e6-96231b3b80d8
Reduce the amount of state in the Option class by relying on the data from OptTable::Info.

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