[analyzer] Fix handling of "empty" structs with base classes

Summary:
RegionStoreManager had an optimization which replaces references to empty
structs with UnknownVal. Unfortunately, this check didn't take into account
possible field members in base classes.

To address this, I changed this test to "is empty and has no base classes". I
don't consider it worth the trouble to go through base classes and check if all
of them are empty.

Reviewers: jordan_rose

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189590 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/Frontend/rewrite-includes.c: Tweak expressions for r'\\', not r'\', on win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189591 91177308-0d34-0410-b5e6-96231b3b80d8
ObjectiveC migrator: remove dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189592 91177308-0d34-0410-b5e6-96231b3b80d8
Consumed analysis: improve handling of conditionals.
Patch by chris.wailes@gmail.com.

* The TestedVarsVisitor was folded into the ConsumedStmtVisitor.
* The VarTestResult class was updated to allow these changes.
* The PropagationInfo class was updated for the same reasons.
* Correctly handle short-circuiting of Boolean operations.
* Blocks are now marked as unreachable when we can statically prove we will
  never branch to them.
* Unreachable blocks are skipped by the analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189594 91177308-0d34-0410-b5e6-96231b3b80d8
Better support for multiline string literals (including C++11 raw string literals).

Summary:
Calculate characters in the first and the last line correctly so that
we only break before the literal when needed.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189595 91177308-0d34-0410-b5e6-96231b3b80d8
Fix warning about anonymous structs in anonymous unions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189596 91177308-0d34-0410-b5e6-96231b3b80d8
Debug Info: generate a unique identifier for C++ struct, class, union, and enum.

We use CXX mangler to generate unique identifier for external C++ struct,
union, class and enum. Types with unique identifier are added to RetainedTypes
to make sure they are treated as used even when all uses are replaced with
the identifiers.

A single type can be added to RetainedTypes multiple times. For example, both 
createForwardDecl and createLimitedType can add the same type to RetainedTypes.
A set is used to avoid duplication when updating AllRetainTypes in DIBuilder.

Testing cases are updated to reflect the unique identifier generated for types.
The order of MDNodes is changed because of retained types and testing cases
are updated accordingly.

Testing case debug-info-uuid.cpp now emits error with Itanium mangler, since
uuid is not yet handled in Itanium mangler.

We choose to update RetainedTypes in clang, then at finalize(), we update
AllRetainTypes in DIBuilder. The other choice is to update AllRetainTypes
in DIBuilder when creating a DICompositeType with unique identifier. This
option requires using ValueHandle for AllRetainTypes in DIBuilder since
the created DICompositeType can be modified later on by setContainingType etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189600 91177308-0d34-0410-b5e6-96231b3b80d8
Silencing a rather spurious warning from MSVC 11 about not all control paths returning a value (hint: they do).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189605 91177308-0d34-0410-b5e6-96231b3b80d8
Silencing the warning from r189605 in a more conformant manner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189606 91177308-0d34-0410-b5e6-96231b3b80d8
Debug Info: this reverts commit r189600.

We had further discussions on how to retain types, whether to do it in front end
or in DIBuilder. And we agree to do it in DIBuilder so front ends
generating unique identifier do not need to worry about retaining them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189609 91177308-0d34-0410-b5e6-96231b3b80d8
Consumed analysis: non-const methods no longer transfer an object into an
unknown state.  Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189612 91177308-0d34-0410-b5e6-96231b3b80d8
Consumed analysis: track function parameters.
Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189616 91177308-0d34-0410-b5e6-96231b3b80d8
Debug Info: generate a unique identifier for C++ struct, class, union, and enum.

We use CXX mangler to generate unique identifier for external C++ struct,
union, class and enum. Types with unique identifier are added to retained
types by DIBuilder.

Testing cases are updated to reflect the unique identifier generated for types.
The order of MDNodes is changed because of retained types and testing cases
are updated accordingly.

Testing case debug-info-uuid.cpp now emits error with Itanium mangler, since
uuid is not yet handled in Itanium mangler. And it will check for the error
message.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189622 91177308-0d34-0410-b5e6-96231b3b80d8
Adjust clang for change to APFloat::toString.

I changed the diagnostic printing code because it's probably better
to cut off a digit from DBL_MAX than to print something like
1.300000001 when the user wrote 1.3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189625 91177308-0d34-0410-b5e6-96231b3b80d8
Be lazier when loading KeyFunctions from PCH/modules. We don't need to load
these in eagerly if we're not actually processing a translation unit. The added
laziness here also avoids us loading in parts of a CXXRecordDecl earlier than an
upcoming class template specialization merging patch would like.

Ideally, we should mark the vtable as used when we see a definition for the key
function, rather than having a separate pass over dynamic classes at the end of
the TU. The existing approach is pretty bad for PCH/modules, since it forcibly
loads the declarations of all key functions in all imported modules, whether or
not those key functions are defined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189627 91177308-0d34-0410-b5e6-96231b3b80d8
ObjectiveC migrator: User of hexadecimal enumerator
should infer migration to NS_OPTIONS.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189628 91177308-0d34-0410-b5e6-96231b3b80d8
Map from local decl IDs to global decl IDs when lazily deserializing friend decl chains.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189629 91177308-0d34-0410-b5e6-96231b3b80d8
Pass the special backend option to this test for now to get it passing
again.

This test should a) test IR or be moved, and b) get an actual option
for the dwarf pub sections.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189633 91177308-0d34-0410-b5e6-96231b3b80d8
Add ms_abi and sysv_abi attribute handling.

Based on a patch by Benno Rice!

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


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