Revert part of r161175 which was wrong for OpenBSD's PowerPC target.

Contributed by Brad Smith <brad@comstyle.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161483 91177308-0d34-0410-b5e6-96231b3b80d8
Frontend: further document __BYTE_ORDER__

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161494 91177308-0d34-0410-b5e6-96231b3b80d8
Preprocessor: fix  __OPTIMIZE_SIZE__ and -Oz

Add some tests for __OPTIMIZE_SIZE__ and  __NO_INLINE__,
removing the superfluous copies in the target-specific
tests, since it's target-independent.

This uncovered a bug in the handling of -Oz: it would
attempt to store the value 2 in the 1-bit bitfield OptimizeSize,
leaving a value of 0 and never defining __OPTIMIZE_SIZE__.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161495 91177308-0d34-0410-b5e6-96231b3b80d8
Add various MC components to clang build to support MS-style inline assembly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161498 91177308-0d34-0410-b5e6-96231b3b80d8
objc: Include all types when issuing warning under
-Wdirect-ivar-access.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161500 91177308-0d34-0410-b5e6-96231b3b80d8
Implement warning for integral null pointer constants other than the literal 0.

This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...

There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.

Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.

Review by Sean Silva and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161501 91177308-0d34-0410-b5e6-96231b3b80d8
Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161503 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Add support for detecting simple ms-style inline asm.  Simple
asm statements are those that don't reference variable names, function names,
and labels.

Add logic to generate a patched AsmString that will eventually be consumed by
the AsmParser.  No functional change at this point, so unfortunately no test
case.

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

No functionality change. A couple ugly const_casts because the ancestor
search code is used for other purposes as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161509 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Revamp RegionStore to distinguish regions with symbolic offsets.

RegionStore currently uses a (Region, Offset) pair to describe the locations
of memory bindings. However, this representation breaks down when we have
regions like 'array[index]', where 'index' is unknown. We used to store this
as (SubRegion, 0); now we mark them specially as (SubRegion, SYMBOLIC).

Furthermore, ProgramState::scanReachableSymbols depended on the existence of
a sub-region map, but RegionStore's implementation doesn't provide for such
a thing. Moving the store-traversing logic of scanReachableSymbols into the
StoreManager allows us to eliminate the notion of SubRegionMap altogether.

This fixes some particularly awkward broken test cases, now in
array-struct-region.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161510 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Track malloc'd regions stored in structs.

The main blocker on this (besides the previous commit) was that
ScanReachableSymbols was not looking through LazyCompoundVals.
Once that was fixed, it's easy enough to clear out malloc data on return,
just like we do when we bind to a global region.

<rdar://problem/10872635>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161511 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Clean up the printing of FieldRegions for leaks.

Unfortunately, generalized region printing is very difficult:
- ElementRegions are used both for casting and as actual elements.
- Accessing values through a pointer means going through an intermediate
  SymbolRegionValue; symbolic regions are untyped.
- Referring to implicitly-defined variables like 'this' and 'self' could be
  very confusing if they come from another stack frame.

We fall back to simply not printing the region name if we can't be sure it
will print well. This will allow us to improve in the future.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161517 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Refactor the logic to generate the AsmString into Sema.  No
functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161518 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Add a very simple test case.  Basically, we're only testing for
crashers at the moment (and coincidentally this case was causing a crash).

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161521 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Make sure IsSimple is correctly handled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161522 91177308-0d34-0410-b5e6-96231b3b80d8
Don't add attributes for "#pragma pack" and friends to tag declarations which
are not definitions. This follows the behavior of both gcc and earlier
versions of clang. Regression from r156531.  <rdar://problem/12048621>.



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