Another fix for the configure build: correct order of dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159809 91177308-0d34-0410-b5e6-96231b3b80d8
[cindex.py] Fix erroneous comment for CompileCommands

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159810 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/CodeGen/fp-contract.c: It requires ppc32!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159816 91177308-0d34-0410-b5e6-96231b3b80d8
ASTContext.cpp: Appease msvc to cast NULL to typed pointer, or msvc mistakes NULL as int.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159818 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unreachable default case to pacify clang's -Wcovered-switch-default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159829 91177308-0d34-0410-b5e6-96231b3b80d8
Use C++ cast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159830 91177308-0d34-0410-b5e6-96231b3b80d8
Stop using new[] on llvm::BumpPtrAllocator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159833 91177308-0d34-0410-b5e6-96231b3b80d8
Don't store pointers into a std::vector (RawCommentList::Comments).  Although
currently we take address of std::vector's contents only after we finished
adding all comments (so no reallocation can happen), this will change in
future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159845 91177308-0d34-0410-b5e6-96231b3b80d8
objective-c++11: extend c++11 range-based loop to iterate
over objective-c container collection. // rdar://9293227


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159847 91177308-0d34-0410-b5e6-96231b3b80d8
objc-arc: warn when assigning retained object to
a 'weak' property just as we do the same for
'weak' variables. // rdar://11814185


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159859 91177308-0d34-0410-b5e6-96231b3b80d8
Sprinkle llvm_unreachable around to placate GCC's -Wreturn-type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159860 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Be careful about LazyCompoundVals, which may be for the first field.

We use LazyCompoundVals to avoid copying the contents of structs and arrays
around in the store, and when we need to pass a struct around that already
has a LazyCompoundVal we just use the original one. However, it's possible
that the first field of a struct may have a LazyCompoundVal of its own, and
we currently can't distinguish a LazyCompoundVal for the first element of a
struct from a LazyCompoundVal for the entire struct. In this case we should
just drop the optimization and make a new LazyCompoundVal that encompasses
the old one.

PR13264 / <rdar://problem/11802440>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159866 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Add comments to Calls.h.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159867 91177308-0d34-0410-b5e6-96231b3b80d8
Constify the argument to SourceLocation::getFromPtrEncoding.

This allows SourceLocations to be stored in generic "data" fields
that are typed as "const void *" and are also used to point to
const objects.

Really we should probably be returning a const pointer from
getPtrEncoding as well, but in some places we want to store
SourceLocations in the same generic "data" field as proper
pointers to /mutable/ objects. Oh well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159868 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Fix mis-committed test. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159869 91177308-0d34-0410-b5e6-96231b3b80d8
Implement -Wpedantic and --no-pedantic to complement -Weverything.

This patch introduces some magic in tablegen to create a "Pedantic" diagnostic
group which automagically includes all warnings that are extensions.  This
allows a user to suppress specific warnings traditionally under -pedantic used
an ordinary warning flag.  This also allows users to use #pragma to silence
specific -pedantic warnings, or promote them to errors, within blocks of text
(just like any other warning).

-Wpedantic is NOT an alias for -pedantic.  Instead, it provides another way
to (a) activate -pedantic warnings and (b) disable them.  Where they differ
is that -pedantic changes the behavior of the preprocessor slightly, whereas
-Wpedantic does not (it just turns on the warnings).

The magic in the tablegen diagnostic emitter has to do with computing the minimal
set of diagnostic groups and diagnostics that should go into -Wpedantic, as those
diagnostics that already members of groups that themselves are (transitively) members
of -Wpedantic do not need to be included in the Pedantic group directly.  I went
back and forth on whether or not to magically generate this group, and the invariant
was that we always wanted extension warnings to be included in -Wpedantic "some how",
but the bookkeeping would be very onerous to manage by hand.

-no-pedantic (and --no-pedantic) is included for completeness, and matches many of the
same kind of flags the compiler already supports.  It does what it says: cancels out
-pedantic.  One discrepancy is that if one specifies --no-pedantic and -Weverything or
-Wpedantic the pedantic warnings are still enabled (essentially the -W flags win).  We
can debate the correct behavior here.

Along the way, this patch nukes some code in TextDiagnosticPrinter.cpp and CXStoredDiagnostic.cpp
that determine whether to include the "-pedantic" flag in the warning output.  This is
no longer needed, as all extensions now have a -W flag.

This patch also significantly reduces the number of warnings not under flags from 229
to 158 (all extension warnings).  That's a 31% reduction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159875 91177308-0d34-0410-b5e6-96231b3b80d8
Restrict the set of declaration kinds for which we allow trailing comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159878 91177308-0d34-0410-b5e6-96231b3b80d8
Revert rr159875, "Implement -Wpedantic and --no-pedantic to complement -Weverything." It broke several builds.

I suspect FileCheck might match assertion failure, even if clang/test/Misc/warning-flags.c passed the test.

> 0. Program arguments: bin/./clang -### -pedantic -Wpedantic clang/test/Driver/warning-options.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159886 91177308-0d34-0410-b5e6-96231b3b80d8
Re-apply r159875 with fixes.

- Split pedantic driver flag test into separate test file, and XFAIL on cygwin,mingw32
- Fix bug in tablegen logic where a missing '{' caused errors to be included in -Wpedantic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159892 91177308-0d34-0410-b5e6-96231b3b80d8
Enhance 'diagtool list-warnings' to report number of diagnostics covered directly under -Wpedantic, and enhance warning-flags.c test to test that this set does not grow.

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