[analyzer] Move convenience REGISTER_*_WITH_PROGRAMSTATE to CheckerContext.h

As Anna pointed out, ProgramStateTrait.h is a relatively obscure header,
and checker writers may not know to look there to add their own custom
state.

The base macro that specializes the template remains in ProgramStateTrait.h
(REGISTER_TRAIT_WITH_PROGRAMSTATE), which allows the analyzer core to keep
using it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167385 91177308-0d34-0410-b5e6-96231b3b80d8
Tests for 32bit version of block ivar layout metadata.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167387 91177308-0d34-0410-b5e6-96231b3b80d8
On PowerPC64, integer arguments and return values need to be sign- or
zero-extended to 64 bits.  This information is currently provided to
the back end by setting "signext" or "zeroext" attributes.  However,
this is done only for integer types *smaller* than i32, not for i32
itself.  This causes clang to generate code violating the ABI, which
results in a failure of the tramp3d-v4 test case (due to calling a
system library routine without ABI-required extension).

This patch implements custom versions of classifyArgumentType and
classifyReturnType for PPC64_SVR4_ABIInfo, which are the same as the
default versions except that they also classify "int" and "unsigned int"
as types needing extending.  This fixed tramp3d-v4 on PowerPC64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167393 91177308-0d34-0410-b5e6-96231b3b80d8
Hash the various compiler version, target, preprocessor, and
header-search options into the module hash. We're just using
ADT/Hashing.hpp for this, which isn't as cryptographically strong as
I'd like, but it'll do. If someone contributes (say) and MD4
implementation, we'd happily switch to that.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167397 91177308-0d34-0410-b5e6-96231b3b80d8
Make cpuid.h actually work with -std=c99 <rdar://problem/12552716>.

While we're here, extend the module map to cover most of the
newly-added instrinsic headers. Only wmmintrin.h is missing, because
it needs to be split into AES/PCLMUL subheaders (as a separate commit).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167398 91177308-0d34-0410-b5e6-96231b3b80d8
Fix module map for SSE4a builtins

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167399 91177308-0d34-0410-b5e6-96231b3b80d8
Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167405 91177308-0d34-0410-b5e6-96231b3b80d8
Add -fsanitize=<sanitizers> argument to driver and frontend, and add
-fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the
various UBSan checks to be enabled and disabled separately. Right now, the
different modes can't be combined, but the intention is that combining UBSan
and the other sanitizers will be permitted in the near future.

Currently, the UBSan checks will all be enabled if any of them is; that will be
fixed by the next patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167411 91177308-0d34-0410-b5e6-96231b3b80d8
Use the individual -fsanitize=<...> arguments to control which of the UBSan
checks to enable. Remove frontend support for -fcatch-undefined-behavior,
-faddress-sanitizer and -fthread-sanitizer now that they don't do anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167413 91177308-0d34-0410-b5e6-96231b3b80d8
ARM byval: when type alignment is bigger than ABI alignment, we can't guarantee
the type alignment of the byval argument. This patch will disable byval in this case,
it also increases the size threshold for turning on byval.

A backend fix will be attempted.

rdar://12596507


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167416 91177308-0d34-0410-b5e6-96231b3b80d8
Use Richard's BE_THE_HEADER trick to simplify a test. No intended behavior change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167417 91177308-0d34-0410-b5e6-96231b3b80d8
Delete comment I forgot to delete in my last change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167418 91177308-0d34-0410-b5e6-96231b3b80d8
Frontend: Add support for reading named pipes as the main file.

 - The whole {File,Source}Manager is built around wanting to pre-determine the
   size of files, so we can't fit this in naturally. Instead, we handle it like
   we do STDIN, where we just replace the main file contents upfront.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167419 91177308-0d34-0410-b5e6-96231b3b80d8
Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, so
that we can model them as separate submodules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167420 91177308-0d34-0410-b5e6-96231b3b80d8
Have the parser initialize Sema before it consumes the first
token. This is important because the first token could actually be
after an #include that triggers a module import, which might use
either Sema or the AST consumer before it would have been initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167423 91177308-0d34-0410-b5e6-96231b3b80d8
[PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType type
reference instead of relying on computing it.

In general, if storage is no issue, it is preferable to deserialize info from
the PCH instead of trying to recompute it after the PCH was loaded.

The incentive to change this now was due to r155303 changing how friend template
classes in dependent contexts are handled; such classes can now be chained to
a previous template class but the computed InjectedClassNameType may be different
due to the extra template parameters from the dependent context.

The new handling requires more investigation but, in the meantime, writing out
InjectedClassNameType fixes PCH issue in rdar://12627738.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167425 91177308-0d34-0410-b5e6-96231b3b80d8
[PCH] Take into account the 'include' source location of a SM_SLOC_BUFFER_ENTRY.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167426 91177308-0d34-0410-b5e6-96231b3b80d8
Per discussion on cfe-commits, treat -faddress-sanitizer,
-fno-address-sanitizer, -fthread-sanitizer, -fno-thread-sanitizer, and
-fcatch-undefined-behavior as deprecated: produce a warning if they are used
pointing to the corresponding -fsanitize= option. In passing add the missing
'-' to some diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167429 91177308-0d34-0410-b5e6-96231b3b80d8
Propagate CharUnits into ObjC CodeGen.  No intended functional change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167431 91177308-0d34-0410-b5e6-96231b3b80d8
[c-index-test] Do install c-index-test because it's not just for tests,
it's also setup as 'INTERNAL_TOOL'.

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