[analyzer] Clean up a few doc comments for ProgramState and CallEvent.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176600 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Check for returning null references in ReturnUndefChecker.

Officially in the C++ standard, a null reference cannot exist. However,
it's still very easy to create one:

int &getNullRef() {
  int *p = 0;
  return *p;
}

We already check that binds to reference regions don't create null references.
This patch checks that we don't create null references by returning, either.

<rdar://problem/13364378>

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176603 91177308-0d34-0410-b5e6-96231b3b80d8
Add a hasExternalStorageAsWritten helper. No functionality change.

It is possible that some of the current uses of
"getStorageClassAsWritten() == SC_Extern" should use this but I don't know
enough about SC_PrivateExtern to change and test them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176606 91177308-0d34-0410-b5e6-96231b3b80d8
Add a hasExternalLinkage helper. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176607 91177308-0d34-0410-b5e6-96231b3b80d8
Don't duplicate function names. Thanks to Jordan Rose for pointing it out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176609 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Warn on passing a reference to null pointer as an argument in a call

Warn about null pointer dereference earlier when a reference to a null pointer is
passed in a call. The idea is that even though the standard might allow this, reporting
the issue earlier is better for diagnostics (the error is reported closer to the place where
the pointer was set to NULL). This also simplifies analyzer’s diagnostic logic, which has
to track “where the null came from”. As a consequence, some of our null pointer
warning suppression mechanisms started triggering more often.

TODO: Change the name of the file and class to reflect the new check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176612 91177308-0d34-0410-b5e6-96231b3b80d8
Add flags for additional control over coverage generation. Pick the version
string to be emitted, and two properties about the files themselves.

Use $PWD to absolut-ify the path to the coverage file. Yes, this is what GCC
does. Reverts my own r175706.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176617 91177308-0d34-0410-b5e6-96231b3b80d8
Fix build with clang, this was supposed to be part of r176617.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176619 91177308-0d34-0410-b5e6-96231b3b80d8
Minor refactor of how we get compilation phases.

There is now a single function to get the list of phases for a given
output Type.

No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176628 91177308-0d34-0410-b5e6-96231b3b80d8
Add 'e' to the SPIR data layout - SPIR is little endian for now.
Add 32/64 bit specific target defines for SPIR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176629 91177308-0d34-0410-b5e6-96231b3b80d8
Adding lvalue and rvalue reference type matchers
    
Updated docs and tests.
    
Reviewers: klimek, gribozavr


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176630 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unncessary whitespace when triggered on empty line.

With the cursor located at "I", clang-format would not do anything to:

int a;

   I

  int b;

With this patch, it reduces the number of empty lines as necessary, and
removes unnecessary whitespace. It does not change/reformat "int a;" or
"int b;".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176650 91177308-0d34-0410-b5e6-96231b3b80d8
Remove temporary std::vectors that ca be replaced with ArrayRef's magic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176653 91177308-0d34-0410-b5e6-96231b3b80d8
Evaluate compound literals directly into the result aggregate
when that aggregate isn't potentially aliased.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176655 91177308-0d34-0410-b5e6-96231b3b80d8
Change hasAggregateLLVMType, which conflates complex and
aggregate types in a profoundly wrong way that has to be
worked around in every call site, to getEvaluationKind,
which classifies and distinguishes between all of these
cases.

Also, normalize the API for loading and storing complexes.

I'm working on a larger patch and wanted to pull these
changes out, but it would have be annoying to detangle
them from each other.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176656 91177308-0d34-0410-b5e6-96231b3b80d8
Move the atomics code into its own file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176657 91177308-0d34-0410-b5e6-96231b3b80d8
Promote atomic type sizes up to a power of two, capped by
MaxAtomicPromoteWidth.  Fix a ton of terrible bugs with
_Atomic types and (non-intrinsic-mediated) loads and stores
thereto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176658 91177308-0d34-0410-b5e6-96231b3b80d8
When possible, move __block variables to the heap rather than copying them.

Fixes <rdar://problem/13330126>.


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