clang-format: Fix fake parentheses placement with comments.

Before:
  return (a > b
          // comment1
      // comment2
      || c);

After:
  return (a > b
      // comment1
      // comment2
      || c);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223234 91177308-0d34-0410-b5e6-96231b3b80d8
Fix isThreadModelSupported()'s comment. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223241 91177308-0d34-0410-b5e6-96231b3b80d8
Make ArgumentsAdjuster an std::function.

Reviewers: klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223248 91177308-0d34-0410-b5e6-96231b3b80d8
Teach EvaluatedExprVisitor that the condition and unselected branches of a
_Generic expression are unevaluated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223266 91177308-0d34-0410-b5e6-96231b3b80d8
Cast vtable address points to i32 (...)** to enable more globalopt

We currently use i32 (...)** as the type of the vptr field in the LLVM
struct type. LLVM's GlobalOpt prefers any bitcasts to be on the side of
the data being stored rather than on the pointer being stored to.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223267 91177308-0d34-0410-b5e6-96231b3b80d8
CUDA host device code with two code paths

Summary:
Allow CUDA host device functions with two code paths using __CUDA_ARCH__
to differentiate between code path being compiled.

For example:
  __host__ __device__ void host_device_function(void) {
  #ifdef __CUDA_ARCH__
    device_only_function();
  #else
    host_only_function();
  #endif
  }

Patch by Jacques Pienaar.

Reviewed By: rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223271 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang part

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223311 91177308-0d34-0410-b5e6-96231b3b80d8
Implement __umulh with __int128 arithmetic

Use the same approach as _umul128, but just return the high half.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223316 91177308-0d34-0410-b5e6-96231b3b80d8
Add test for __umulh

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223319 91177308-0d34-0410-b5e6-96231b3b80d8
CMake: try to actually fix the regexes for setting HOST_LINK_VERSION this time (PR21268)

The regex should not accept an empty version number.

The previous attempt at r223106 failed, and the build was still erroring:

  CMake Error at tools/clang/CMakeLists.txt:269 (string):
    string sub-command REGEX, mode REPLACE regex "[^0-9]*([0-9.]*).*" matched
    an empty string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223333 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: refactor ARM builtin handling

Create a helper function to construct a value for the ARM hint intrinsic
rather than inling the construction.  In order to avoid the use of the sentinel
value, inline the use of intrinsic instruction retrieval.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223338 91177308-0d34-0410-b5e6-96231b3b80d8
Always emit kernel arg info for SPIR.

http://llvm.org/bugs/show_bug.cgi?id=21555

Currently, kernel argument metadata is omitted unless the
"-cl-kernel-arg-info" option is specified. But the SPIR 1.2 spec
requires that all metadata except kernel_arg_name should always be
emitted, and kernel_arg_name is only emitted when
"-cl-kernel-arg-info" is specified.

Patch ported by Ryan Burn from the Khronos SPIR generator.
https://github.com/KhronosGroup/SPIR



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223340 91177308-0d34-0410-b5e6-96231b3b80d8
[OPENMP] Codegen for 'omp master' directive
Patch adds 2 library functions to OpenMPRuntime class - int32 kmpc_master(ident_t *, int32 gtid) and void kmpc_end_master(ident_t *, int32 gtid);
For 'omp master' directive the next code is generated:

if (__kmpc_master(loc, gtid)) {
    <Associated structured block>;
      __kmpc_end_master(log, gtid);
}

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223342 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: More restrictively classify import declarations.

Before:
  import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa,
                       aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223345 91177308-0d34-0410-b5e6-96231b3b80d8
Make getInsertArgumentAdjuster insert extra arguments to the end by default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223352 91177308-0d34-0410-b5e6-96231b3b80d8
Fix PR21684 - Ellipsis following an 'auto' parameter sans name/ID 
should indicate a c++ parameter pack not a c-variadic.

int i = [](auto...) { return 0; }(); // OK now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223357 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: [JS] Don't put top-level dict literals on a single line.

These are often used for enums which apparently are easier to read if
formatted with one element per line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223367 91177308-0d34-0410-b5e6-96231b3b80d8
Merge from trunk (adjusting for r223271)
Merge commit 'f514ca8aa824579b46ddecbdebd34315c356505d'; branch 'master'
Merge commit '528f83c9a59bd64e608db95b26570a8aea3c5ec2'; branch 'master'