Improve support for -g options accepted by Clang:
1. Accept flags -g[0-3], -ggdb[0-3], -gdwarf-[2-4] and collapse them to simple -g (except -g0/-ggdb0).
2. Produce driver error on unsupported formats (-gcoff, -gstabs, -gvms) and options (-gtoggle).
3. Recognize and ignore flags -g[no-]strict-dwarf, -g[no-]record-gcc-switches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158906 91177308-0d34-0410-b5e6-96231b3b80d8
Make the RecursiveASTVisitor visit the body of a range-based for loop
again. This was broken in r158395.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158907 91177308-0d34-0410-b5e6-96231b3b80d8
Clang side of a refactoring of the CMake unit test build strategy.

The fundamental change is to put a CMakeLists.txt file in the unittest
directory, with a single test binary produced from it. This has several
advantages.

Among other fundamental advantages, we start to get the checking logic
for when a file is missing from the CMake build, and this caught one
missing file already! More fun details in the LLVM commit corresponding
to this one.

Note that the LLVM commit and this one most both be applied, or neither.
Sorry for any skew issues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158910 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r158423 corresponding to r158796, "test/Driver/warning-options.cpp: Mark as XFAIL:cygming. -pedantic is passed with gcc-as driver. PR12920"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158915 91177308-0d34-0410-b5e6-96231b3b80d8
Less restrictive check in unit test for unsupported debug info options

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158916 91177308-0d34-0410-b5e6-96231b3b80d8
Adjust this code so that it strictly honors
TargetSimulatroVersionFromDefines if present;  this also makes
it easier to chain things correctly.  Noted by an internal
review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158926 91177308-0d34-0410-b5e6-96231b3b80d8
objective-c: deprecated C-like parameters in Objective-C 
method declarations.
// rdar://11578353.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158929 91177308-0d34-0410-b5e6-96231b3b80d8
PR13165: False positive when initializing member data pointers with NULL.

This now correctly covers, I believe, all the pointer types:
* 'any' pointers (both function and data normal pointers and ObjC object pointers)
* member pointers (both function and data)
* block pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158931 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Do not step into statements while collecting function decls.

CallGraph's recursive visitor only needs to collect declarations; their
bodies will be processed later on. RecursiveASTVisitor will recurse on
the bodies if the definition is provided along with declaration.
Optimize, by not recursing on any of the statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158934 91177308-0d34-0410-b5e6-96231b3b80d8
VC9 does not like heterogenous compare function objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158936 91177308-0d34-0410-b5e6-96231b3b80d8
objective-c: If an ivar is (1) the first ivar in a root class and (2) named `isa`, 
then it should get the same warnings that id->isa gets. // rdar://11702488


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158938 91177308-0d34-0410-b5e6-96231b3b80d8
Handle include directive with comments.  It turns out that in this case comments are not coming in source order.  Instead of trying to std::sort() comments (which can be costly), just remove comments that are not in order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158940 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r158887. This fixes pr13168.

Revert "If an object (such as a std::string) with an appropriate c_str() member function"

This reverts commit 7d96f6106bfbd85b1af06f34fdbf2834aad0e47e.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158949 91177308-0d34-0410-b5e6-96231b3b80d8
Add the testcase from pr13168.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158950 91177308-0d34-0410-b5e6-96231b3b80d8
[diagtool] Write to llvm::outs() by default instead of llvm::errs()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158954 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Malloc: Warn about use-after-free when memory ownership was
transfered with dataWithBytesNoCopy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158958 91177308-0d34-0410-b5e6-96231b3b80d8
Documentation cleanup:
* Made \brief documentation be brief, mostly by adding a blank line to make
  the rest of the text be part of the detailed description only;
* Removed "FunctionOrClassName - " and other redundant text from the start
  of Doxygen comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158964 91177308-0d34-0410-b5e6-96231b3b80d8
Documentation cleanup: turn "//" into "///" for a Doxygen comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158965 91177308-0d34-0410-b5e6-96231b3b80d8
Documentation cleanup:
* Escaped # and < characters in Doxygen comments as needed;
* Fixed up some \brief summaries;
* Marked up some parameter references with \p;
* Added \code...\endcode around code examples;
* Used \returns a little more.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158966 91177308-0d34-0410-b5e6-96231b3b80d8
Documentation cleanup: Fixed the format of the file header (that I broke in
a recent commit), and eliminated a Doxygen error by changing a comment inside
a function to not be a Doxygen comment.


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