Add missing virtual destructors reported by -Wnon-virtual-dtor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169365 91177308-0d34-0410-b5e6-96231b3b80d8
Minor reorganization. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169367 91177308-0d34-0410-b5e6-96231b3b80d8
PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be
the LHS of a token paste. Use "expanded from here" instead when we're not sure
it's actually a macro.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169373 91177308-0d34-0410-b5e6-96231b3b80d8
In C++, if we hit an error in the class-head, don't try to parse the class body.
Our error recovery path may have made the class anonymous, and that has a pretty
disastrous impact on any attempt to parse a class body containing constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169374 91177308-0d34-0410-b5e6-96231b3b80d8
test/Modules/build-fail-notes.m: Tweak to unbreak Win32 hosts to relax expressions, for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169375 91177308-0d34-0410-b5e6-96231b3b80d8
Reuse an existing diagnostic for tsan/msan needing -pie error.
Add a diagnosting for -fsanitize=memory conflicting with other sanitizers.
Extend tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169380 91177308-0d34-0410-b5e6-96231b3b80d8
Follow-up to r169286, addresses comments in http://llvm-reviews.chandlerc.com/D164#comment-4 : comments and a method rename

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169382 91177308-0d34-0410-b5e6-96231b3b80d8
Indentation fixes for clang-format.

- Fix behavior of memoization together with optimization
- Correctly attribute the PenaltyIndentLevel (breaking directly after "(" did
  not count towards the inner level)
- Recognize more tokens as assignments

Review: http://llvm-reviews.chandlerc.com/D172

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169384 91177308-0d34-0410-b5e6-96231b3b80d8
Clang-format: parse for and while loops

Summary: Adds support for formatting for and while loops.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169387 91177308-0d34-0410-b5e6-96231b3b80d8
Remove bad and useless enum to bool conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169390 91177308-0d34-0410-b5e6-96231b3b80d8
Format strings: the correct conversion for 'char' is %c, not %d or %hhd.

We tried to account for 'uint8_t' by saying that /typedefs/ of 'char'
should be corrected as %hhd rather than %c, but the condition was wrong.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169397 91177308-0d34-0410-b5e6-96231b3b80d8
Format strings: a character literal should be printed with %c, not %d.

The type of a character literal is 'int' in C, but if the user writes a
character /as/ a literal, we should assume they meant it to be a
character and not a numeric value, and thus offer %c as a correction
rather than %d.

There's a special case for multi-character literals (like 'MooV'), which
have implementation-defined value and usually cannot be printed with %c.
These still use %d as the suggestion.

In C++, the type of a character literal is 'char', and so this problem
doesn't exist.

<rdar://problem/12282316>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169398 91177308-0d34-0410-b5e6-96231b3b80d8
Format strings: add more expression types that don't need parens to cast.

No functionality change (the test change is a comment only, and the new
functionality can't be tested using the current test).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169399 91177308-0d34-0410-b5e6-96231b3b80d8
Format strings: offer a cast to 'unichar' for %C in Objective-C contexts.

For most cases where a conversion specifier doesn't match an argument,
we usually guess that the conversion specifier is wrong. However, if
the argument is an integer type and the specifier is %C, it's likely
the user really did mean to print the integer as a character.

(This is more common than %c because there is no way to specify a unichar
literal -- you have to write an integer literal, such as '0x2603',
and then cast it to unichar.)

This does not change the behavior of %S, since there are fewer cases
where printing a literal Unicode *string* is necessary, but this could
easily be changed in the future.

<rdar://problem/11982013>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169400 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-inline asm] Add more tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169411 91177308-0d34-0410-b5e6-96231b3b80d8
Testing C++ declarations embedded in
<declaration> tag of Comment XML.
Added DeclPrint support for constructors
and fix tests accordingly.
This is wip. // rdar://12378714


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169413 91177308-0d34-0410-b5e6-96231b3b80d8
[driver, ms-inline asm] MS-Style inline assembly is controlled by the
-fasm-blocks flag, not the -fms-extensions flag.
rdar://12808010

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169422 91177308-0d34-0410-b5e6-96231b3b80d8
Fix name. The array is unboundED.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169429 91177308-0d34-0410-b5e6-96231b3b80d8
[c-index-test] Introduce '-index-compile-db' which accepts a compilation database file
and does an '-index-file' for all compile commands in the database.

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