Set symbolizer path in the test environment.

This is needed to get symbolized stack traces when running Clang tests under (A|M)San.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176934 91177308-0d34-0410-b5e6-96231b3b80d8
Fix formatting of new arrays of pointers.

Before:
A = new SomeType * [Length];
A = new SomeType *[Length]();

After:
A = new SomeType *[Length];
A = new SomeType *[Length]();

Small formatting cleanups with clang-format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176936 91177308-0d34-0410-b5e6-96231b3b80d8
Add llvm-symbolizer as test dependency.

It is required when building tests with ASan or MSan.


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

Information messages sent to stdout by ClangTool now only happen when the -debug
flag is set.

Error messages that used to go to stdout now go to stderr.

Author: Ariel J Bernal <ariel.j.bernal@intel.com>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176944 91177308-0d34-0410-b5e6-96231b3b80d8
Reverting r176944 until Author fixes test failure.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176948 91177308-0d34-0410-b5e6-96231b3b80d8
Refactoring:
+ Individual Report* method for each bug type
+ Comment improved: missing non-trivial alloca() case annotated
+ 'range' parameter of ReportBadFree() capitalized
+ 'SymbolRef Sym = State->getSVal(A, C.getLocationContext()).getAsSymbol();' shorten to 'SymbolRef Sym = C.getSVal(A).getAsSymbol();'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176949 91177308-0d34-0410-b5e6-96231b3b80d8
Added AnnotatedToken::isOneOf + a few other refactorings

Summary: <subj>

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176951 91177308-0d34-0410-b5e6-96231b3b80d8
Fix formatting issue with builder-type calls.

Before:
->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() - aaaaaaaaa()->aaaaaa()
                                                             ->aaaaa());

After:
a->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() -
                         aaaaaaaaa()->aaaaaa()->aaaaa());

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176952 91177308-0d34-0410-b5e6-96231b3b80d8
Fix comment indentation before labels.

Before:
switch (x) {
  // if 1, do f()
case 1:
  f();
}

After:
switch (x) {
// if 1, do f()
case 1:
  f();
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176953 91177308-0d34-0410-b5e6-96231b3b80d8
relax check to allow for attributes (fix buildbot for elf-ppc64)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176954 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] fixed the logic changed by r176949

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176956 91177308-0d34-0410-b5e6-96231b3b80d8
Fix incorrect cast identification.

Before: int a = sizeof(int *)+ b;"
After:  int a = sizeof(int *) + b;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176957 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Handle Objc Fast enumeration for "loop is executed 0 times".

Fixes <rdar://problem/12322528>

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176966 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] BugReporter - more precise tracking of C++ references

When BugReporter tracks C++ references involved in a null pointer violation, we
want to differentiate between a null reference and a reference to a null pointer. In the
first case, we want to track the region for the reference location; in the second, we want
to track the null pointer.

In addition, the core creates CXXTempObjectRegion to represent the location of the
C++ reference, so teach FindLastStoreBRVisitor about it.

This helps null pointer suppression to kick in.

(Patch by Anna and Jordan.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176969 91177308-0d34-0410-b5e6-96231b3b80d8
Cause the mips16/nomips16 attribute to be passed to LLVM from Clang
in the LLVM assembly language output.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176971 91177308-0d34-0410-b5e6-96231b3b80d8
[Modules] Resolve top-headers of modules lazily.

This allows resolving top-header filenames of modules to FileEntries when
we need them, not eagerly.

Note that that this breaks ABI for libclang functions
clang_Module_getTopLevelHeader / clang_Module_getNumTopLevelHeaders
but this is fine because they are experimental and not widely used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176975 91177308-0d34-0410-b5e6-96231b3b80d8
[Modules] Don't eagerly load and associate all the module header files.

In a module-enabled Cocoa PCH file, we spend a lot of time stat'ing the headers
in order to associate the FileEntries with their modules and support implicit
module import.

Use a more lazy scheme by enhancing HeaderInfoTable to store extra info about
the module that a header belongs to, and associate it with its module only when
there is a request for loading the header info for a particular file.

Part of rdar://13391765

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176976 91177308-0d34-0410-b5e6-96231b3b80d8
Have these attriubtes set to 'true' or 'false'.

The back-end cannot differentiate between functions that are from a .ll file and
those generated from the front-end. We cannot then take the non-precense of
these attributes as a "false" value. Have the front-end explicitly set the value
to 'true' or 'false' depending upon what is actually set.


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