Move virtual methods out of line.

This is generally a good thing and in this case should also fix the
BUILD_SHARED_LIBS=ON build (see pr19774).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209300 91177308-0d34-0410-b5e6-96231b3b80d8
Improved recovery of switch statement

Make better diagnostic produced by erroneous switch statement.
It fixes PR19022.

Differential Revision: http://reviews.llvm.org/D3137


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209304 91177308-0d34-0410-b5e6-96231b3b80d8
cindex/test_cursor.py: no need to skip implicit decls in tests

clang was fixed some time ago to always skip "builtins and other cruft" so
tools no longer need hacks like this.

Passes nosetests.

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

Summary:
Naming the destructor using a typedef-name for the class-name is
well-formed.

This fixes PR19620.

Reviewers: rsmith, doug.gregor

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3583

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209319 91177308-0d34-0410-b5e6-96231b3b80d8
Provide an aka for the C++ operator name macro diagnostic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209322 91177308-0d34-0410-b5e6-96231b3b80d8
VirtualFileSystem: Fix a few directory traversal bugs in VFSWriter

There are a couple of issues with writing VFS maps that are awkward to
fix within the current mutually recursive approach. Instead, replace
the algorithm with an iterative version that uses an explicit stack of
directories.

Includes tests for cases the old approach was tripping on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209332 91177308-0d34-0410-b5e6-96231b3b80d8
Add hasSameType overload to ASTContext for Type pointers.  Switch a type
comparison check to use this instead of calling Type::getCanonicalTypeInternal


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209378 91177308-0d34-0410-b5e6-96231b3b80d8
[C++11] Use 'nullptr'. Frontend edition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209389 91177308-0d34-0410-b5e6-96231b3b80d8
[C++11] Use 'nullptr'. Serialization edition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209392 91177308-0d34-0410-b5e6-96231b3b80d8
Frontend: Propagate ASTReaderListener API in ChainedASTReaderListener

ASTReaderListener's documentation states that visitInputFile will be
called based on the return values of needsInputFileVisitation and
needsSystemInputFileVisitation, but ChainedASTReaderListener may call
these methods on a child listener based on the values returned by the
other child.

Even worse, the calls to visitInputFile may be short-circuited due to
the use of the boolean or, so the calls to visit may not occur at all
for the second listener.

This updates ChainedASTReaderListener::visitInputFile to propagate the
ASTReaderListener behaviour to both children.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209394 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Correctly calculate line lenghts for nest blocks.

If simple (one-statement) blocks can be inlined, the length needs to be
calculated correctly.

Before (in JavaScript but this also affects lambdas, etc.):
  var x = {
    valueOf: function() { return 1; }
  };

After:
  var x = {valueOf: function() { return 1; }};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209410 91177308-0d34-0410-b5e6-96231b3b80d8
This patch adds a helper class (CGLoopInfo) for marking memory instructions with llvm.mem.parallel_loop_access metadata.
It also adds a simple initial version of codegen for pragma omp simd (it will change in the future to support all the clauses).

Differential revision: http://reviews.llvm.org/D3644



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209411 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Correctly identify multiplications in braces init lists.

Before:
  int i{a *b};

After:
  int i{a * b};

Also fix unrelated issue where braced init lists were counted as blocks
and prevented single-line functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209412 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: [JS] Understand line breaks in concatenated strings.

Before:
  var literal = 'hello ' + 'world';

After:
  var literal = 'hello ' +
                'world';

There is no reason to concatenated two string literals with a '+' unless
the line break is intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209413 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Fix vim-integration for empty files.

Discovered by Ahmed Charles in http://reviews.llvm.org/D3018.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209417 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Store pointers to seen formatting states.

As the memory ownership is handled by the SpecificBumpPtrAllocator
anyway, there is no need to duplicate states when inserting them into
the Seen-set. This leads to an improvement of ~10% on the benchmark
formatting file.

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209422 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Fix incorrect braced init identification.

Before:
  int foo(int i) {
    return fo1 {}
    (i);
  }
  int foo(int i) {
    return fo1 {}
    (i);
  }

After:
  int foo(int i) { return fo1{}(i); }
  int foo(int i) { return fo1{}(i); }

This fixes llvm.org/PR19812.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209428 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Fix braced list detection.

Before:
  static_assert(std::is_integral<int> {} + 0, "");
  int a = std::is_integral<int> {}
  + 0;

After:
  static_assert(std::is_integral<int>{} + 0, "");
  int a = std::is_integral<int>{} + 0;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209431 91177308-0d34-0410-b5e6-96231b3b80d8
Use stack protector strong by default on OpenBSD.

Use stack protector strong by default to match the base OS and ports/packages
compiler policy.

Patch by Brad Smith.

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