[analyzer] Don't track retain counts of objects directly accessed through ivars.

A refinement of r198953 to handle cases where an object is accessed both through
a property getter and through direct ivar access. An object accessed through a
property should always be treated as +0, i.e. not owned by the caller. However,
an object accessed through an ivar may be at +0 or at +1, depending on whether
the ivar is a strong reference. Outside of ARC, we don't have that information,
so we just don't track objects accessed through ivars.

With this change, accessing an ivar directly will deliberately override the +0
provided by a getter, but only if the +0 hasn't participated in other retain
counting yet. That isn't perfect, but it's already unusual for people to be
mixing property access with direct ivar access. (The primary use case for this
is in setters, init methods, and -dealloc.)

Thanks to Ted for spotting a few mistakes in private review.

<rdar://problem/16333368>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204730 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: make /Gy imply -fdata-sections in addition to -ffunction-sections

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204736 91177308-0d34-0410-b5e6-96231b3b80d8
Fix an logic error in the clang driver preventing crtfastmath.o from linking when -Ofast is used without -ffast-math

In gcc using -Ofast forces linking of crtfastmath.o.
In the current clang crtfastmath.o is only linked when -ffast-math/-funsafe-math-optimizations passed. It can lead to performance issues, when using only -Ofast without explicit -ffast-math (I faced with it).
My patch fixes inconsistency with gcc behaviour and also introduces few tests on it.

Patch by Zinovy Nis!

Differential Revision: http://llvm-reviews.chandlerc.com/D3114

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204742 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI: Mark direct virtual bases as visted when building vtable paths

Fixes PR19240.  In retrospect, this is a fairly obvious bug.  :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204744 91177308-0d34-0410-b5e6-96231b3b80d8
-fms-compatibility: Only form implicit member exprs for unqualified ids

If there are any scope specifiers, then a base class must be named or
the symbol isn't from a base class.

Fixes PR19233.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204753 91177308-0d34-0410-b5e6-96231b3b80d8
Use an option alias to implement -gmlt

Review feedback from Reid Kleckner on r203603.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204755 91177308-0d34-0410-b5e6-96231b3b80d8
PR19249: Don't forget to DiagnoseUseOfDecl for the implicit use of a variable
in a lambda capture.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204757 91177308-0d34-0410-b5e6-96231b3b80d8
[PGO] Add simplified branch weights for Objective-C for-collection loops.

Conceptually one of these loops is just a while-loop, but the actual code-gen
is more complicated. We don't instrument all the different control flow edges
to get accurate counts for each conditional branch, nor do I think it makes
sense to do so. Instead, make the simplifying assumption that the loop behaves
like a while-loop. Use the same branch weights for the first check for an
empty collection as would be used for the back-edge of a while loop, and use
that same weighting for the innermost loop, ignoring the possibility that there
may be some extra code to go fetch more elements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204767 91177308-0d34-0410-b5e6-96231b3b80d8
Move the -i[no-]system-prefix options from CC1Options.td to Options.td.

Summary:
This allows them to be used without -cc1 the same way as -I and -isystem.
Renamed the options to --system-header-prefix=/--no-system-header-prefix to avoid interference with -isystem and make the intent of the option cleaner.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3185

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204775 91177308-0d34-0410-b5e6-96231b3b80d8
Add existing warnings to -Waddress so that it works closer to what GCC has.
Previously, -Waddress was empty.

Fixes PR9043.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204776 91177308-0d34-0410-b5e6-96231b3b80d8
Update for llvm api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204783 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Update for llvm api change."

This reverts commit r204783.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204785 91177308-0d34-0410-b5e6-96231b3b80d8
Fix PR19066 - 0-sized vftable in the presence of virtual inheritance

Reviewed at http://llvm-reviews.chandlerc.com/D3181

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204786 91177308-0d34-0410-b5e6-96231b3b80d8
Make the 'for (auto ...)' names more readable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204787 91177308-0d34-0410-b5e6-96231b3b80d8
From Matt Thomas: use long long for [u]int64_t and [u]intmax_t on
NetBSD/aarch64 to simplify code sharing with NetBSD/arm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204798 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: be more flexible about how --mhwdiv is accepted.

Patch by Gabor Ballabas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204807 91177308-0d34-0410-b5e6-96231b3b80d8
Add support for __builtin___clear_cache in Clang

Adding the mapping between __builtin___clear_cache into @llvm.clear_cache

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204820 91177308-0d34-0410-b5e6-96231b3b80d8
-fms-extensions: Add __va_start builtin, which is used for x64

The main difference between __va_start and __builtin_va_start is that
the address of the va_list has already been taken, and the va_list is
always a char*.

__va_end and __va_arg are not needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204821 91177308-0d34-0410-b5e6-96231b3b80d8
-Wglobal-constructors: Don't warn on trivial defaulted dtors

Fixes PR19253.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204825 91177308-0d34-0410-b5e6-96231b3b80d8
Intrin.h: Implement _InterlockedExchangePointer

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