3.2 release branch r167703

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@167704 91177308-0d34-0410-b5e6-96231b3b80d8
Merge in r167749, per discussion on cfe-dev that we want -Wimplicit-fallthrough to only be active for C++11
until we come up with a language annotation for this warning that works outside of C++11.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@167775 91177308-0d34-0410-b5e6-96231b3b80d8
Merge in analyzer fix r167762, which was a recent regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@167776 91177308-0d34-0410-b5e6-96231b3b80d8
Merged 167788, and bad CFG construction bug, into the LLVM 3.2 release.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@167789 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Follow up to r167762 - precisely determine the adjustment
conditions.

The adjustment is needed only in case of dynamic dispatch performed by
the analyzer - when the runtime declaration is different from the static
one.

Document this explicitly in the code (by adding a helper). Also, use
canonical Decls to avoid matching against the case where the definition
is different from found declaration.

This fix suppresses the testcase I added in r167762, so add another
testcase to make sure we do test commit r167762.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@167797 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a Malloc Checker FP by tracking return values from initWithCharacter
and other functions.

When these functions return null, the pointer is not freed by
them/ownership is not transfered. So we should allow the user to free
the pointer by calling another function when the return value is NULL.

Commits: 167813, 167814, 167868


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@167870 91177308-0d34-0410-b5e6-96231b3b80d8
Merge r168260 from trunk:

  Enable inlining of 4 byte atomic ops on ppc32, 8 byte atomic ops on ppc64.

  Also fixes a bit/byte mismatch when checking if a target supports atomic ops
  of a certain size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168313 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r167884,r167920 from trunk into 3.2 release branch 

r167884

Don't try to save the assigned value in a Objective-C property assignment
if the type of the value is a non-trivial class type.  Fixes PR14318.

(There's a minor ObjC++ language change here: given that we can't save the
value, the type of the assignment expression is void in such cases.)

r167920

PR14279: Work around this major miscompilation by treating move operations as
non-trivial if they would not call a move operation, even if they would in fact
call a trivial copy operation. A proper fix is to follow, but this small
directed fix is intended for porting to the 3.2 release branch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168324 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168024 from trunk into 3.2 release branch 

Revert r167567, restoring the ability of clang to run gcc in cases where it
can't handle the input file type. This resulted in PR14338.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168330 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168124 into 3.2 release branch

Fix PR14321, a crash when Clang is built with GCC 4.7 at -O1 or greater.

GCC 4.7 reuses stack slots fairly aggressively, which exposes more temporary
lifetime bugs.

No new test, this was caught by the existing CodeGenCXX/mangle-ms-templates.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168331 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168297 into 3.2 release branch

Completely re-work how the Clang driver interprets PIC and PIE options.

There were numerous issues here that were all entangled, and so I've
tried to do a general simplification of the logic.
1) The logic was mimicing actual GCC bugs, rather than "features". These
   have been fixed in trunk GCC, and this fixes Clang as well. Notably,
   the logic was always intended to be last-match-wins like any other
   flag.
2) The logic for handling '-mdynamic-no-pic' was preposterously unclear.
   It also allowed the use of this flag on non-Darwin platforms where it
   has no actual meaning. Now this option is handled directly based on
   tests of how llvm-gcc behaves, and it is only supported on Darwin.
3) The APIs for the Driver's ToolChains had the implementation ugliness
   of dynamic-no-pic leaking through them. They also had the
   implementation details of the LLVM relocation model flag names
   leaking through.
4) The actual results of passing these flags was incorrect on Darwin in
   many cases. For example, Darwin *always* uses PIC level 2 if it uses
   in PIC level, and Darwin *always* uses PIC on 64-bit regardless of
   the flags specified, including -fPIE. Darwin never compiles in PIE
   mode, but it can *link* in PIE mode.
5) Also, PIC was not always being enabled even when PIE was. This isn't
   a supported mode at all and may have caused some fallout in builds
   with complex PIC and PIE interactions.

The result is (I hope) cleaner and clearer for readers. I've also left
comments and tests about some of the truly strage behavior that is
observed on Darwin platforms. We have no real testing of Windows
platforms and PIC, but I don't have the tools handy to figure that out.
Hopefully others can beef up our testing here.

Unfortunately, I can't test this for every platform. =/ If folks have
dependencies on these flags that aren't covered by tests, they may
break. I've audited and ensured that all the changes in behavior of the
existing tests are intentional and good. In particular I've tried to
make sure the Darwin behavior (which is more suprising than the Linux
behavior) also matches that of 'gcc' on my mac.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168416 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168063 into 3.2 release branch

block extended signatur option. Change previous option
to a cc1 -fencode-extended-block-signature and pass it
to cc1 and recognize this option to produce extended block
type signature. // rdar://12109031 

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168419 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168355: into the 3.2 release branch.

Update method calls to the new interface re r168354.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168487 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r167925: into the 3.2 release branch.

Move some GNUStep-specific code out of CGObjCGNU.

Patch by Jonathan Schleifer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168609 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r167935: into the 3.2 release branch.

The ObjC++-to-C++ personality trick is only necessary on NeXT runtimes,
which is not coincidentally the only place it works, either (because
of how it tests for EH_TYPE symbols).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168611 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168277: into 3.2 release branch.

Documentation parsing: propely handle a lone '\endverbatim' and emit a warning.

We actually used to assert on this.

Thanks to NAKAMURA Takumi for noticing this!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168730 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168278: into 3.2 release branch.

clang/test/Sema/warn-documentation.cpp: Try to fix up the testcase in r168277.
-

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168732 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168269: into the 3.2 release branch.

Fix crash on end-of-file after \ in a char literal, fixes PR14369.

This makes LexCharConstant() look more like LexStringLiteral(), which doesn't
have this bug. Add tests for eof after \ for several other cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168808 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168674: into the 3.2 release branch.

Fix the definition of the vfork() builtin on Haiku.  PR14378.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168819 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r168303: into the 3.2 release branch.

clang/test: Suppress two tests on LLP64 target, Windows x64.


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