r270401 - [Clang][AVX512][BUILTIN]adding missing intrinsics for movdaq instruction set

2016-05-23 Thread Michael Zuckerman via cfe-commits
Author: mzuckerm
Date: Mon May 23 03:01:48 2016
New Revision: 270401

URL: http://llvm.org/viewvc/llvm-project?rev=270401&view=rev
Log:
[Clang][AVX512][BUILTIN]adding missing intrinsics for movdaq instruction set

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


Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512fintrin.h
cfe/trunk/lib/Headers/avx512vlintrin.h
cfe/trunk/test/CodeGen/avx512f-builtins.c
cfe/trunk/test/CodeGen/avx512vl-builtins.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=270401&r1=270400&r2=270401&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Mon May 23 03:01:48 2016
@@ -1723,6 +1723,11 @@ TARGET_BUILTIN(__builtin_ia32_psrlw128_m
 TARGET_BUILTIN(__builtin_ia32_psrlw256_mask, 
"V16sV16sV8sV16sUs","","avx512bw,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_psrlwi128_mask, 
"V8sV8sIiV8sUc","","avx512bw,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_psrlwi256_mask, 
"V16sV16sIiV16sUs","","avx512bw,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_movdqa32_128_mask, "V4iV4iV4iUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_movdqa32_256_mask, "V8iV8iV8iUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_movdqa32_512_mask, "V16iV16iV16iUs","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_movdqa32load128_mask, 
"V4iV4i*V4iUc","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_movdqa32load256_mask, 
"V8iV8i*V8iUc","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_movdqa32load512_mask, 
"V16iV16iC*V16iUs","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_movdqa32store512_mask, 
"vV16i*V16iUs","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_movdqa64_512_mask, 
"V8LLiV8LLiV8LLiUc","","avx512f")

Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=270401&r1=270400&r2=270401&view=diff
==
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Mon May 23 03:01:48 2016
@@ -4926,6 +4926,23 @@ _mm512_mask_store_epi32 (void *__P, __mm
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mask_mov_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
+{
+  return (__m512i) __builtin_ia32_movdqa32_512_mask ((__v16si) __A,
+ (__v16si) __W,
+ (__mmask16) __U);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_maskz_mov_epi32 (__mmask16 __U, __m512i __A)
+{
+  return (__m512i) __builtin_ia32_movdqa32_512_mask ((__v16si) __A,
+ (__v16si)
+ _mm512_setzero_si512 (),
+ (__mmask16) __U);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_mask_mov_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
 {
   return (__m512i) __builtin_ia32_movdqa64_512_mask ((__v8di) __A,

Modified: cfe/trunk/lib/Headers/avx512vlintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlintrin.h?rev=270401&r1=270400&r2=270401&view=diff
==
--- cfe/trunk/lib/Headers/avx512vlintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vlintrin.h Mon May 23 03:01:48 2016
@@ -5834,7 +5834,78 @@ _mm256_maskz_srav_epi64 (__mmask8 __U, _
   (__mmask8) __U);
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_mask_mov_epi32 (__m128i __W, __mmask8 __U, __m128i __A)
+{
+  return (__m128i) __builtin_ia32_movdqa32_128_mask ((__v4si) __A,
+ (__v4si) __W,
+ (__mmask8) __U);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_maskz_mov_epi32 (__mmask8 __U, __m128i __A)
+{
+  return (__m128i) __builtin_ia32_movdqa32_128_mask ((__v4si) __A,
+ (__v4si)
+ _mm_setzero_si128 (),
+ (__mmask8) __U);
+}
+
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_mask_mov_epi32 (__m256i __W, __mmask8 __U, __m256i __A)
+{
+  return (__m256i) __builtin_ia32_movdqa32_256_mask ((__v8si) __A,
+ (__v8si) __W,
+ (__mmask8) __U);
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_maskz_mov_epi32 (__mmask8 __U, __m256i __A)
+{
+  return (__m256i) __builtin_ia32_movdqa32_256_mask ((__v8si) __A,
+ (__v8si)
+ _mm256_setzero_si256 (),
+ (__mmask8) __U);
+}
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_mask_load_epi32 (__m128i __W, __mmask8 __U, void const *__P)
+{
+  return (__m128i) __builtin_ia32_movdqa32load128_mask ((__v4si *) __P,
+  (__v4si) __W,
+  (__mmask8)
+  __U);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_maskz_load_epi32 (__mmask8 __U, void const *__P)
+{
+  return (__m128i) __builtin_ia3

Re: [PATCH] D20514: [Clang][AVX512][BUILTIN]adding missing intrinsics for movdaq instruction set

2016-05-23 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL270401: [Clang][AVX512][BUILTIN]adding missing intrinsics 
for movdaq instruction set (authored by mzuckerm).

Changed prior to commit:
  http://reviews.llvm.org/D20514?vs=58050&id=58074#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20514

Files:
  cfe/trunk/include/clang/Basic/BuiltinsX86.def
  cfe/trunk/lib/Headers/avx512fintrin.h
  cfe/trunk/lib/Headers/avx512vlintrin.h
  cfe/trunk/test/CodeGen/avx512f-builtins.c
  cfe/trunk/test/CodeGen/avx512vl-builtins.c

Index: cfe/trunk/lib/Headers/avx512fintrin.h
===
--- cfe/trunk/lib/Headers/avx512fintrin.h
+++ cfe/trunk/lib/Headers/avx512fintrin.h
@@ -4926,6 +4926,23 @@
 }
 
 static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mask_mov_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
+{
+  return (__m512i) __builtin_ia32_movdqa32_512_mask ((__v16si) __A,
+ (__v16si) __W,
+ (__mmask16) __U);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_maskz_mov_epi32 (__mmask16 __U, __m512i __A)
+{
+  return (__m512i) __builtin_ia32_movdqa32_512_mask ((__v16si) __A,
+ (__v16si)
+ _mm512_setzero_si512 (),
+ (__mmask16) __U);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
 _mm512_mask_mov_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
 {
   return (__m512i) __builtin_ia32_movdqa64_512_mask ((__v8di) __A,
Index: cfe/trunk/lib/Headers/avx512vlintrin.h
===
--- cfe/trunk/lib/Headers/avx512vlintrin.h
+++ cfe/trunk/lib/Headers/avx512vlintrin.h
@@ -5834,7 +5834,78 @@
   (__mmask8) __U);
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_mask_mov_epi32 (__m128i __W, __mmask8 __U, __m128i __A)
+{
+  return (__m128i) __builtin_ia32_movdqa32_128_mask ((__v4si) __A,
+ (__v4si) __W,
+ (__mmask8) __U);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_maskz_mov_epi32 (__mmask8 __U, __m128i __A)
+{
+  return (__m128i) __builtin_ia32_movdqa32_128_mask ((__v4si) __A,
+ (__v4si)
+ _mm_setzero_si128 (),
+ (__mmask8) __U);
+}
+
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_mask_mov_epi32 (__m256i __W, __mmask8 __U, __m256i __A)
+{
+  return (__m256i) __builtin_ia32_movdqa32_256_mask ((__v8si) __A,
+ (__v8si) __W,
+ (__mmask8) __U);
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_maskz_mov_epi32 (__mmask8 __U, __m256i __A)
+{
+  return (__m256i) __builtin_ia32_movdqa32_256_mask ((__v8si) __A,
+ (__v8si)
+ _mm256_setzero_si256 (),
+ (__mmask8) __U);
+}
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_mask_load_epi32 (__m128i __W, __mmask8 __U, void const *__P)
+{
+  return (__m128i) __builtin_ia32_movdqa32load128_mask ((__v4si *) __P,
+  (__v4si) __W,
+  (__mmask8)
+  __U);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_maskz_load_epi32 (__mmask8 __U, void const *__P)
+{
+  return (__m128i) __builtin_ia32_movdqa32load128_mask ((__v4si *) __P,
+  (__v4si)
+  _mm_setzero_si128 (),
+  (__mmask8)
+  __U);
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_mask_load_epi32 (__m256i __W, __mmask8 __U, void const *__P)
+{
+  return (__m256i) __builtin_ia32_movdqa32load256_mask ((__v8si *) __P,
+  (__v8si) __W,
+  (__mmask8)
+  __U);
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+_mm256_maskz_load_epi32 (__mmask8 __U, void const *__P)
+{
+  return (__m256i) __builtin_ia32_movdqa32load256_mask ((__v8si *) __P,
+  (__v8si)
+  _mm256_setzero_si256 (),
+  (__mmask8)
+  __U);
+}
 
 static __inline__ void __DEFAULT_FN_ATTRS
 _mm_mask_store_epi32 (void *__P, __mmask8 __U, __m128i __A)
Index: cfe/trunk/include/clang/Basic/BuiltinsX86.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def
@@ -1723,6 +1723,11 @@
 TARGET_BUILTIN(__builtin_ia32_psrlw256_mask, "V16sV16sV8sV16sUs","","avx512bw,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_psrlwi128_mask, "V8sV8sIiV8sUc","","avx512bw,avx512vl")
 TARGET_BUILTIN(__builtin_ia32_psrlwi256_mask, "V16sV16sIiV16sUs","","avx512bw,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_movdqa32_128_mask, "V4iV4iV4iUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_movdqa32_256_mask, "V8iV8iV8iUc","","avx512vl")
+TARGET_BUILTIN(__builtin_ia32_movdqa32_512_mask, "V16iV16iV16iUs","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_movdqa32load128_mask, "V4iV4i*V4iUc","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_movdqa32load256_mask, "V8iV8i*V8iUc","","avx512f")
 TARGET_BUILTIN(__builtin_i

Re: [PATCH] D20089: Adding a TargetParser for AArch64

2016-05-23 Thread Renato Golin via cfe-commits
rengolin added a comment.

Hi Jojo,

This is looking better, thanks!

While I agree with Bradley that the repetition is not pretty, but I think it 
will expose all issues to make a class design simple and straightforward, once 
we get all the sharp edges out. But we need to know what are the difficulties 
on Clang, llc and the back-ends, and make sure that the architectural part of 
the change is correct, before we that.

A class based design *will* change how every TargetParser method is being 
called now, and will touch a large number of files with mechanical changes, 
including in the ARM side, unrelated to the addition of AArch64.

After my failed attempt at getting a class design across, I'd rather introduce 
functionality first, then design better, than the other way round. But I think 
they should be separated commits based on their intents and merits alone.

cheers,
--renato



Comment at: include/llvm/Support/AArch64TargetParser.def:20
@@ +19,3 @@
+AARCH64_ARCH("armv8-a", AK_ARMV8A, "8-A", "v8", ARMBuildAttrs::CPUArch::v8_A,
+  FK_CRYPTO_NEON_FP_ARMV8, (AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 
AArch64::AEK_FP | AArch64::AEK_SIMD | AArch64::AEK_FP16 | AArch64::AEK_PROFILE))
+AARCH64_ARCH("armv8.1-a", AK_ARMV8_1A, "8.1-A", "v8.1a", 
ARMBuildAttrs::CPUArch::v8_A,

Please, format this file to 80-columns.


Comment at: include/llvm/Support/AArch64TargetParser.def:31
@@ +30,3 @@
+// FIXME: This would be nicer were it tablegen
+AARCH64_ARCH_EXT_NAME("invalid",  AArch64::AEK_INVALID,  nullptr,  nullptr)
+AARCH64_ARCH_EXT_NAME("none", AArch64::AEK_NONE, nullptr,  nullptr)

Same comment as the ARM def file, wrapping with "namespace AArch64 { }".


Comment at: include/llvm/Support/ARMTargetParser.def:48
@@ -47,3 +47,3 @@
 ARM_ARCH("invalid", AK_INVALID, nullptr, nullptr,
-  ARMBuildAttrs::CPUArch::Pre_v4, FK_NONE, AEK_NONE)
+  ARMBuildAttrs::CPUArch::Pre_v4, FK_NONE, ARM::AEK_NONE)
 ARM_ARCH("armv2", AK_ARMV2, "2", "v2", ARMBuildAttrs::CPUArch::Pre_v4,

This is the "ARM" def file, maybe wrap with "namespace ARM { }"?


Comment at: include/llvm/Support/TargetParser.h:144
@@ +143,3 @@
+
+namespace AArch64 {
+

Please, add a FIXME line here, saying this really should be made into a class, 
to use ARM's methods from inheritance.


Comment at: lib/Support/TargetParser.cpp:764
@@ +763,3 @@
+  Arch = getCanonicalArchName(Arch);
+  if (!Arch.startswith("v8"))
+return ARM::AK_INVALID;

Maybe a better check here would be:

if (checkArchVersion(Arch) < 8)
return ARM::AK_INVALID;


Comment at: lib/Support/TargetParser.cpp:770
@@ +769,3 @@
+if (A.getName().endswith(Syn)) {
+  if (A.ID == ARM::AK_ARMV8_1A)
+Features.push_back("+v8.1a");

I don't like mixing Features with parseArch. Maybe we could do two different 
methods and get callers to use both when needed, just like with ARM.

parseArch needs to be dead simple.


http://reviews.llvm.org/D20089



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18035: [GCC] PR23529 Mangler part of attrbute abi_tag support

2016-05-23 Thread Dmitry Polukhin via cfe-commits
DmitryPolukhin updated this revision to Diff 58076.
DmitryPolukhin added a comment.

Fix test/PCH/attrs.c failure due to warning about unsupported abi_tag attribute 
(committed in http://reviews.llvm.org/rL269869).
This patch implements abi_tag so the warning is not expected with this patch.


http://reviews.llvm.org/D18035

Files:
  lib/AST/ItaniumMangle.cpp
  lib/Sema/SemaDeclAttr.cpp
  test/CodeGenCXX/mangle-abi-tag.cpp
  test/PCH/attrs.c
  test/SemaCXX/attr-abi-tag-syntax.cpp

Index: test/SemaCXX/attr-abi-tag-syntax.cpp
===
--- test/SemaCXX/attr-abi-tag-syntax.cpp
+++ test/SemaCXX/attr-abi-tag-syntax.cpp
@@ -16,28 +16,18 @@
 // expected-warning@-1 {{'abi_tag' attribute on anonymous namespace ignored}}
 
 inline namespace N __attribute__((__abi_tag__)) {}
-// FIXME: remove this warning as soon as attribute fully supported.
-// expected-warning@-2 {{'__abi_tag__' attribute ignored}}
 
 } // namespcace N2
 
 __attribute__((abi_tag("B", "A"))) extern int a1;
-// FIXME: remove this warning as soon as attribute fully supported.
-// expected-warning@-2 {{'abi_tag' attribute ignored}}
 
 __attribute__((abi_tag("A", "B"))) extern int a1;
 // expected-note@-1 {{previous declaration is here}}
-// FIXME: remove this warning as soon as attribute fully supported.
-// expected-warning@-3 {{'abi_tag' attribute ignored}}
 
 __attribute__((abi_tag("A", "C"))) extern int a1;
 // expected-error@-1 {{'abi_tag' C missing in original declaration}}
-// FIXME: remove this warning as soon as attribute fully supported.
-// expected-warning@-3 {{'abi_tag' attribute ignored}}
 
 extern int a2;
 // expected-note@-1 {{previous declaration is here}}
 __attribute__((abi_tag("A")))extern int a2;
 // expected-error@-1 {{cannot add 'abi_tag' attribute in a redeclaration}}
-// FIXME: remove this warning as soon as attribute fully supported.
-// expected-warning@-3 {{'abi_tag' attribute ignored}}
Index: test/PCH/attrs.c
===
--- test/PCH/attrs.c
+++ test/PCH/attrs.c
@@ -9,7 +9,7 @@
 #define HEADER
 
 int f(int) __attribute__((visibility("default"), overloadable));
-int g(int) __attribute__((abi_tag("foo", "bar", "baz"), no_sanitize("address", "memory"))); // expected-warning {{ignored}}
+int g(int) __attribute__((abi_tag("foo", "bar", "baz"), no_sanitize("address", "memory")));
 
 #else
 
Index: test/CodeGenCXX/mangle-abi-tag.cpp
===
--- /dev/null
+++ test/CodeGenCXX/mangle-abi-tag.cpp
@@ -0,0 +1,146 @@
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -std=c++11 -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple i686-linux-gnu -std=c++11 -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-linux-gnu -std=c++11 -o - | FileCheck %s
+
+struct __attribute__((abi_tag("A", "B"))) A { };
+
+struct B: A { };
+
+template
+
+struct C {
+};
+
+struct D { A* p; };
+
+template
+struct __attribute__((abi_tag("C", "D"))) E {
+};
+
+struct __attribute__((abi_tag("A", "B"))) F { };
+
+A a1;
+// CHECK: @_Z2a1B1AB1B =
+
+__attribute__((abi_tag("C", "D")))
+A a2;
+// CHECK: @_Z2a2B1AB1BB1CB1D =
+
+B a3;
+// CHECK: @a3 =
+
+C a4;
+// CHECK: @_Z2a4B1AB1B =
+
+D a5;
+// CHECK: @a5 =
+
+E a6;
+// CHECK: @_Z2a6B1CB1D =
+
+E a7;
+// CHECK: @_Z2a7B1AB1BB1CB1D =
+
+template<>
+struct E {
+  static float a8;
+};
+float E::a8;
+// CHECK: @_ZN1EB1CB1DIfE2a8E =
+
+template<>
+struct E {
+  static bool a9;
+};
+bool E::a9;
+// CHECK: @_ZN1EB1CB1DI1FB1AB1BE2a9E =
+
+struct __attribute__((abi_tag("A", "B"))) A10 {
+  virtual ~A10() {}
+} a10;
+// vtable
+// CHECK: @_ZTV3A10B1AB1B =
+// typeinfo
+// CHECK: @_ZTI3A10B1AB1B =
+
+// Local variables from f13.
+// f13()::L::foo[abi:C][abi:D]()::a[abi:A][abi:B]
+// CHECK-DAG: @_ZZZ3f13vEN1L3fooB1CB1DEvE1aB1AB1B =
+// guard variable for f13()::L::foo[abi:C][abi:D]()::a[abi:A][abi:B]
+// CHECK-DAG: @_ZGVZZ3f13vEN1L3fooB1CB1DEvE1aB1AB1B =
+
+__attribute__ ((abi_tag("C", "D")))
+void* f1() {
+  return 0;
+}
+// CHECK: define {{.*}} @_Z2f1B1CB1Dv(
+
+__attribute__ ((abi_tag("C", "D")))
+A* f2() {
+  return 0;
+}
+// CHECK: define {{.*}} @_Z2f2B1AB1BB1CB1Dv(
+
+B* f3() {
+  return 0;
+}
+// CHECK: define {{.*}} @_Z2f3v(
+
+C* f4() {
+  return 0;
+}
+// CHECK: define {{.*}} @_Z2f4B1AB1Bv(
+
+D* f5() {
+  return 0;
+}
+// CHECK: define {{.*}} @_Z2f5v(
+
+E* f6() {
+  return 0;
+}
+// CHECK: define {{.*}} @_Z2f6B1CB1Dv(
+
+E* f7() {
+  return 0;
+}
+// CHECK: define {{.*}} @_Z2f7B1AB1BB1CB1Dv(
+
+void f8(E*) {
+}
+// CHECK: define {{.*}} @_Z2f8P1EB1CB1DI1AB1AB1BE(
+
+inline namespace Names1 __attribute__((__abi_tag__)) {
+class C1 {};
+}
+C1 f9() { return C1(); }
+// CHECK: @_Z2f9B6Names1v(
+
+inline namespace Names2 __attribute__((__abi_tag__("Tag1", "Tag2"))) {
+class C2 {};
+}
+C2 f10() { return C2(); }
+// CHECK: @_Z3f10B4Tag1B4Tag2v(
+
+void __attribute__((abi_tag("A"))) f11(A) {}
+// f11[abi:A](A[ab

[PATCH] D20519: [clang-tidy] Ignore ADL-style using decls in unused-using-decls check.

2016-05-23 Thread Haojian Wu via cfe-commits
hokein created this revision.
hokein added a reviewer: alexfh.
hokein added a subscriber: cfe-commits.

http://reviews.llvm.org/D20519

Files:
  clang-tidy/misc/UnusedUsingDeclsCheck.cpp
  test/clang-tidy/misc-unused-using-decls.cpp

Index: test/clang-tidy/misc-unused-using-decls.cpp
===
--- test/clang-tidy/misc-unused-using-decls.cpp
+++ test/clang-tidy/misc-unused-using-decls.cpp
@@ -93,6 +93,14 @@
 DEFINE_INT(test);
 #undef DEFIND_INT
 
+namespace N1 {
+  struct S {};
+  template void f(S);
+}
+namespace N2 {
+  template void f(T t);
+}
+
 // - Usages -
 void f(B b);
 void g() {
@@ -107,3 +115,7 @@
   cout << endl;
 }
 
+void ADL(N1::S s) {
+  using N2::f;
+  f<3>(s);
+}
Index: clang-tidy/misc/UnusedUsingDeclsCheck.cpp
===
--- clang-tidy/misc/UnusedUsingDeclsCheck.cpp
+++ clang-tidy/misc/UnusedUsingDeclsCheck.cpp
@@ -18,20 +18,9 @@
 namespace tidy {
 namespace misc {
 
-// A function that helps to tell whether a TargetDecl will be checked.
-// We only check a TargetDecl if :
-//   * The corresponding UsingDecl is not defined in macros or in class
-// definitions.
-//   * Only variable, function and class types are considered.
+// A function that helps to tell whether a TargetDecl of a UsingDecl will be
+// checked. We only check variable, function and class types.
 static bool ShouldCheckDecl(const Decl *TargetDecl) {
-  // Ignores using-declarations defined in macros.
-  if (TargetDecl->getLocation().isMacroID())
-return false;
-
-  // Ignores using-declarations defined in class definition.
-  if (isa(TargetDecl->getDeclContext()))
-return false;
-
   return isa(TargetDecl) || isa(TargetDecl) ||
  isa(TargetDecl) || isa(TargetDecl) ||
  isa(TargetDecl);
@@ -49,6 +38,17 @@
 
 void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
   if (const auto *Using = Result.Nodes.getNodeAs("using")) {
+// Ignores using-declarations defined in macros.
+if (Using->getLocation().isMacroID())
+  return;
+// Ignores using-declarations defined in class definitions.
+if (isa(Using->getDeclContext()))
+  return;
+// Ignores using-declarations defined in function definitions to avoid
+// arguement-dependent lookup.
+if (isa(Using->getDeclContext()))
+  return;
+
 UsingDeclContext Context(Using);
 Context.UsingDeclRange = CharSourceRange::getCharRange(
 Using->getLocStart(),


Index: test/clang-tidy/misc-unused-using-decls.cpp
===
--- test/clang-tidy/misc-unused-using-decls.cpp
+++ test/clang-tidy/misc-unused-using-decls.cpp
@@ -93,6 +93,14 @@
 DEFINE_INT(test);
 #undef DEFIND_INT
 
+namespace N1 {
+  struct S {};
+  template void f(S);
+}
+namespace N2 {
+  template void f(T t);
+}
+
 // - Usages -
 void f(B b);
 void g() {
@@ -107,3 +115,7 @@
   cout << endl;
 }
 
+void ADL(N1::S s) {
+  using N2::f;
+  f<3>(s);
+}
Index: clang-tidy/misc/UnusedUsingDeclsCheck.cpp
===
--- clang-tidy/misc/UnusedUsingDeclsCheck.cpp
+++ clang-tidy/misc/UnusedUsingDeclsCheck.cpp
@@ -18,20 +18,9 @@
 namespace tidy {
 namespace misc {
 
-// A function that helps to tell whether a TargetDecl will be checked.
-// We only check a TargetDecl if :
-//   * The corresponding UsingDecl is not defined in macros or in class
-// definitions.
-//   * Only variable, function and class types are considered.
+// A function that helps to tell whether a TargetDecl of a UsingDecl will be
+// checked. We only check variable, function and class types.
 static bool ShouldCheckDecl(const Decl *TargetDecl) {
-  // Ignores using-declarations defined in macros.
-  if (TargetDecl->getLocation().isMacroID())
-return false;
-
-  // Ignores using-declarations defined in class definition.
-  if (isa(TargetDecl->getDeclContext()))
-return false;
-
   return isa(TargetDecl) || isa(TargetDecl) ||
  isa(TargetDecl) || isa(TargetDecl) ||
  isa(TargetDecl);
@@ -49,6 +38,17 @@
 
 void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
   if (const auto *Using = Result.Nodes.getNodeAs("using")) {
+// Ignores using-declarations defined in macros.
+if (Using->getLocation().isMacroID())
+  return;
+// Ignores using-declarations defined in class definitions.
+if (isa(Using->getDeclContext()))
+  return;
+// Ignores using-declarations defined in function definitions to avoid
+// arguement-dependent lookup.
+if (isa(Using->getDeclContext()))
+  return;
+
 UsingDeclContext Context(Using);
 Context.UsingDeclRange = CharSourceRange::getCharRange(
 Using->getLocStart(),
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

Re: [PATCH] D20496: [include-fixer] Added find-stl-symbols to retrieve symbols (with the correct include header name) from C++ standard STL headers.

2016-05-23 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 58081.
ioeric added a comment.

- removed redundant dependency for findAllSymbols.


http://reviews.llvm.org/D20496

Files:
  include-fixer/CMakeLists.txt
  include-fixer/find-all-symbols/FindAllMacros.cpp
  include-fixer/find-all-symbols/FindAllMacros.h
  include-fixer/find-all-symbols/FindAllSymbols.cpp
  include-fixer/find-all-symbols/FindAllSymbols.h
  include-fixer/find-all-symbols/SymbolReporter.h
  include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp
  include-fixer/find-stl-symbols/CMakeLists.txt
  include-fixer/find-stl-symbols/FindSTLSymbolsAction.cpp
  include-fixer/find-stl-symbols/FindSTLSymbolsAction.h
  include-fixer/find-stl-symbols/STLSymbolsFinder.cpp
  include-fixer/find-stl-symbols/STLSymbolsFinder.h
  include-fixer/find-stl-symbols/tool/CMakeLists.txt
  include-fixer/find-stl-symbols/tool/FindSTLSymbolsMain.cpp
  unittests/include-fixer/CMakeLists.txt
  unittests/include-fixer/find-all-symbols/FindAllSymbolsTests.cpp
  unittests/include-fixer/find-stl-symbols/CMakeLists.txt
  unittests/include-fixer/find-stl-symbols/STLSymbolsFinderTests.cpp

Index: unittests/include-fixer/find-stl-symbols/STLSymbolsFinderTests.cpp
===
--- /dev/null
+++ unittests/include-fixer/find-stl-symbols/STLSymbolsFinderTests.cpp
@@ -0,0 +1,115 @@
+//===-- STLSymbolsFinderTests.cpp - STLSymbolsFinder unittests---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "FindSTLSymbolsAction.h"
+#include "STLSymbolsFinder.h"
+#include "clang/Basic/FileManager.h"
+#include "clang/Basic/VirtualFileSystem.h"
+#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/MemoryBuffer.h"
+#include "gtest/gtest.h"
+#include 
+#include 
+
+using namespace clang::find_all_symbols;
+
+namespace clang {
+namespace find_stl_symbols {
+namespace {
+
+class TestSymbolReporter : public SymbolReporter {
+public:
+  ~TestSymbolReporter() override {}
+
+  void reportSymbol(llvm::StringRef, const SymbolInfo &Symbol,
+const Args *) override {
+Symbols.push_back(Symbol);
+  }
+
+  bool hasSymbol(const SymbolInfo &Symbol) const {
+for (const auto &S : Symbols) {
+  if (S == Symbol)
+return true;
+}
+return false;
+  }
+
+private:
+  std::vector Symbols;
+};
+
+class STLSymbolsFinderTest : public ::testing::Test {
+public:
+  STLSymbolsFinderTest()
+  : InMemoryFS(new vfs::InMemoryFileSystem),
+Files(new FileManager(FileSystemOptions(), InMemoryFS)) {}
+
+protected:
+  bool hasSymbol(const SymbolInfo &Symbol) {
+return Reporter.hasSymbol(Symbol);
+  }
+
+  bool runSTLSymbolsFinder(
+  const std::vector> &Contents) {
+llvm::IntrusiveRefCntPtr InMemoryFileSystem(
+new vfs::InMemoryFileSystem);
+llvm::IntrusiveRefCntPtr Files(
+new FileManager(FileSystemOptions(), InMemoryFileSystem));
+
+// Add headers into InMemoryFileSystem so that Finder and ClangTool can read
+// files from the (virtual) include directory.
+for (const auto &Pair : Contents) {
+  InMemoryFileSystem->addFile(
+  Pair.first, 0, llvm::MemoryBuffer::getMemBuffer(Pair.second));
+}
+
+STLSymbolsFinder Finder(*Files, kIncludePath);
+Finder.run(&Reporter);
+return true;
+  }
+
+  TestSymbolReporter Reporter;
+  llvm::IntrusiveRefCntPtr InMemoryFS;
+  llvm::IntrusiveRefCntPtr Files;
+  std::string kIncludePath = "/include/";
+};
+
+TEST_F(STLSymbolsFinderTest, FindInFakeLibrary) {
+  std::vector> Contents;
+  Contents.emplace_back(kIncludePath + "a",
+"#include \nclass A {};");
+  Contents.emplace_back(kIncludePath + "b", "#include ");
+  Contents.emplace_back(kIncludePath + "internal/a_1.h",
+"#include ");
+  Contents.emplace_back(kIncludePath + "internal/a_2.h",
+"#include ");
+  Contents.emplace_back(kIncludePath + "internal/b_1.h",
+"#include \nclass B{};");
+  // struct Common is included by both a.h and b.h, but b.h has smaller
+  // include depth, so the file path for struct Common will be b.h.
+  Contents.emplace_back(kIncludePath + "internal/common.h",
+"struct Common {};");
+
+  runSTLSymbolsFinder(Contents);
+
+  SymbolInfo Symbol =
+  SymbolInfo("A", SymbolInfo::SymbolKind::Class, "a", 2, {});
+  EXPECT_TRUE(hasSymbol(Symbol));
+
+  Symbol = SymbolInfo("B", SymbolInfo::SymbolKind::Class, "b", 2, {});
+  EXPECT_TRUE(hasSymbol(Symbol));
+
+  Symbol = SymbolInfo("Common", SymbolInfo::SymbolKind::Class, "b", 1, {});
+  EXPECT_TRUE(hasSymbol(Symbol));
+}
+
+} // anonymous namespace
+} // namespace find_stl_symbols
+} // namespace clang
Index: uni

Re: r270373 - [driver][mips] Support new versions of MIPS CodeScape toolchains

2016-05-23 Thread Renato Golin via cfe-commits
On 22 May 2016 at 23:16, Simon Atanasyan  wrote:
> Hope r270380 fixes the problem.

All green, thanks!

--renato
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18953: [ms][dll] #26935 Defining a dllimport function should cause it to be exported

2016-05-23 Thread Andrew V. Tischenko via cfe-commits
avt77 added a comment.

OK, as I see all issues were resolved, right?
Could I commit the patch?


http://reviews.llvm.org/D18953



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D19783: Fix cv-qualification of '*this' captures (and nasty bug PR27507 introduced by commit 263921 "Implement Lambda Capture of *this by Value as [=, *this]")

2016-05-23 Thread Faisal Vali via cfe-commits
faisalv added a comment.

*ping*


http://reviews.llvm.org/D19783



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20321: [Clang][AVX512][intrinsics] Fix vperm intrinsics.

2016-05-23 Thread Igor Breger via cfe-commits
igorb added a comment.

In http://reviews.llvm.org/D20321#436494, @craig.topper wrote:

> Looking at this again. This doesn't match the gcc implementation of the 
> builtins. Unless their header file is also wrong. Can you clarify?


Thanks,
You are correct.  I implemented all changes in code-gen ( 
http://reviews.llvm.org/D20515 ).
If there's no objection, I abandon this review.


Repository:
  rL LLVM

http://reviews.llvm.org/D20321



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] [clang] Emit ObjC method and block annotation attributes to IR

2016-05-23 Thread Alex Denisov via cfe-commits
John McCall may know particular reasons why these annotations are not 
propagated to IR level.

> On 19 May 2016, at 19:37, Max Bazaliy via cfe-commits 
>  wrote:
> 
> Hey,
> 
> For some reason clang does not emit ObjC method and block annotations to IR. 
> Here is a fix for that.
> 
> --
> Max Bazaliy
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20088: Using AArch64TargetParser in clang

2016-05-23 Thread jojo.ma via cfe-commits
jojo added inline comments.


Comment at: lib/Driver/Tools.cpp:707
@@ -696,3 +706,3 @@
   std::string MArch = arm::getARMArch(ArchName, Triple);
-  if (llvm::ARM::parseArch(MArch) == llvm::ARM::AK_INVALID ||
+  if (!checkARMArchValid(MArch) || llvm::ARM::parseArch(MArch) == 
llvm::ARM::AK_INVALID ||
   (Split.second.size() && !DecodeARMFeatures(D, Split.second, Features)))

bsmith wrote:
> Why do we need the call to checkARMArchValid here? Isn't is sufficient that 
> parseArch returns a valid architecture?
Let the TargetParser return correct result.Remove this in the next patchset.


Comment at: lib/Driver/Tools.cpp:2280
@@ -2276,12 +2279,3 @@
 
-  if (Split.first == "armv8-a" || Split.first == "armv8a") {
-// ok, no additional features.
-  } else if (Split.first == "armv8.1-a" || Split.first == "armv8.1a") {
-Features.push_back("+v8.1a");
-  } else if (Split.first == "armv8.2-a" || Split.first == "armv8.2a" ) {
-Features.push_back("+v8.2a");
-  } else {
-return false;
-  }
-
-  if (Split.second.size() && !DecodeAArch64Features(D, Split.second, Features))
+  if (!checkAArch64ArchValid(Split.first) || 
llvm::AArch64::parseArch(Split.first, Features) == llvm::ARM::AK_INVALID ||
+ (Split.second.size() && !DecodeAArch64Features(D, Split.second, 
Features)))

bsmith wrote:
> Same here, why do we need checkAArch64ArchValid?
Same as above.


Repository:
  rL LLVM

http://reviews.llvm.org/D20088



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20089: Adding a TargetParser for AArch64

2016-05-23 Thread jojo.ma via cfe-commits
jojo added a comment.

> There is an awful lot of duplication/passing through to another class in 
> this, it strikes me that this whole thing could benefit from some level of 
> inheritance. I think it would be good to have a base class that defines the 
> interface and have both ARM/AArch64 (and any other architectures that want to 
> use this in the future) implement this interface. That way all of this code 
> can be called generically from clang/wherever.


Dear Bradley,

Thank you very much for such good advice.
Making the TargetParser into class-base design will need  large changes.I think 
it maybe better to do that in a steady way.
So we can do it step by step.Just make a similar one for aarch64 at first,then 
make both of them into class.
what's your opinion?


Repository:
  rL LLVM

http://reviews.llvm.org/D20089



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20089: Adding a TargetParser for AArch64

2016-05-23 Thread jojo.ma via cfe-commits
jojo removed rL LLVM as the repository for this revision.
jojo changed the visibility of this Differential Revision from "All Users" to 
"Public (No Login Required)".
jojo updated this revision to Diff 58071.
jojo added a comment.

1.unsigned llvm::AArch64::getArchAttr(unsigned ArchKind)

  Correct the error according to the inline comment.

2.unsigned llvm::AArch64::parseArch(StringRef Arch, std::vector 
&Features)

  Adjust arch check logic


http://reviews.llvm.org/D20089

Files:
  include/llvm/Support/AArch64TargetParser.def
  include/llvm/Support/ARMTargetParser.def
  include/llvm/Support/TargetParser.h
  lib/Support/TargetParser.cpp

Index: lib/Support/TargetParser.cpp
===
--- lib/Support/TargetParser.cpp
+++ lib/Support/TargetParser.cpp
@@ -21,6 +21,7 @@
 
 using namespace llvm;
 using namespace ARM;
+using namespace AArch64;
 
 namespace {
 
@@ -75,6 +76,11 @@
   {NAME, sizeof(NAME) - 1, CPU_ATTR, sizeof(CPU_ATTR) - 1, SUB_ARCH,   \
sizeof(SUB_ARCH) - 1, ARCH_FPU, ARCH_BASE_EXT, ID, ARCH_ATTR},
 #include "llvm/Support/ARMTargetParser.def"
+},AArch64ARCHNames[] = {
+#define AARCH64_ARCH(NAME, ID, CPU_ATTR, SUB_ARCH, ARCH_ATTR, ARCH_FPU, ARCH_BASE_EXT)   \
+  {NAME, sizeof(NAME) - 1, CPU_ATTR, sizeof(CPU_ATTR) - 1, SUB_ARCH,   \
+   sizeof(SUB_ARCH) - 1, ARCH_FPU, ARCH_BASE_EXT, ID, ARCH_ATTR},
+#include "llvm/Support/AArch64TargetParser.def"
 };
 
 // List of Arch Extension names.
@@ -91,6 +97,10 @@
 #define ARM_ARCH_EXT_NAME(NAME, ID, FEATURE, NEGFEATURE) \
   { NAME, sizeof(NAME) - 1, ID, FEATURE, NEGFEATURE },
 #include "llvm/Support/ARMTargetParser.def"
+},AArch64ARCHExtNames[] = {
+#define AARCH64_ARCH_EXT_NAME(NAME, ID, FEATURE, NEGFEATURE) \
+  { NAME, sizeof(NAME) - 1, ID, FEATURE, NEGFEATURE },
+#include "llvm/Support/AArch64TargetParser.def"
 };
 
 // List of HWDiv names (use getHWDivSynonym) and which architectural
@@ -124,6 +134,10 @@
 #define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
   { NAME, sizeof(NAME) - 1, ID, IS_DEFAULT, DEFAULT_EXT },
 #include "llvm/Support/ARMTargetParser.def"
+},AArch64CPUNames[] = {
+#define AARCH64_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
+  { NAME, sizeof(NAME) - 1, ID, IS_DEFAULT, DEFAULT_EXT },
+#include "llvm/Support/AArch64TargetParser.def"
 };
 
 } // namespace
@@ -369,6 +383,134 @@
   return "generic";
 }
 
+StringRef llvm::AArch64::getFPUName(unsigned FPUKind) {
+  return ARM::getFPUName(FPUKind);
+}
+
+unsigned llvm::AArch64::getFPUVersion(unsigned FPUKind) {
+  return ARM::getFPUVersion(FPUKind);
+}
+
+unsigned llvm::AArch64::getFPUNeonSupportLevel(unsigned FPUKind) {
+  return ARM::getFPUNeonSupportLevel( FPUKind);
+}
+
+unsigned llvm::AArch64::getFPURestriction(unsigned FPUKind) {
+  return ARM::getFPURestriction(FPUKind);
+}
+
+unsigned llvm::AArch64::getDefaultFPU(StringRef CPU, unsigned ArchKind) {
+  if (CPU == "generic")
+return AArch64ARCHNames[ArchKind].DefaultFPU;
+
+  return StringSwitch(CPU)
+#define AARCH64_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
+.Case(NAME, DEFAULT_FPU)
+#include "llvm/Support/AArch64TargetParser.def"
+.Default(ARM::FK_INVALID);
+}
+
+unsigned llvm::AArch64::getDefaultExtensions(StringRef CPU, unsigned ArchKind) {
+  if (CPU == "generic")
+return AArch64ARCHNames[ArchKind].ArchBaseExtensions;
+
+  return StringSwitch(CPU)
+#define AARCH64_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
+.Case(NAME, AArch64ARCHNames[ID].ArchBaseExtensions | DEFAULT_EXT)
+#include "llvm/Support/AArch64TargetParser.def"
+.Default(AArch64::AEK_INVALID);
+}
+
+bool llvm::AArch64::getExtensionFeatures(unsigned Extensions,
+ std::vector &Features) {
+
+  if (Extensions == AArch64::AEK_INVALID)
+return false;
+
+  if (Extensions & AArch64::AEK_FP)
+Features.push_back("+fp-armv8");
+  if (Extensions & AArch64::AEK_SIMD)
+Features.push_back("+neon");
+  if (Extensions & AArch64::AEK_CRC)
+Features.push_back("+crc");
+  if (Extensions & AArch64::AEK_CRYPTO)
+Features.push_back("+crypto");
+  if (Extensions & AArch64::AEK_FP16)
+Features.push_back("+fullfp16");
+  if (Extensions & AArch64::AEK_PROFILE)
+Features.push_back("+spe");
+
+  return true;
+}
+
+bool llvm::AArch64::getFPUFeatures(unsigned FPUKind,
+   std::vector &Features) {
+  return ARM::getFPUFeatures(FPUKind, Features);
+}
+
+StringRef llvm::AArch64::getArchName(unsigned ArchKind) {
+  if (ArchKind >= ARM::AK_LAST)
+return StringRef();
+  return AArch64ARCHNames[ArchKind].getName();
+}
+
+StringRef llvm::AArch64::getCPUAttr(unsigned ArchKind) {
+  if (ArchKind == ARM::AK_INVALID || ArchKind >= ARM::AK_LAST)
+return StringRef();
+  return AArch64ARCHNames[ArchKind].getCPUAttr();
+}
+
+StringRef llvm::AArch64::getSubArch(unsigned ArchKind) {
+  if (ArchKind == ARM::AK_INVALID || ArchKind >= ARM::AK_LAST)
+retur

Re: [PATCH] D20088: Using AArch64TargetParser in clang

2016-05-23 Thread jojo.ma via cfe-commits
jojo removed rL LLVM as the repository for this revision.
jojo changed the visibility of this Differential Revision from "All Users" to 
"Public (No Login Required)".
jojo updated this revision to Diff 58072.
jojo added a comment.

Remove checkARMArchValid & checkAArch64ArchValid logic.


http://reviews.llvm.org/D20088

Files:
  lib/Basic/Targets.cpp
  lib/Driver/Tools.cpp

Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -,22 +,9 @@
   text.split(Split, StringRef("+"), -1, false);
 
   for (StringRef Feature : Split) {
-const char *result = llvm::StringSwitch(Feature)
- .Case("fp", "+fp-armv8")
- .Case("simd", "+neon")
- .Case("crc", "+crc")
- .Case("crypto", "+crypto")
- .Case("fp16", "+fullfp16")
- .Case("profile", "+spe")
- .Case("nofp", "-fp-armv8")
- .Case("nosimd", "-neon")
- .Case("nocrc", "-crc")
- .Case("nocrypto", "-crypto")
- .Case("nofp16", "-fullfp16")
- .Case("noprofile", "-spe")
- .Default(nullptr);
-if (result)
-  Features.push_back(result);
+const char *FeatureName = llvm::AArch64::getArchExtFeature(Feature);
+if (FeatureName)
+  Features.push_back(FeatureName);
 else if (Feature == "neon" || Feature == "noneon")
   D.Diag(diag::err_drv_no_neon_modifier);
 else
@@ -2252,20 +2239,16 @@
   std::vector &Features) {
   std::pair Split = Mcpu.split("+");
   CPU = Split.first;
-  if (CPU == "cortex-a53" || CPU == "cortex-a57" ||
-  CPU == "cortex-a72" || CPU == "cortex-a35" || CPU == "exynos-m1" ||
-  CPU == "kryo") {
-Features.push_back("+neon");
-Features.push_back("+crc");
-Features.push_back("+crypto");
-  } else if (CPU == "cyclone") {
-Features.push_back("+neon");
-Features.push_back("+crypto");
-  } else if (CPU == "generic") {
+
+  if (CPU == "generic") {
 Features.push_back("+neon");
   } else {
-return false;
-  }
+unsigned ArchKind = llvm::AArch64::parseCPUArch(CPU);
+unsigned Extersion = llvm::AArch64::getDefaultExtensions(CPU,ArchKind);
+
+if (!llvm::AArch64::getExtensionFeatures(Extersion,Features))
+  return false;
+   }
 
   if (Split.second.size() && !DecodeAArch64Features(D, Split.second, Features))
 return false;
@@ -2280,17 +2263,8 @@
   std::string MarchLowerCase = March.lower();
   std::pair Split = StringRef(MarchLowerCase).split("+");
 
-  if (Split.first == "armv8-a" || Split.first == "armv8a") {
-// ok, no additional features.
-  } else if (Split.first == "armv8.1-a" || Split.first == "armv8.1a") {
-Features.push_back("+v8.1a");
-  } else if (Split.first == "armv8.2-a" || Split.first == "armv8.2a" ) {
-Features.push_back("+v8.2a");
-  } else {
-return false;
-  }
-
-  if (Split.second.size() && !DecodeAArch64Features(D, Split.second, Features))
+  if (llvm::AArch64::parseArch(Split.first, Features) == llvm::ARM::AK_INVALID ||
+	  (Split.second.size() && !DecodeAArch64Features(D, Split.second, Features)))
 return false;
 
   return true;
Index: lib/Basic/Targets.cpp
===
--- lib/Basic/Targets.cpp
+++ lib/Basic/Targets.cpp
@@ -5647,14 +5647,10 @@
   }
 
   bool setCPU(const std::string &Name) override {
-bool CPUKnown = llvm::StringSwitch(Name)
-.Case("generic", true)
-.Cases("cortex-a53", "cortex-a57", "cortex-a72",
-   "cortex-a35", "exynos-m1", true)
-.Case("cyclone", true)
-.Case("kryo", true)
-.Default(false);
-return CPUKnown;
+if (Name == "generic" || llvm::AArch64::parseCPUArch(Name) != llvm::ARM::AK_INVALID)
+  return true;
+
+return false;
   }
 
   void getTargetDefines(const LangOptions &Opts,
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18360: Add AIX Target/ToolChain to Clang Driver

2016-05-23 Thread WuZhao via cfe-commits
WuZhao added a subscriber: WuZhao.
WuZhao added a comment.

Hi , I find one mistake in the lib/Basic/Targets.cpp. On my AIX 7.1 machine 
/usr/include/sys/inttypes.h, 64 bits wchar_t is unsigned int, not signed int.

  #ifndef _WCHAR_T
  #define _WCHAR_T
  #ifdef __64BIT__
  typedef unsigned intwchar_t;
  #else
  typedef unsigned short  wchar_t;
  #endif
  #endif /* _WCHAR_T */

So, the code should be

  if (this->PointerWidth == 64) {
this->WCharType = this->UnsignedInt;
  } else {
this->WCharType = this->UnsignedShort;
  }


http://reviews.llvm.org/D18360



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20519: [clang-tidy] Ignore ADL-style using decls in unused-using-decls check.

2016-05-23 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments.


Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:47
@@ +46,3 @@
+  return;
+// Ignores using-declarations defined in function definitions to avoid
+// arguement-dependent lookup.

I don't think using declarations in functions are inherently related to ADL. 
This check doesn't seem like a useful heuristic.


http://reviews.llvm.org/D20519



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D20521: [Clang][AVX512][Builtin] adding missing intrinsics for vpmultishiftqb{128|256|512} instruction set

2016-05-23 Thread michael zuckerman via cfe-commits
m_zuckerman created this revision.
m_zuckerman added reviewers: AsafBadouh, igorb, delena.
m_zuckerman added a subscriber: cfe-commits.

http://reviews.llvm.org/D20521

Files:
  include/clang/Basic/BuiltinsX86.def
  lib/Headers/avx512vbmiintrin.h
  lib/Headers/avx512vbmivlintrin.h
  test/CodeGen/avx512vbmi-builtins.c
  test/CodeGen/avx512vbmivl-builtin.c

Index: test/CodeGen/avx512vbmivl-builtin.c
===
--- test/CodeGen/avx512vbmivl-builtin.c
+++ test/CodeGen/avx512vbmivl-builtin.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature avx512vbmi -target-feature avx512vl -target-feature avx2 -emit-llvm -o - -Werror | FileCheck %s
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +avx512vbmi -target-feature +avx512vl -target-feature +avx512bw -emit-llvm -o - -Werror | FileCheck %s
 
 // Don't include mm_malloc.h, it's system specific.
 #define __MM_MALLOC_H
@@ -85,6 +85,43 @@
 
 __m256i test_mm256_maskz_permutex2var_epi8(__mmask32 __U, __m256i __A, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_maskz_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.qi.256
+  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.qi.256
   return _mm256_maskz_permutex2var_epi8(__U, __A, __I, __B); 
-}
\ No newline at end of file
+}
+
+__m128i test_mm_mask_multishift_epi64_epi8(__m128i __W, __mmask16 __M, __m128i __X, __m128i __Y) {
+  // CHECK-LABEL: @test_mm_mask_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.128
+  return _mm_mask_multishift_epi64_epi8(__W, __M, __X, __Y); 
+}
+
+__m128i test_mm_maskz_multishift_epi64_epi8(__mmask16 __M, __m128i __X, __m128i __Y) {
+  // CHECK-LABEL: @test_mm_maskz_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.128
+  return _mm_maskz_multishift_epi64_epi8(__M, __X, __Y); 
+}
+
+__m128i test_mm_multishift_epi64_epi8(__m128i __X, __m128i __Y) {
+  // CHECK-LABEL: @test_mm_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.128
+  return _mm_multishift_epi64_epi8(__X, __Y); 
+}
+
+__m256i test_mm256_mask_multishift_epi64_epi8(__m256i __W, __mmask32 __M, __m256i __X, __m256i __Y) {
+  // CHECK-LABEL: @test_mm256_mask_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.256
+  return _mm256_mask_multishift_epi64_epi8(__W, __M, __X, __Y); 
+}
+
+__m256i test_mm256_maskz_multishift_epi64_epi8(__mmask32 __M, __m256i __X, __m256i __Y) {
+  // CHECK-LABEL: @test_mm256_maskz_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.256
+  return _mm256_maskz_multishift_epi64_epi8(__M, __X, __Y); 
+}
+
+__m256i test_mm256_multishift_epi64_epi8(__m256i __X, __m256i __Y) {
+  // CHECK-LABEL: @test_mm256_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.256
+  return _mm256_multishift_epi64_epi8(__X, __Y); 
+}
+
Index: test/CodeGen/avx512vbmi-builtins.c
===
--- test/CodeGen/avx512vbmi-builtins.c
+++ test/CodeGen/avx512vbmi-builtins.c
@@ -46,3 +46,21 @@
   // CHECK: @llvm.x86.avx512.mask.permvar.qi.512
   return _mm512_mask_permutexvar_epi8(__W, __M, __A, __B); 
 }
+
+__m512i test_mm512_mask_multishift_epi64_epi8(__m512i __W, __mmask64 __M, __m512i __X, __m512i __Y) {
+  // CHECK-LABEL: @test_mm512_mask_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.512
+  return _mm512_mask_multishift_epi64_epi8(__W, __M, __X, __Y); 
+}
+
+__m512i test_mm512_maskz_multishift_epi64_epi8(__mmask64 __M, __m512i __X, __m512i __Y) {
+  // CHECK-LABEL: @test_mm512_maskz_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.512
+  return _mm512_maskz_multishift_epi64_epi8(__M, __X, __Y); 
+}
+
+__m512i test_mm512_multishift_epi64_epi8(__m512i __X, __m512i __Y) {
+  // CHECK-LABEL: @test_mm512_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.512
+  return _mm512_multishift_epi64_epi8(__X, __Y); 
+}
Index: lib/Headers/avx512vbmivlintrin.h
===
--- lib/Headers/avx512vbmivlintrin.h
+++ lib/Headers/avx512vbmivlintrin.h
@@ -29,7 +29,7 @@
 #define __VBMIVLINTRIN_H
 
 /* Define the default attributes for the functions in this file. */
-#define __DEFAULT_FN_ATTRS __attribute__(( __nodebug__, __target__("avx512vbmi,avx512vl")))
+#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi,avx512vl")))
 
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
@@ -183,6 +183,65 @@
  (__mmask32) __M);
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_mask_multishift_epi64_epi8 (__m128i __W, __mmask16 __M, __m128i __X, __m128i __Y)
+{
+  return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
+(__v16qi) __Y,
+(__v16qi) __W,
+(__mmask16) __M);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm

r270435 - Test commit

2016-05-23 Thread Jacob Baungard Hansen via cfe-commits
Author: jacob_hansen
Date: Mon May 23 08:12:29 2016
New Revision: 270435

URL: http://llvm.org/viewvc/llvm-project?rev=270435&view=rev
Log:
Test commit

Modified:
cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=270435&r1=270434&r2=270435&view=diff
==
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon May 23 08:12:29 2016
@@ -1661,6 +1661,7 @@ void Clang::AddSparcTargetArgs(const Arg
 D.Diag(diag::err_drv_unsupported_opt_for_target) << "-msoft-float"
  << Triple;
   }
+
 }
 
 void Clang::AddSystemZTargetArgs(const ArgList &Args,


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20521: [Clang][AVX512][Builtin] adding missing intrinsics for vpmultishiftqb{128|256|512} instruction set

2016-05-23 Thread Asaf Badouh via cfe-commits
AsafBadouh accepted this revision.
AsafBadouh added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D20521



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20422: [MSVC2015] dllexport for defaulted special class members

2016-05-23 Thread Dmitry Polukhin via cfe-commits
DmitryPolukhin updated this revision to Diff 58088.
DmitryPolukhin added a comment.

- drop dllexport for trivial defaulted x-tors for compatibility with MSVC2015
- move checks to CheckCompletedCXXClass because completed class definition is 
required to detect if x-tor is trivial


http://reviews.llvm.org/D20422

Files:
  lib/Sema/SemaDeclCXX.cpp
  test/CodeGenCXX/dllexport-members.cpp
  test/CodeGenCXX/dllexport.cpp

Index: test/CodeGenCXX/dllexport.cpp
===
--- test/CodeGenCXX/dllexport.cpp
+++ test/CodeGenCXX/dllexport.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -triple i686-windows-msvc   -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O1 -mconstructor-aliases -disable-llvm-optzns -o - %s -w -fms-compatibility-version=19.00 | FileCheck --check-prefix=MSC --check-prefix=M32 -check-prefix=MSVC2015 %s
-// RUN: %clang_cc1 -triple i686-windows-msvc   -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O1 -mconstructor-aliases -disable-llvm-optzns -o - %s -w -fms-compatibility-version=18.00 | FileCheck --check-prefix=MSC --check-prefix=M32 -check-prefix=MSVC2013 %s
+// RUN: %clang_cc1 -triple i686-windows-msvc   -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O1 -mconstructor-aliases -disable-llvm-optzns -o - %s -w -fms-compatibility-version=19.00 | FileCheck --check-prefix=MSC --check-prefix=M32 -check-prefix=MSVC2015 -check-prefix=M32MSVC2015 %s
+// RUN: %clang_cc1 -triple i686-windows-msvc   -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O1 -mconstructor-aliases -disable-llvm-optzns -o - %s -w -fms-compatibility-version=18.00 | FileCheck --check-prefix=MSC --check-prefix=M32 -check-prefix=MSVC2013 -check-prefix=M32MSVC2013 %s
 
-// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w -fms-compatibility-version=19.00 | FileCheck --check-prefix=MSC --check-prefix=M64 -check-prefix=MSVC2015 %s
-// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w -fms-compatibility-version=18.00 | FileCheck --check-prefix=MSC --check-prefix=M64 -check-prefix=MSVC2013 %s
+// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w -fms-compatibility-version=19.00 | FileCheck --check-prefix=MSC --check-prefix=M64 -check-prefix=MSVC2015 -check-prefix=M64MSVC2015 %s
+// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w -fms-compatibility-version=18.00 | FileCheck --check-prefix=MSC --check-prefix=M64 -check-prefix=MSVC2013 -check-prefix=M64MSVC2013 %s
 
 // RUN: %clang_cc1 -triple i686-windows-gnu-emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w | FileCheck --check-prefix=GNU --check-prefix=G32 %s
 // RUN: %clang_cc1 -triple x86_64-windows-gnu  -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s -w | FileCheck --check-prefix=GNU --check-prefix=G64 %s
@@ -561,7 +561,7 @@
 
   // Explicitly defaulted copy constructur:
   T(const T&) = default;
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.T* @"\01??0T@@QAE@ABU0@@Z"
+  // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.T* @"\01??0T@@QAE@ABU0@@Z"
 
   void a() {}
   // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?a@T@@QAEXXZ"
@@ -647,9 +647,34 @@
 
 struct __declspec(dllexport) DefaultedCtorsDtors {
   DefaultedCtorsDtors() = default;
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc %struct.DefaultedCtorsDtors* @"\01??0DefaultedCtorsDtors@@QAE@XZ"
+  // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.DefaultedCtorsDtors* @"\01??0DefaultedCtorsDtors@@QAE@XZ"
   ~DefaultedCtorsDtors() = default;
-  // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1DefaultedCtorsDtors@@QAE@XZ"
+  // M32MSVC2013-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??1DefaultedCtorsDtors@@QAE@XZ"
+};
+
+// Export defaulted member function definitions declared inside class.
+struct __declspec(dllexport) ExportDefaultedInclassDefs {
+  ExportDefaultedInclassDefs() = default;
+  // M32VS2013-DAG: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M64VS2013-DAG: define weak_odr dllexport%struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QEAA@XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M32VS2015-NOT: define weak_odr dllexport x86_thiscallcc %struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@@QAE@XZ"(%struct.ExportDefaultedInclassDefs* returned %this)
+  // M64VS2015-NOT: define weak_odr dllexport%struct.ExportDefaultedInclassDefs* @"\01??0ExportDefaultedInclassDefs@

Re: [PATCH] D20422: [MSVC2015] dllexport for defaulted special class members

2016-05-23 Thread Dmitry Polukhin via cfe-commits
DmitryPolukhin added a comment.

PTAL



Comment at: lib/Sema/SemaDeclCXX.cpp:13113-13114
@@ -13065,28 +13112,4 @@
 
-if (MD->isInvalidDecl())
-  return;
-
-switch (Member) {
-case CXXDefaultConstructor:
-  DefineImplicitDefaultConstructor(DefaultLoc,
-   cast(MD));
-  break;
-case CXXCopyConstructor:
-  DefineImplicitCopyConstructor(DefaultLoc, cast(MD));
-  break;
-case CXXCopyAssignment:
-  DefineImplicitCopyAssignment(DefaultLoc, MD);
-  break;
-case CXXDestructor:
-  DefineImplicitDestructor(DefaultLoc, cast(MD));
-  break;
-case CXXMoveConstructor:
-  DefineImplicitMoveConstructor(DefaultLoc, cast(MD));
-  break;
-case CXXMoveAssignment:
-  DefineImplicitMoveAssignment(DefaultLoc, MD);
-  break;
-case CXXInvalid:
-  llvm_unreachable("Invalid special member.");
-}
+if (!MD->isInvalidDecl())
+  DefineImplicitSpecialMember(*this, MD, DefaultLoc);
   } else {

I added code to drop dllexport attribute but the check for dropping dllexport 
attribute is basically the same. Moreover it cannot be done when the attribute 
is processed because we need full class definition so I moved the check to 
CheckCompletedCXXClass. Alternatively I can move the check to 
checkClassLevelDLLAttribute but it will start working for classes without class 
level dllexport attribute to detect if any class member has member level 
attribute (it is less efficient  because it requires more more loop over all 
class methods even for all classes).


http://reviews.llvm.org/D20422



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20519: [clang-tidy] Ignore ADL-style using decls in unused-using-decls check.

2016-05-23 Thread Haojian Wu via cfe-commits
hokein added inline comments.


Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:47
@@ +46,3 @@
+  return;
+// Ignores using-declarations defined in function definitions to avoid
+// arguement-dependent lookup.

alexfh wrote:
> I don't think using declarations in functions are inherently related to ADL. 
> This check doesn't seem like a useful heuristic.
Yeah, the current work around is only to ignore all using-decls in function 
context which is not perfect. I didn't find out a better way.


http://reviews.llvm.org/D20519



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 58090.

http://reviews.llvm.org/D20277

Files:
  clang-tidy/performance/UnnecessaryValueParamCheck.cpp
  clang-tidy/performance/UnnecessaryValueParamCheck.h
  clang-tidy/utils/CMakeLists.txt
  clang-tidy/utils/DeclRefExprUtils.cpp
  clang-tidy/utils/DeclRefExprUtils.h
  clang-tidy/utils/Matchers.cpp
  clang-tidy/utils/Matchers.h
  clang-tidy/utils/TypeTraits.cpp
  clang-tidy/utils/TypeTraits.h
  test/clang-tidy/performance-unnecessary-value-param.cpp

Index: test/clang-tidy/performance-unnecessary-value-param.cpp
===
--- test/clang-tidy/performance-unnecessary-value-param.cpp
+++ test/clang-tidy/performance-unnecessary-value-param.cpp
@@ -1,5 +1,7 @@
 // RUN: %check_clang_tidy %s performance-unnecessary-value-param %t
 
+// CHECK-FIXES: #include 
+
 struct ExpensiveToCopyType {
   const ExpensiveToCopyType & constReference() const {
 return *this;
@@ -30,6 +32,15 @@
   void constMethod() const;
 };
 
+struct ExpensiveMovableType {
+  ExpensiveMovableType();
+  ExpensiveMovableType(ExpensiveMovableType &&);
+  ExpensiveMovableType(const ExpensiveMovableType &) = default;
+  ExpensiveMovableType &operator=(const ExpensiveMovableType &) = default;
+  ExpensiveMovableType &operator=(ExpensiveMovableType &&);
+  ~ExpensiveMovableType();
+};
+
 void positiveExpensiveConstValue(const ExpensiveToCopyType Obj);
 // CHECK-FIXES: void positiveExpensiveConstValue(const ExpensiveToCopyType& Obj);
 void positiveExpensiveConstValue(const ExpensiveToCopyType Obj) {
@@ -180,3 +191,36 @@
 void NegativeMoveOnlyTypePassedByValue(MoveOnlyType M) {
   M.constMethod();
 }
+
+void PositiveMoveOnCopyConstruction(ExpensiveMovableType E) {
+  auto F = E;
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: parameter 'E' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
+  // CHECK-FIXES: auto F = std::move(E);
+}
+
+void PositiveConstRefNotMoveSinceReferencedMultipleTimes(ExpensiveMovableType E) {
+  // CHECK-MESSAGES: [[@LINE-1]]:79: warning: the parameter 'E' is copied
+  // CHECK-FIXES: void PositiveConstRefNotMoveSinceReferencedMultipleTimes(const ExpensiveMovableType& E) {
+  auto F = E;
+  auto G = E;
+}
+
+void PositiveMoveOnCopyAssignment(ExpensiveMovableType E) {
+  ExpensiveMovableType F;
+  F = E;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: parameter 'E' is passed by value
+  // CHECK-FIXES: F = std::move(E);
+}
+
+void PositiveConstRefNotMoveConstructible(ExpensiveToCopyType T) {
+  // CHECK-MESSAGES: [[@LINE-1]]:63: warning: the parameter 'T' is copied
+  // CHECK-FIXES: void PositiveConstRefNotMoveConstructible(const ExpensiveToCopyType& T) {
+  auto U = T;
+}
+
+void PositiveConstRefNotMoveAssignable(ExpensiveToCopyType A) {
+  // CHECK-MESSAGES: [[@LINE-1]]:60: warning: the parameter 'A' is copied
+  // CHECK-FIXES: void PositiveConstRefNotMoveAssignable(const ExpensiveToCopyType& A) {
+  ExpensiveToCopyType B;
+  B = A;
+}
Index: clang-tidy/utils/TypeTraits.h
===
--- clang-tidy/utils/TypeTraits.h
+++ clang-tidy/utils/TypeTraits.h
@@ -29,6 +29,12 @@
 bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl,
const ASTContext &Context);
 
+// Returns true if Type has a non-deleted move constructor.
+bool hasMoveConstructor(QualType Type);
+
+// Return true if Type has a non-deleted move assignment operator.
+bool hasMoveAssignmentOperator(QualType Type);
+
 } // type_traits
 } // namespace utils
 } // namespace tidy
Index: clang-tidy/utils/TypeTraits.cpp
===
--- clang-tidy/utils/TypeTraits.cpp
+++ clang-tidy/utils/TypeTraits.cpp
@@ -123,6 +123,20 @@
   return false;
 }
 
+bool hasMoveConstructor(QualType Type) {
+  auto *Record = Type->getAsCXXRecordDecl();
+  if (!Record || !Record->hasDefinition())
+return false;
+  return Record->hasNonTrivialMoveConstructor();
+}
+
+bool hasMoveAssignmentOperator(QualType Type) {
+  auto *Record = Type->getAsCXXRecordDecl();
+  if (!Record || !Record->hasDefinition())
+return false;
+  return Record->hasNonTrivialMoveAssignment();
+}
+
 } // namespace type_traits
 } // namespace utils
 } // namespace tidy
Index: clang-tidy/utils/Matchers.h
===
--- clang-tidy/utils/Matchers.h
+++ clang-tidy/utils/Matchers.h
@@ -40,6 +40,9 @@
   Node, Finder->getASTContext());
 }
 
+// Returns QualType matcher for references to const.
+ast_matchers::TypeMatcher isConstReference();
+
 } // namespace matchers
 } // namespace tidy
 } // namespace clang
Index: clang-tidy/utils/Matchers.cpp
===
--- /dev/null
+++ clang-tidy/utils/Matchers.cpp
@@ -0,0 +1,23 @@
+//===--- Matchers.cpp - clang-tidy-

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Felix Berger via cfe-commits
flx added inline comments.


Comment at: clang-tidy/utils/TypeTraits.cpp:131
@@ +130,3 @@
+  return Record->hasNonTrivialMoveConstructor();
+}
+

Done. Shortened this now to just check whether the type has a non-trivial move 
constructor or assignment operator. For the test to work I had to make sure the 
constructors/operators there are also non-trivial.



http://reviews.llvm.org/D20277



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Felix Berger via cfe-commits
flx updated this revision to Diff 58093.
flx added a comment.

Upated documentation as well.


http://reviews.llvm.org/D20277

Files:
  clang-tidy/performance/UnnecessaryValueParamCheck.cpp
  clang-tidy/performance/UnnecessaryValueParamCheck.h
  clang-tidy/utils/CMakeLists.txt
  clang-tidy/utils/DeclRefExprUtils.cpp
  clang-tidy/utils/DeclRefExprUtils.h
  clang-tidy/utils/Matchers.cpp
  clang-tidy/utils/Matchers.h
  clang-tidy/utils/TypeTraits.cpp
  clang-tidy/utils/TypeTraits.h
  docs/clang-tidy/checks/performance-unnecessary-value-param.rst
  test/clang-tidy/performance-unnecessary-value-param.cpp

Index: test/clang-tidy/performance-unnecessary-value-param.cpp
===
--- test/clang-tidy/performance-unnecessary-value-param.cpp
+++ test/clang-tidy/performance-unnecessary-value-param.cpp
@@ -1,5 +1,7 @@
 // RUN: %check_clang_tidy %s performance-unnecessary-value-param %t
 
+// CHECK-FIXES: #include 
+
 struct ExpensiveToCopyType {
   const ExpensiveToCopyType & constReference() const {
 return *this;
@@ -30,6 +32,15 @@
   void constMethod() const;
 };
 
+struct ExpensiveMovableType {
+  ExpensiveMovableType();
+  ExpensiveMovableType(ExpensiveMovableType &&);
+  ExpensiveMovableType(const ExpensiveMovableType &) = default;
+  ExpensiveMovableType &operator=(const ExpensiveMovableType &) = default;
+  ExpensiveMovableType &operator=(ExpensiveMovableType &&);
+  ~ExpensiveMovableType();
+};
+
 void positiveExpensiveConstValue(const ExpensiveToCopyType Obj);
 // CHECK-FIXES: void positiveExpensiveConstValue(const ExpensiveToCopyType& Obj);
 void positiveExpensiveConstValue(const ExpensiveToCopyType Obj) {
@@ -180,3 +191,36 @@
 void NegativeMoveOnlyTypePassedByValue(MoveOnlyType M) {
   M.constMethod();
 }
+
+void PositiveMoveOnCopyConstruction(ExpensiveMovableType E) {
+  auto F = E;
+  // CHECK-MESSAGES: [[@LINE-1]]:12: warning: parameter 'E' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
+  // CHECK-FIXES: auto F = std::move(E);
+}
+
+void PositiveConstRefNotMoveSinceReferencedMultipleTimes(ExpensiveMovableType E) {
+  // CHECK-MESSAGES: [[@LINE-1]]:79: warning: the parameter 'E' is copied
+  // CHECK-FIXES: void PositiveConstRefNotMoveSinceReferencedMultipleTimes(const ExpensiveMovableType& E) {
+  auto F = E;
+  auto G = E;
+}
+
+void PositiveMoveOnCopyAssignment(ExpensiveMovableType E) {
+  ExpensiveMovableType F;
+  F = E;
+  // CHECK-MESSAGES: [[@LINE-1]]:7: warning: parameter 'E' is passed by value
+  // CHECK-FIXES: F = std::move(E);
+}
+
+void PositiveConstRefNotMoveConstructible(ExpensiveToCopyType T) {
+  // CHECK-MESSAGES: [[@LINE-1]]:63: warning: the parameter 'T' is copied
+  // CHECK-FIXES: void PositiveConstRefNotMoveConstructible(const ExpensiveToCopyType& T) {
+  auto U = T;
+}
+
+void PositiveConstRefNotMoveAssignable(ExpensiveToCopyType A) {
+  // CHECK-MESSAGES: [[@LINE-1]]:60: warning: the parameter 'A' is copied
+  // CHECK-FIXES: void PositiveConstRefNotMoveAssignable(const ExpensiveToCopyType& A) {
+  ExpensiveToCopyType B;
+  B = A;
+}
Index: docs/clang-tidy/checks/performance-unnecessary-value-param.rst
===
--- docs/clang-tidy/checks/performance-unnecessary-value-param.rst
+++ docs/clang-tidy/checks/performance-unnecessary-value-param.rst
@@ -10,7 +10,7 @@
 which means they are not trivially copyable or have a non-trivial copy
 constructor or destructor.
 
-To ensure that it is safe to replace the value paramater with a const reference
+To ensure that it is safe to replace the value parameter with a const reference
 the following heuristic is employed:
 
 1. the parameter is const qualified;
@@ -31,3 +31,25 @@
 Value.ConstMethd();
 ExpensiveToCopy Copy(Value);
   }
+
+If the parameter is not const, only copied or assigned once and has a
+non-trivial move-constructor or move-assignment operator respectively the check
+will suggest to move it.
+
+Example:
+
+.. code-block:: c++
+
+  void setValue(string Value) {
+Field = Value;
+  }
+
+Will become:
+
+.. code-block:: c++
+
+  #include 
+
+  void setValue(string Value) {
+Field = std::move(Value);
+  }
Index: clang-tidy/utils/TypeTraits.h
===
--- clang-tidy/utils/TypeTraits.h
+++ clang-tidy/utils/TypeTraits.h
@@ -29,6 +29,12 @@
 bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl,
const ASTContext &Context);
 
+// Returns true if Type has a non-deleted move constructor.
+bool hasMoveConstructor(QualType Type);
+
+// Return true if Type has a non-deleted move assignment operator.
+bool hasMoveAssignmentOperator(QualType Type);
+
 } // type_traits
 } // namespace utils
 } // namespace tidy
Index: clang-tidy/utils/TypeTraits.cpp
=

Re: [PATCH] D20496: [include-fixer] Added find-stl-symbols to retrieve symbols (with the correct include header name) from C++ standard STL headers.

2016-05-23 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments.


Comment at: include-fixer/find-all-symbols/FindAllSymbols.h:47
@@ +46,3 @@
+protected:
+  // The way SymbolInfo of a decl is reported can be overrided.
+  virtual void reportDecl(const SourceManager &SM, const clang::NamedDecl *ND,

overridden


Comment at: include-fixer/find-all-symbols/SymbolReporter.h:25
@@ +24,3 @@
+  struct Args {
+int Arg1;
+  };

Any reason not to call this IncludeDepth? Or make it a generic 'Priority' thing 
and throw away all the overrides? I'm not opposed to changing find-all-symbols 
to support that if it's less code.


Comment at: include-fixer/find-stl-symbols/FindSTLSymbolsAction.h:13
@@ +12,3 @@
+
+#include "../find-all-symbols/FindAllMacros.h"
+#include "../find-all-symbols/FindAllSymbols.h"

The .. in the include path is a strong indicator that we have weird layering. 
Would it make sense to merge find-stl-symbols into find-all-symbols?


Comment at: include-fixer/find-stl-symbols/STLSymbolsFinder.cpp:33
@@ +32,3 @@
+: Files(Files), CXXIncludePath(CXXIncludePath), Verbose(Verbose) {
+  if (*CXXIncludePath.rbegin() != '/')
+this->CXXIncludePath.push_back('/');

.back()


Comment at: include-fixer/find-stl-symbols/tool/FindSTLSymbolsMain.cpp:57
@@ +56,3 @@
+}
+llvm::raw_fd_ostream OS(FD, /*shouldClose*/ true);
+WriteSymbolInfosToStream(OS, Symbols);

Just use the raw_fd_ostream constructor that takes a file name.


http://reviews.llvm.org/D20496



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20512: [PATCH] Bug 27475 - Request header guard check processes .hpp files as well as .h files

2016-05-23 Thread Haojian Wu via cfe-commits
hokein added a subscriber: hokein.


Comment at: clang-tidy/llvm/HeaderGuardCheck.h:19
@@ -18,3 +18,3 @@
 
 /// Finds and fixes header guards that do not adhere to LLVM style.
 class LLVMHeaderGuardCheck : public utils::HeaderGuardCheck {

You should add a document for the option `HeaderFileExtensions` here.


Comment at: clang-tidy/utils/HeaderGuard.cpp:300
@@ +299,3 @@
+',');
+  StringRef extension = ::llvm::sys::path::extension(FileName);
+  if (extension.size() > 0 && extension.front() == '.') {

To avoid the redundant code, you can put this kind of code to 
`utls::HeaderFileExtensionsUtils` (something like `isHeaderFileExtension`).




Comment at: clang-tidy/utils/HeaderGuard.h:15
@@ -14,1 +14,3 @@
+#include "../utils/HeaderFileExtensionsUtils.h"
+#include "llvm/Support/Path.h"
 

seems not needed?


Comment at: clang-tidy/utils/HeaderGuard.h:45
@@ -42,1 +44,3 @@
+private:
+  utils::HeaderFileExtensionsSet HeaderFileExtensions;
 };

Not needed to be a member variable.


http://reviews.llvm.org/D20512



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20496: [include-fixer] Added find-stl-symbols to retrieve symbols (with the correct include header name) from C++ standard STL headers.

2016-05-23 Thread Haojian Wu via cfe-commits
hokein added inline comments.


Comment at: include-fixer/find-stl-symbols/STLSymbolsFinder.h:25
@@ +24,3 @@
+///
+/// To decide which symbols can be #include'd from each headear, we run
+/// FindSTLSymbolsAction on each header to retrieve all symbols in the

s/headear/header


Comment at: include-fixer/find-stl-symbols/STLSymbolsFinder.h:97
@@ +96,3 @@
+  STLReporter Reporter;
+  /// Wether to run clang tool in verbose mode.
+  bool Verbose;

s/wether/whether


Comment at: include-fixer/find-stl-symbols/tool/FindSTLSymbolsMain.cpp:32
@@ +31,3 @@
+CXXIncludePath("i", cl::desc("C++ standard library include path. Headers "
+ "under this directory will be processed."),
+   cl::init(""), cl::value_desc("libc++ include path"));

It would be  clearer to add an example path here.


Comment at: include-fixer/find-stl-symbols/tool/FindSTLSymbolsMain.cpp:37
@@ +36,3 @@
+OutputFile("o", cl::desc("The file path for saving the results."),
+   cl::init("stl-symbols.yaml"),
+   cl::value_desc("output-file.yaml"));

Using underscore `stl_symbols_db.yaml` to keep consistence with 
`find_all_symbols_db.yaml`.


http://reviews.llvm.org/D20496



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D20523: [Clang][AVX512][BUILTIN] Add missing intrinsics for cast .

2016-05-23 Thread michael zuckerman via cfe-commits
m_zuckerman created this revision.
m_zuckerman added reviewers: AsafBadouh, igorb, delena.
m_zuckerman added a subscriber: cfe-commits.

http://reviews.llvm.org/D20523

Files:
  lib/Headers/avx512fintrin.h
  test/CodeGen/avx512f-builtins.c

Index: test/CodeGen/avx512f-builtins.c
===
--- test/CodeGen/avx512f-builtins.c
+++ test/CodeGen/avx512f-builtins.c
@@ -328,13 +328,6 @@
   return _mm512_set1_pd(d);
 }
 
-__m512d test_mm512_castpd256_pd512(__m256d a)
-{
-  // CHECK-LABEL: @test_mm512_castpd256_pd512
-  // CHECK: shufflevector <4 x double> {{.*}} 
-  return _mm512_castpd256_pd512(a);
-}
-
 __mmask16 test_mm512_knot(__mmask16 a)
 {
   // CHECK-LABEL: @test_mm512_knot
@@ -5925,18 +5918,66 @@
   return _mm512_maskz_cvttpd_epu32(__U, __A); 
 }
 
-__m512d test_mm512_castpd128_pd512(__m128d __A) {
-  // CHECK-LABEL: @test_mm512_castpd128_pd512
-  // CHECK: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <8 x i32> 
-  return _mm512_castpd128_pd512(__A); 
+__m512 test_mm512_castpd_ps (__m512d __A)
+{
+  // CHECK-LABEL: @test_mm512_castpd_ps 
+  // CHECK: bitcast <8 x double> %1 to <16 x float>
+  return _mm512_castpd_ps (__A);
+}
+
+__m512d test_mm512_castps_pd (__m512 __A)
+{
+  // CHECK-LABEL: @test_mm512_castps_pd 
+  // CHECK: bitcast <16 x float> %1 to <8 x double>
+  return _mm512_castps_pd (__A);
+}
+
+__m512i test_mm512_castpd_si512 (__m512d __A)
+{
+  // CHECK-LABEL: @test_mm512_castpd_si512 
+  // CHECK: bitcast <8 x double> %1 to <8 x i64>
+  return _mm512_castpd_si512 (__A);
 }
 
 __m512 test_mm512_castps128_ps512(__m128 __A) {
   // CHECK-LABEL: @test_mm512_castps128_ps512
   // CHECK: shufflevector <4 x float> %{{.*}}, <4 x float> %{{.*}}, <16 x i32> 
   return _mm512_castps128_ps512(__A); 
 }
 
+__m512d test_mm512_castpd128_pd512(__m128d __A) {
+  // CHECK-LABEL: @test_mm512_castpd128_pd512
+  // CHECK: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <8 x i32> 
+  return _mm512_castpd128_pd512(__A); 
+}
+
+__m512d test_mm512_castpd256_pd512(__m256d a)
+{
+  // CHECK-LABEL: @test_mm512_castpd256_pd512
+  // CHECK: shufflevector <4 x double> {{.*}} 
+  return _mm512_castpd256_pd512(a);
+}
+
+__m256d test_mm512_castpd512_pd256 (__m512d __A)
+{
+  // CHECK-LABEL: @test_mm512_castpd512_pd256 
+  // CHECK: shufflevector <8 x double> %1, <8 x double> %2, <4 x i32> 
+  return _mm512_castpd512_pd256 (__A);
+}
+
+__m256 test_mm512_castps512_ps256 (__m512 __A)
+{
+  // CHECK-LABEL: @test_mm512_castps512_ps256 
+  // CHECK: shufflevector <16 x float> %1, <16 x float> %2, <8 x i32> 
+  return _mm512_castps512_ps256 (__A);
+}
+
+__m512i test_mm512_castps_si512 (__m512 __A)
+{
+  // CHECK-LABEL: @test_mm512_castps_si512 
+  // CHECK: bitcast <16 x float> %1 to <8 x i64>
+  return _mm512_castps_si512 (__A);
+}
 __m512i test_mm512_castsi128_si512(__m128i __A) {
   // CHECK-LABEL: @test_mm512_castsi128_si512
   // CHECK: shufflevector <2 x i64> %{{.*}}, <2 x i64> %{{.*}}, <8 x i32> 
@@ -5949,6 +5990,26 @@
   return _mm512_castsi256_si512(__A); 
 }
 
+__m512 test_mm512_castsi512_ps (__m512i __A)
+{
+  // CHECK-LABEL: @test_mm512_castsi512_ps 
+  // CHECK: bitcast <8 x i64> %1 to <16 x float>
+  return _mm512_castsi512_ps (__A);
+}
+
+__m512d test_mm512_castsi512_pd (__m512i __A)
+{
+  // CHECK-LABEL: @test_mm512_castsi512_pd 
+  // CHECK: bitcast <8 x i64> %1 to <8 x double>
+  return _mm512_castsi512_pd (__A);
+}
+
+__m128i test_mm512_castsi512_si128 (__m512i __A)
+{
+  // CHECK-LABEL: @test_mm512_castsi512_si128 
+  // CHECK: shufflevector <8 x i64> %1, <8 x i64> %2, <2 x i32> 
+  return _mm512_castsi512_si128 (__A);
+}
 
 __m128 test_mm_cvt_roundsd_ss(__m128 __A, __m128d __B) {
   // CHECK-LABEL: @test_mm_cvt_roundsd_ss
Index: lib/Headers/avx512fintrin.h
===
--- lib/Headers/avx512fintrin.h
+++ lib/Headers/avx512fintrin.h
@@ -337,19 +337,54 @@
   return __builtin_shufflevector(__a, __a, 0, 1);
 }
 
+static __inline __m256d __DEFAULT_FN_ATTRS
+_mm512_castpd512_pd256 (__m512d __A)
+{
+  return __builtin_shufflevector(__A, __A, 0, 1, 2, 3);
+}
+
 static __inline __m128 __DEFAULT_FN_ATTRS
 _mm512_castps512_ps128(__m512 __a)
 {
   return __builtin_shufflevector(__a, __a, 0, 1, 2, 3);
 }
 
+static __inline __m256 __DEFAULT_FN_ATTRS
+_mm512_castps512_ps256 (__m512 __A)
+{
+  return __builtin_shufflevector(__A, __A, 0, 1, 2, 3, 4, 5, 6, 7);
+}
+
+static __inline __m512 __DEFAULT_FN_ATTRS
+_mm512_castpd_ps (__m512d __A)
+{
+  return (__m512) (__A);
+}
+
+static __inline __m512i __DEFAULT_FN_ATTRS
+_mm512_castpd_si512 (__m512d __A)
+{
+  return (__m512i) (__A);
+}
 
 static __inline__ __m512d __DEFAULT_FN_ATTRS
 _mm512_castpd128_pd512 (__m128d __A)
 {
   return __builtin_shufflevector( __A, __A, 0, 1, -1, -1, -1, -1, -1, -1);
 }
 
+static __inline __m512d __DEFAULT_FN_ATTRS
+_mm512_castps_pd (__m512 __A)
+{
+  return (__m512d) (__A);
+}
+
+static __inline __m512i __DEFAULT_FN_AT

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek.
Prazek added a comment.

Cool check! Did you think about sugesting std::move for rvalue references if 
they are used once?


http://reviews.llvm.org/D20277



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-23 Thread Felix Berger via cfe-commits
flx added a comment.

In http://reviews.llvm.org/D20277#436717, @Prazek wrote:

> Cool check! Did you think about sugesting std::move for rvalue references if 
> they are used once?


Thanks! I'm not sure this fits with what a user would expect from a check named 
"unnecessary-value-param" since in this case the parameter is not passed by 
value. Would a separate check make sense for this?


http://reviews.llvm.org/D20277



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20521: [Clang][AVX512][Builtin] adding missing intrinsics for vpmultishiftqb{128|256|512} instruction set

2016-05-23 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL270441: [clang][AVX512][Builtin] adding missing intrinsics 
for… (authored by mzuckerm).

Changed prior to commit:
  http://reviews.llvm.org/D20521?vs=58086&id=58098#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20521

Files:
  cfe/trunk/include/clang/Basic/BuiltinsX86.def
  cfe/trunk/lib/Headers/avx512vbmiintrin.h
  cfe/trunk/lib/Headers/avx512vbmivlintrin.h
  cfe/trunk/test/CodeGen/avx512vbmi-builtins.c
  cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c

Index: cfe/trunk/include/clang/Basic/BuiltinsX86.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def
@@ -2276,6 +2276,9 @@
 TARGET_BUILTIN(__builtin_ia32_cvtusi2sd64, "V2dV2dULLiIi","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_cvtusi2ss32, "V4fV4fUiIi","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_cvtusi2ss64, "V4fV4fULLiIi","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb512_mask, "V64cV64cV64cV64cULLi","","avx512vbmi")
+TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb128_mask, "V16cV16cV16cV16cUs","","avx512vbmi,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb256_mask, "V32cV32cV32cV32cUi","","avx512vbmi,avx512vl")
 
 // MONITORX/MWAITX
 TARGET_BUILTIN(__builtin_ia32_monitorx, "vv*UiUi", "", "mwaitx")
Index: cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c
===
--- cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c
+++ cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature avx512vbmi -target-feature avx512vl -target-feature avx2 -emit-llvm -o - -Werror | FileCheck %s
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +avx512vbmi -target-feature +avx512vl -target-feature +avx512bw -emit-llvm -o - -Werror | FileCheck %s
 
 // Don't include mm_malloc.h, it's system specific.
 #define __MM_MALLOC_H
@@ -85,6 +85,43 @@
 
 __m256i test_mm256_maskz_permutex2var_epi8(__mmask32 __U, __m256i __A, __m256i __I, __m256i __B) {
   // CHECK-LABEL: @test_mm256_maskz_permutex2var_epi8
-  // CHECK: @llvm.x86.avx512.mask.vpermt2var.qi.256
+  // CHECK: @llvm.x86.avx512.maskz.vpermt2var.qi.256
   return _mm256_maskz_permutex2var_epi8(__U, __A, __I, __B); 
-}
\ No newline at end of file
+}
+
+__m128i test_mm_mask_multishift_epi64_epi8(__m128i __W, __mmask16 __M, __m128i __X, __m128i __Y) {
+  // CHECK-LABEL: @test_mm_mask_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.128
+  return _mm_mask_multishift_epi64_epi8(__W, __M, __X, __Y); 
+}
+
+__m128i test_mm_maskz_multishift_epi64_epi8(__mmask16 __M, __m128i __X, __m128i __Y) {
+  // CHECK-LABEL: @test_mm_maskz_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.128
+  return _mm_maskz_multishift_epi64_epi8(__M, __X, __Y); 
+}
+
+__m128i test_mm_multishift_epi64_epi8(__m128i __X, __m128i __Y) {
+  // CHECK-LABEL: @test_mm_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.128
+  return _mm_multishift_epi64_epi8(__X, __Y); 
+}
+
+__m256i test_mm256_mask_multishift_epi64_epi8(__m256i __W, __mmask32 __M, __m256i __X, __m256i __Y) {
+  // CHECK-LABEL: @test_mm256_mask_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.256
+  return _mm256_mask_multishift_epi64_epi8(__W, __M, __X, __Y); 
+}
+
+__m256i test_mm256_maskz_multishift_epi64_epi8(__mmask32 __M, __m256i __X, __m256i __Y) {
+  // CHECK-LABEL: @test_mm256_maskz_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.256
+  return _mm256_maskz_multishift_epi64_epi8(__M, __X, __Y); 
+}
+
+__m256i test_mm256_multishift_epi64_epi8(__m256i __X, __m256i __Y) {
+  // CHECK-LABEL: @test_mm256_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.256
+  return _mm256_multishift_epi64_epi8(__X, __Y); 
+}
+
Index: cfe/trunk/test/CodeGen/avx512vbmi-builtins.c
===
--- cfe/trunk/test/CodeGen/avx512vbmi-builtins.c
+++ cfe/trunk/test/CodeGen/avx512vbmi-builtins.c
@@ -46,3 +46,21 @@
   // CHECK: @llvm.x86.avx512.mask.permvar.qi.512
   return _mm512_mask_permutexvar_epi8(__W, __M, __A, __B); 
 }
+
+__m512i test_mm512_mask_multishift_epi64_epi8(__m512i __W, __mmask64 __M, __m512i __X, __m512i __Y) {
+  // CHECK-LABEL: @test_mm512_mask_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.512
+  return _mm512_mask_multishift_epi64_epi8(__W, __M, __X, __Y); 
+}
+
+__m512i test_mm512_maskz_multishift_epi64_epi8(__mmask64 __M, __m512i __X, __m512i __Y) {
+  // CHECK-LABEL: @test_mm512_maskz_multishift_epi64_epi8
+  // CHECK: @llvm.x86.avx512.mask.pmultishift.qb.512
+  return _mm512_maskz_multishift_epi64_epi8(__M, __X, __Y); 
+}
+
+__m512i test_mm512_multishift_epi64_epi8(__m512i __X, __m512i __Y) {
+  // CHECK-LABEL: @test_mm512_

r270441 - [clang][AVX512][Builtin] adding missing intrinsics for vpmultishiftqb{128|256|512} instruction set .

2016-05-23 Thread Michael Zuckerman via cfe-commits
Author: mzuckerm
Date: Mon May 23 10:04:39 2016
New Revision: 270441

URL: http://llvm.org/viewvc/llvm-project?rev=270441&view=rev
Log:
[clang][AVX512][Builtin] adding missing intrinsics for 
vpmultishiftqb{128|256|512} instruction set .

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


Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avx512vbmiintrin.h
cfe/trunk/lib/Headers/avx512vbmivlintrin.h
cfe/trunk/test/CodeGen/avx512vbmi-builtins.c
cfe/trunk/test/CodeGen/avx512vbmivl-builtin.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=270441&r1=270440&r2=270441&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Mon May 23 10:04:39 2016
@@ -2276,6 +2276,9 @@ TARGET_BUILTIN(__builtin_ia32_cvtusi2sd3
 TARGET_BUILTIN(__builtin_ia32_cvtusi2sd64, "V2dV2dULLiIi","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_cvtusi2ss32, "V4fV4fUiIi","","avx512f")
 TARGET_BUILTIN(__builtin_ia32_cvtusi2ss64, "V4fV4fULLiIi","","avx512f")
+TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb512_mask, 
"V64cV64cV64cV64cULLi","","avx512vbmi")
+TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb128_mask, 
"V16cV16cV16cV16cUs","","avx512vbmi,avx512vl")
+TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb256_mask, 
"V32cV32cV32cV32cUi","","avx512vbmi,avx512vl")
 
 // MONITORX/MWAITX
 TARGET_BUILTIN(__builtin_ia32_monitorx, "vv*UiUi", "", "mwaitx")

Modified: cfe/trunk/lib/Headers/avx512vbmiintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vbmiintrin.h?rev=270441&r1=270440&r2=270441&view=diff
==
--- cfe/trunk/lib/Headers/avx512vbmiintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vbmiintrin.h Mon May 23 10:04:39 2016
@@ -108,6 +108,36 @@ _mm512_mask_permutexvar_epi8 (__m512i __
  (__mmask64) __M);
 }
 
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_mask_multishift_epi64_epi8 (__m512i __W, __mmask64 __M, __m512i __X, 
__m512i __Y)
+{
+  return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X,
+(__v64qi) __Y,
+(__v64qi) __W,
+(__mmask64) __M);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_maskz_multishift_epi64_epi8 (__mmask64 __M, __m512i __X, __m512i __Y)
+{
+  return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X,
+(__v64qi) __Y,
+(__v64qi)
+_mm512_setzero_si512 (),
+(__mmask64) __M);
+}
+
+static __inline__ __m512i __DEFAULT_FN_ATTRS
+_mm512_multishift_epi64_epi8 (__m512i __X, __m512i __Y)
+{
+  return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X,
+(__v64qi) __Y,
+(__v64qi)
+_mm512_undefined_epi32 (),
+(__mmask64) -1);
+}
+
+
 #undef __DEFAULT_FN_ATTRS
 
 #endif

Modified: cfe/trunk/lib/Headers/avx512vbmivlintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vbmivlintrin.h?rev=270441&r1=270440&r2=270441&view=diff
==
--- cfe/trunk/lib/Headers/avx512vbmivlintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512vbmivlintrin.h Mon May 23 10:04:39 2016
@@ -29,7 +29,7 @@
 #define __VBMIVLINTRIN_H
 
 /* Define the default attributes for the functions in this file. */
-#define __DEFAULT_FN_ATTRS __attribute__(( __nodebug__, 
__target__("avx512vbmi,avx512vl")))
+#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, 
__target__("avx512vbmi,avx512vl")))
 
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
@@ -183,6 +183,65 @@ _mm256_mask_permutexvar_epi8 (__m256i __
  (__mmask32) __M);
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_mask_multishift_epi64_epi8 (__m128i __W, __mmask16 __M, __m128i __X, 
__m128i __Y)
+{
+  return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
+(__v16qi) __Y,
+(__v16qi) __W,
+(__mmask16) __M);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_maskz_multishift_epi64_epi8 (__mmask16 __M, __m128i __X, __m128i __Y)
+{
+  return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
+(__v16qi) __Y,
+(__v16qi)
+_mm_setzero_si128 (),
+(__mmask16) __M);
+}
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_multishift_epi64_epi8 (__m128i __X, __m128i __Y)
+{
+  return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
+(__v16qi) __Y,
+(__v16qi)
+_mm_undefined_si128 (),
+(__mmask16) -1);
+}
+
+static __inline__ __m256i __DEFAULT_FN_ATTRS
+

Re: [PATCH] D19324: [ASTMatchers] new forEachOverriden matcher

2016-05-23 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments.


Comment at: include/clang/AST/ASTContext.h:824
@@ -823,1 +823,3 @@
   unsigned overridden_methods_size(const CXXMethodDecl *Method) const;
+  typedef llvm::iterator_range
+  overridden_method_range;

Sure. Sorry about that.
The main idea was to use a range-like API instead of returning a nullable 
pointer to a range.


http://reviews.llvm.org/D19324



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20336: [AMDGPU] Remove individual debugger options + update features

2016-05-23 Thread Konstantin Zhuravlyov via cfe-commits
kzhuravl added a comment.

Ping


http://reviews.llvm.org/D20336



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20422: [MSVC2015] dllexport for defaulted special class members

2016-05-23 Thread Reid Kleckner via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm

Thanks!


http://reviews.llvm.org/D20422



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18953: [ms][dll] #26935 Defining a dllimport function should cause it to be exported

2016-05-23 Thread Reid Kleckner via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm


http://reviews.llvm.org/D18953



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20512: [PATCH] Bug 27475 - Request header guard check processes .hpp files as well as .h files

2016-05-23 Thread Mads Ravn via cfe-commits
madsravn added inline comments.


Comment at: clang-tidy/llvm/HeaderGuardCheck.h:19
@@ -18,3 +18,3 @@
 
 /// Finds and fixes header guards that do not adhere to LLVM style.
 class LLVMHeaderGuardCheck : public utils::HeaderGuardCheck {

hokein wrote:
> You should add a document for the option `HeaderFileExtensions` here.
I'm not sure what you mean here. What is "a document" in this context?


http://reviews.llvm.org/D20512



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Simon Pilgrim via cfe-commits
RKSimon created this revision.
RKSimon added reviewers: qcolombet, craig.topper, mkuper, andreadb, spatel.
RKSimon added a subscriber: cfe-commits.
RKSimon set the repository for this revision to rL LLVM.

Both the (V)CVTDQ2PD(Y) (i32 to f64) and (V)CVTPS2PD(Y) (f32 to f64) conversion 
instructions are lossless and can be safely represented as generic 
__builtin_convertvector calls instead of x86 intrinsics.

This patch removes the clang builtins and their use in the sse2/avx headers - a 
future patch will deal with removing the llvm intrinsics, but that will require 
a bit more work.

Repository:
  rL LLVM

http://reviews.llvm.org/D20528

Files:
  include/clang/Basic/BuiltinsX86.def
  lib/Headers/avxintrin.h
  lib/Headers/emmintrin.h
  test/CodeGen/avx-builtins.c
  test/CodeGen/builtins-x86.c
  test/CodeGen/sse2-builtins.c
  test/CodeGen/target-builtin-error-2.c

Index: test/CodeGen/target-builtin-error-2.c
===
--- test/CodeGen/target-builtin-error-2.c
+++ test/CodeGen/target-builtin-error-2.c
@@ -5,9 +5,9 @@
 
 // Since we do code generation on a function level this needs to error out since
 // the subtarget feature won't be available.
-__m256d wombat(__m128i a) {
+__m128 wombat(__m128i a) {
   if (__builtin_cpu_supports("avx"))
-return __builtin_ia32_cvtdq2pd256((__v4si)a); // expected-error {{'__builtin_ia32_cvtdq2pd256' needs target feature avx}}
+return __builtin_ia32_vpermilvarps((__v4sf) {0.0f, 1.0f, 2.0f, 3.0f}, (__v4si)a); // expected-error {{'__builtin_ia32_vpermilvarps' needs target feature avx}}
   else
-return (__m256d){0, 0, 0, 0};
+return (__m128){0, 0};
 }
Index: test/CodeGen/sse2-builtins.c
===
--- test/CodeGen/sse2-builtins.c
+++ test/CodeGen/sse2-builtins.c
@@ -415,7 +415,8 @@
 
 __m128d test_mm_cvtepi32_pd(__m128i A) {
   // CHECK-LABEL: test_mm_cvtepi32_pd
-  // CHECK: call <2 x double> @llvm.x86.sse2.cvtdq2pd(<4 x i32> %{{.*}})
+  // CHECK: shufflevector <4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <2 x i32> 
+  // CHECK: sitofp <2 x i32> %{{.*}} to <2 x double>
   return _mm_cvtepi32_pd(A);
 }
 
@@ -445,7 +446,8 @@
 
 __m128d test_mm_cvtps_pd(__m128 A) {
   // CHECK-LABEL: test_mm_cvtps_pd
-  // CHECK: call <2 x double> @llvm.x86.sse2.cvtps2pd(<4 x float> %{{.*}})
+  // CHECK: shufflevector <4 x float> %{{.*}}, <4 x float> %{{.*}}, <2 x i32> 
+  // CHECK: fpext <2 x float> %{{.*}} to <2 x double>
   return _mm_cvtps_pd(A);
 }
 
Index: test/CodeGen/builtins-x86.c
===
--- test/CodeGen/builtins-x86.c
+++ test/CodeGen/builtins-x86.c
@@ -325,7 +325,6 @@
   tmp_V2LLi = __builtin_ia32_psadbw128(tmp_V16c, tmp_V16c);
   tmp_V2d = __builtin_ia32_sqrtpd(tmp_V2d);
   tmp_V2d = __builtin_ia32_sqrtsd(tmp_V2d);
-  tmp_V2d = __builtin_ia32_cvtdq2pd(tmp_V4i);
   tmp_V4f = __builtin_ia32_cvtdq2ps(tmp_V4i);
   tmp_V2LLi = __builtin_ia32_cvtpd2dq(tmp_V2d);
   tmp_V2i = __builtin_ia32_cvtpd2pi(tmp_V2d);
@@ -338,7 +337,6 @@
   tmp_LLi = __builtin_ia32_cvtsd2si64(tmp_V2d);
 #endif
   tmp_V4i = __builtin_ia32_cvtps2dq(tmp_V4f);
-  tmp_V2d = __builtin_ia32_cvtps2pd(tmp_V4f);
   tmp_V4i = __builtin_ia32_cvttps2dq(tmp_V4f);
   (void) __builtin_ia32_clflush(tmp_vCp);
   (void) __builtin_ia32_lfence();
@@ -423,11 +421,9 @@
   tmp_V8f = __builtin_ia32_dpps256(tmp_V8f, tmp_V8f, 0x7);
   tmp_V4d = __builtin_ia32_cmppd256(tmp_V4d, tmp_V4d, 0);
   tmp_V8f = __builtin_ia32_cmpps256(tmp_V8f, tmp_V8f, 0);
-  tmp_V4d = __builtin_ia32_cvtdq2pd256(tmp_V4i);
   tmp_V8f = __builtin_ia32_cvtdq2ps256(tmp_V8i);
   tmp_V4f = __builtin_ia32_cvtpd2ps256(tmp_V4d);
   tmp_V8i = __builtin_ia32_cvtps2dq256(tmp_V8f);
-  tmp_V4d = __builtin_ia32_cvtps2pd256(tmp_V4f);
   tmp_V4i = __builtin_ia32_cvttpd2dq256(tmp_V4d);
   tmp_V4i = __builtin_ia32_cvtpd2dq256(tmp_V4d);
   tmp_V8i = __builtin_ia32_cvttps2dq256(tmp_V8f);
Index: test/CodeGen/avx-builtins.c
===
--- test/CodeGen/avx-builtins.c
+++ test/CodeGen/avx-builtins.c
@@ -250,7 +250,7 @@
 
 __m256d test_mm256_cvtepi32_pd(__m128i A) {
   // CHECK-LABEL: test_mm256_cvtepi32_pd
-  // CHECK: call <4 x double> @llvm.x86.avx.cvtdq2.pd.256(<4 x i32> %{{.*}})
+  // CHECK: sitofp <4 x i32> %{{.*}} to <4 x double>
   return _mm256_cvtepi32_pd(A);
 }
 
@@ -280,7 +280,7 @@
 
 __m256d test_mm256_cvtps_pd(__m128 A) {
   // CHECK-LABEL: test_mm256_cvtps_pd
-  // CHECK: call <4 x double> @llvm.x86.avx.cvt.ps2.pd.256(<4 x float> %{{.*}})
+  // CHECK: fpext <4 x float> %{{.*}} to <4 x double>
   return _mm256_cvtps_pd(A);
 }
 
Index: lib/Headers/emmintrin.h
===
--- lib/Headers/emmintrin.h
+++ lib/Headers/emmintrin.h
@@ -386,13 +386,15 @@
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_cvtps_pd(__m128 __a)
 {
-  return __builtin_ia32_cvtps2pd((__v4sf)__a);
+  return (__m128d) __b

Re: [PATCH] D20328: [libcxx] Externally threaded libc++ variant

2016-05-23 Thread Asiri Rathnayake via cfe-commits
rmaprath added a comment.

@mclow.lists, @EricWF: Any comments on this? If it helps, I could split off the 
library source changes and test setup into two separate patches. I thought to 
keep the two together as the test setup gives an idea of the overall objective.

Thanks.

/ Asiri


http://reviews.llvm.org/D20328



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20119: [libunwind] Improve unwinder stack usage

2016-05-23 Thread Asiri Rathnayake via cfe-commits
rmaprath added a comment.

@jroelofs: OK to commit?

Thanks.

/ Asiri


http://reviews.llvm.org/D20119



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20119: [libunwind] Improve unwinder stack usage

2016-05-23 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In http://reviews.llvm.org/D20119#431997, @rmaprath wrote:

> Addressing review comments from @jroelofs:
>
> - Moved the assertion in `libunwind.cpp` back to `UnwindCursor.cpp` where it 
> really belogs.
>
>   @jroelofs: I just realized that, with this new native-only build of 
> `libunwind`, users of `libunwind.h` would have to explicitly `#define` the 
> flag `_LIBUNWIND_IS_NATIVE_ONLY` in order to get the header in-sync with the 
> library. I can't see an immediate problem if they don't define that flag 
> though, it's just that they'll end up passing larger buffers than the library 
> needs. Do you see a problem here?


I'm not convinced it's a problem, (though possibly performance left on the 
table)...

> 'libc++' uses a `__config_site` mechanism to wire the cmake build options 
> into the `__config` header. We can implement a similar mechanism in 
> `libunwind`, not sure if that's necessary here.


I think that's the right way to go.

Jon

> WDYT?

> 

> Thanks.

> 

> / Asiri



http://reviews.llvm.org/D20119



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20133: [OpenCL] Fix __builtin_astype for vec3 types.

2016-05-23 Thread Anastasia Stulova via cfe-commits
Anastasia added inline comments.


Comment at: lib/CodeGen/CGExprScalar.cpp:3403
@@ +3402,3 @@
+static Value *ConvertVec3AndVec4(CGBuilderTy &Builder, CodeGenFunction &CGF,
+  Value *Src, unsigned numElementsDst) {
+  llvm::Value *UnV = llvm::UndefValue::get(Src->getType());

numElementsDst -> NumElementsDst

Also I would expect formatter to align to the parameter list area...


Comment at: lib/CodeGen/CGExprScalar.cpp:3420
@@ -3407,35 +3419,3 @@
   llvm::Type *SrcTy = Src->getType();
-  if (isa(DstTy) && isa(SrcTy)) {
-unsigned numElementsDst = cast(DstTy)->getNumElements();
-unsigned numElementsSrc = cast(SrcTy)->getNumElements();
-if ((numElementsDst == 3 && numElementsSrc == 4)
-|| (numElementsDst == 4 && numElementsSrc == 3)) {
-
-
-  // In the case of going from int4->float3, a bitcast is needed before
-  // doing a shuffle.
-  llvm::Type *srcElemTy =
-  cast(SrcTy)->getElementType();
-  llvm::Type *dstElemTy =
-  cast(DstTy)->getElementType();
-
-  if ((srcElemTy->isIntegerTy() && dstElemTy->isFloatTy())
-  || (srcElemTy->isFloatTy() && dstElemTy->isIntegerTy())) {
-// Create a float type of the same size as the source or destination.
-llvm::VectorType *newSrcTy = llvm::VectorType::get(dstElemTy,
- 
numElementsSrc);
-
-Src = Builder.CreateBitCast(Src, newSrcTy, "astypeCast");
-  }
-
-  llvm::Value *UnV = llvm::UndefValue::get(Src->getType());
-
-  SmallVector Args;
-  Args.push_back(Builder.getInt32(0));
-  Args.push_back(Builder.getInt32(1));
-  Args.push_back(Builder.getInt32(2));
-
-  if (numElementsDst == 4)
-Args.push_back(llvm::UndefValue::get(CGF.Int32Ty));
-
-  llvm::Constant *Mask = llvm::ConstantVector::get(Args);
+  unsigned numElementsSrc = isa(SrcTy) ?
+cast(SrcTy)->getNumElements() : 0;

So this code no longer applies to just vectors?


Comment at: lib/CodeGen/CGExprScalar.cpp:3422
@@ +3421,3 @@
+cast(SrcTy)->getNumElements() : 0;
+  unsigned numElementsDst = isa(DstTy) ?
+cast(DstTy)->getNumElements() : 0;

numElementsSrc -> NumElementsSrc

The same below!


Comment at: lib/CodeGen/CGExprScalar.cpp:3427
@@ +3426,3 @@
+  // vector to get a vec4, then a bitcast if the target type is different.
+  if (numElementsSrc == 3 && numElementsDst != 3) {
+Src = ConvertVec3AndVec4(Builder, CGF, Src, 4);

Should we check numElementsDst == 4 (the same above)?


Comment at: lib/CodeGen/CGExprScalar.cpp:3428
@@ +3427,3 @@
+  if (numElementsSrc == 3 && numElementsDst != 3) {
+Src = ConvertVec3AndVec4(Builder, CGF, Src, 4);
+Src = Builder.CreateBitCast(Src, DstTy);

I am not sure why is this chosen to be this way?

If I check the OpenCL spec for type reinterpreting it doesn't seem to require 
shuffle vector. Also s6.2.4.2 says: 
  "It is an error to use as_type() or as_typen() operator to reinterpret data 
to a type of a different number of bytes."

The only valid conversion according to the spec seems to be vec4->vec3:

  "When the operand and result type contain a different number of elements, the 
result shall be implementation-defined except if the operand is a 4-component 
vector and the result is a 3-component vector."

This change is affecting non-OpenCL code too. Is this reasonable approach for 
other vector implementations?


Comment at: lib/CodeGen/CGExprScalar.cpp:3429
@@ +3428,3 @@
+Src = ConvertVec3AndVec4(Builder, CGF, Src, 4);
+Src = Builder.CreateBitCast(Src, DstTy);
+Src->setName("astype");

I think we only need bitcast if type don't match?


Comment at: test/CodeGenOpenCL/as_type.cl:7
@@ +6,3 @@
+typedef __attribute__(( ext_vector_type(3) )) int int3;
+
+//CHECK: define spir_func <3 x i8> @f1(<4 x i8> %[[x:.*]])

Should this be disallowed by the frontend -? according to the spec s6.2.4.2:

  "It is an error to use as_type() or as_typen() operator to reinterpret data 
to a type of a different number of bytes."


http://reviews.llvm.org/D20133



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20373: PR27799: [OpenCL] Clang fails to compile libclc

2016-05-23 Thread Anastasia Stulova via cfe-commits
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

Do we have any test for this? Would be nice to add one if possible.


http://reviews.llvm.org/D20373



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20512: [PATCH] Bug 27475 - Request header guard check processes .hpp files as well as .h files

2016-05-23 Thread Haojian Wu via cfe-commits
hokein added inline comments.


Comment at: clang-tidy/llvm/HeaderGuardCheck.h:19
@@ -18,3 +18,3 @@
 
 /// Finds and fixes header guards that do not adhere to LLVM style.
 class LLVMHeaderGuardCheck : public utils::HeaderGuardCheck {

madsravn wrote:
> hokein wrote:
> > You should add a document for the option `HeaderFileExtensions` here.
> I'm not sure what you mean here. What is "a document" in this context?
Sorry for the unclear comment. You actually add an option 
`HeaderFileExtensions` in `LLVMHeaderGuardCheck`, so you need to add a document 
to describe it. See the file `DefinitionsInHeadersCheck.h` for details.


http://reviews.llvm.org/D20512



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r270457 - [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)

2016-05-23 Thread David Majnemer via cfe-commits
Author: majnemer
Date: Mon May 23 12:16:12 2016
New Revision: 270457

URL: http://llvm.org/viewvc/llvm-project?rev=270457&view=rev
Log:
[MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)

The layout_version attribute is pretty straightforward: use the layout
rules from version XYZ of MSVC when used like
struct __declspec(layout_version(XYZ)) S {};

The empty_bases attribute is more interesting.  It tries to get the C++
empty base optimization to fire more often by tweaking the MSVC ABI
rules in subtle ways:
1. Disable the leading and trailing zero-sized object flags if a class
   is marked __declspec(empty_bases) and is empty.

   This means that given:
   struct __declspec(empty_bases) A {};
   struct __declspec(empty_bases) B {};
   struct C : A, B {};

   'C' will have size 1 and nvsize 0 despite not being annotated
   __declspec(empty_bases).

2. When laying out virtual or non-virtual bases, disable the injection
   of padding between classes if the most derived class is marked
   __declspec(empty_bases).

   This means that given:
   struct A {};
   struct B {};
   struct __declspec(empty_bases) C : A, B {};

   'C' will have size 1 and nvsize 0.

3. When calculating the offset of a non-virtual base, choose offset zero
   if the most derived class is marked __declspec(empty_bases) and the
   base is empty _and_ has an nvsize of 0.

   Because of the ABI rules, this does not mean that empty bases
   reliably get placed at offset 0!

   For example:
   struct A {};
   struct B {};
   struct __declspec(empty_bases) C : A, B { virtual ~C(); };

   'C' will be pointer sized to account for the vfptr at offset 0.
   'A' and 'B' will _not_ be at offset 0 despite being empty!
   Instead, they will be located right after the vfptr.

   This occurs due to the interaction betweeen non-virtual base layout
   and virtual function pointer injection: injection occurs after the
   nv-bases and shifts them down by the size of a pointer.

Added:
cfe/trunk/test/Layout/ms-x86-declspec-empty_bases.cpp
cfe/trunk/test/SemaCXX/ms-empty_bases.cpp
cfe/trunk/test/SemaCXX/ms-layout_version.cpp
Modified:
cfe/trunk/include/clang/AST/RecordLayout.h
cfe/trunk/include/clang/Basic/Attr.td
cfe/trunk/include/clang/Basic/AttrDocs.td
cfe/trunk/lib/AST/RecordLayout.cpp
cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Modified: cfe/trunk/include/clang/AST/RecordLayout.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecordLayout.h?rev=270457&r1=270456&r2=270457&view=diff
==
--- cfe/trunk/include/clang/AST/RecordLayout.h (original)
+++ cfe/trunk/include/clang/AST/RecordLayout.h Mon May 23 12:16:12 2016
@@ -104,10 +104,10 @@ private:
 /// a primary base class.
 bool HasExtendableVFPtr : 1;
 
-/// HasZeroSizedSubObject - True if this class contains a zero sized member
-/// or base or a base with a zero sized member or base.  Only used for
-/// MS-ABI.
-bool HasZeroSizedSubObject : 1;
+/// EndsWithZeroSizedObject - True if this class contains a zero sized
+/// member or base or a base with a zero sized member or base.
+/// Only used for MS-ABI.
+bool EndsWithZeroSizedObject : 1;
 
 /// \brief True if this class is zero sized or first base is zero sized or
 /// has this property.  Only used for MS-ABI.
@@ -154,7 +154,7 @@ private:
   const CXXRecordDecl *PrimaryBase,
   bool IsPrimaryBaseVirtual,
   const CXXRecordDecl *BaseSharingVBPtr,
-  bool HasZeroSizedSubObject,
+  bool EndsWithZeroSizedObject,
   bool LeadsWithZeroSizedBase,
   const BaseOffsetsMapTy& BaseOffsets,
   const VBaseOffsetsMapTy& VBaseOffsets);
@@ -283,8 +283,8 @@ public:
 return RequiredAlignment;
   }
 
-  bool hasZeroSizedSubObject() const {
-return CXXInfo && CXXInfo->HasZeroSizedSubObject;
+  bool endsWithZeroSizedObject() const {
+return CXXInfo && CXXInfo->EndsWithZeroSizedObject;
   }
 
   bool leadsWithZeroSizedBase() const {

Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=270457&r1=270456&r2=270457&view=diff
==
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Mon May 23 12:16:12 2016
@@ -745,6 +745,12 @@ def Destructor : InheritableAttr {
   let Documentation = [Undocumented];
 }
 
+def EmptyBases : InheritableAttr, TargetSpecificAttr {
+  let Spellings = [Declspec<"empty_bases">];
+  let Subjects = SubjectList<[CXXRecord]>;
+  let Documentation = [EmptyBasesDocs];
+}
+
 def EnableIf : InheritableAttr {
   let Spellings = [GNU<"enable_if">];
   let Subjects = SubjectList<[Function]>;
@@ -868,6 +8

Re: [PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Michael Kuperstein via cfe-commits
mkuper added a comment.

Thanks, Simon!
This looks right, but we may lose some end-to-end tests, since right now we 
have a clang-level test that checks the builtin is lowered to the intrinsic, 
and (hopefully) a CG-level test that the intrinsic is lowered to the correct 
instruction.
Do you know if there are already CG tests that check we correctly lower these 
IR patterns to CVTPS2PD, etc? If not, could you add them?



Comment at: lib/Headers/emmintrin.h:390
@@ -390,1 +389,3 @@
+  return (__m128d) __builtin_convertvector(
+  __builtin_shufflevector((__v4sf __a, (__v4sf)__a, 0, 1), __v2df);
 }

It looks like there's a missing paren after the first __v4sf.
How does the test compile? Or am I misreading?


Repository:
  rL LLVM

http://reviews.llvm.org/D20528



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r270458 - Clang support for __is_assignable intrinsic

2016-05-23 Thread David Majnemer via cfe-commits
Author: majnemer
Date: Mon May 23 12:21:55 2016
New Revision: 270458

URL: http://llvm.org/viewvc/llvm-project?rev=270458&view=rev
Log:
Clang support for __is_assignable intrinsic

MSVC now supports the __is_assignable type trait intrinsic,
to enable easier and more efficient implementation of the
Standard Library's is_assignable trait.
As of Visual Studio 2015 Update 3, the VC Standard Library
implementation uses the new intrinsic unconditionally.

The implementation is pretty straightforward due to the previously
existing is_nothrow_assignable and is_trivially_assignable.
We handle __is_assignable via the same code as the other two except
that we skip the extra checks for nothrow or triviality.

Patch by Dave Bartolomeo!

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

Modified:
cfe/trunk/docs/LanguageExtensions.rst
cfe/trunk/include/clang/Basic/TokenKinds.def
cfe/trunk/include/clang/Basic/TypeTraits.h
cfe/trunk/lib/Lex/PPMacroExpansion.cpp
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/lib/Parse/ParseExpr.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/test/Lexer/has_feature_type_traits.cpp
cfe/trunk/test/PCH/cxx-traits.cpp
cfe/trunk/test/PCH/cxx-traits.h
cfe/trunk/test/SemaCXX/type-traits.cpp

Modified: cfe/trunk/docs/LanguageExtensions.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LanguageExtensions.rst?rev=270458&r1=270457&r2=270458&view=diff
==
--- cfe/trunk/docs/LanguageExtensions.rst (original)
+++ cfe/trunk/docs/LanguageExtensions.rst Mon May 23 12:21:55 2016
@@ -1022,6 +1022,7 @@ The following type trait primitives are
 * ``__is_nothrow_assignable`` (MSVC 2013, clang)
 * ``__is_constructible`` (MSVC 2013, clang)
 * ``__is_nothrow_constructible`` (MSVC 2013, clang)
+* ``__is_assignable`` (MSVC 2015, clang)
 
 Blocks
 ==

Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=270458&r1=270457&r2=270458&view=diff
==
--- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.def Mon May 23 12:21:55 2016
@@ -407,6 +407,9 @@ TYPE_TRAIT_2(__is_nothrow_assignable, Is
 TYPE_TRAIT_N(__is_constructible, IsConstructible, KEYCXX)
 TYPE_TRAIT_N(__is_nothrow_constructible, IsNothrowConstructible, KEYCXX)
 
+// MSVC14.0 / VS2015 Type Traits
+TYPE_TRAIT_2(__is_assignable, IsAssignable, KEYCXX)
+
 // GNU and MS Type Traits
 TYPE_TRAIT_1(__has_nothrow_assign, HasNothrowAssign, KEYCXX)
 TYPE_TRAIT_1(__has_nothrow_move_assign, HasNothrowMoveAssign, KEYCXX)

Modified: cfe/trunk/include/clang/Basic/TypeTraits.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TypeTraits.h?rev=270458&r1=270457&r2=270458&view=diff
==
--- cfe/trunk/include/clang/Basic/TypeTraits.h (original)
+++ cfe/trunk/include/clang/Basic/TypeTraits.h Mon May 23 12:21:55 2016
@@ -74,6 +74,7 @@ namespace clang {
 BTT_IsConvertibleTo,
 BTT_IsSame,
 BTT_TypeCompatible,
+BTT_IsAssignable,
 BTT_IsNothrowAssignable,
 BTT_IsTriviallyAssignable,
 BTT_Last = BTT_IsTriviallyAssignable,

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=270458&r1=270457&r2=270458&view=diff
==
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Mon May 23 12:21:55 2016
@@ -1196,6 +1196,7 @@ static bool HasFeature(const Preprocesso
   .Case("has_trivial_destructor", LangOpts.CPlusPlus)
   .Case("has_virtual_destructor", LangOpts.CPlusPlus)
   .Case("is_abstract", LangOpts.CPlusPlus)
+  .Case("is_assignable", LangOpts.CPlusPlus)
   .Case("is_base_of", LangOpts.CPlusPlus)
   .Case("is_class", LangOpts.CPlusPlus)
   .Case("is_constructible", LangOpts.CPlusPlus)

Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=270458&r1=270457&r2=270458&view=diff
==
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Mon May 23 12:21:55 2016
@@ -1269,6 +1269,7 @@ void Parser::ParseClassSpecifier(tok::To
   Tok.isOneOf(tok::kw___is_abstract,
   tok::kw___is_arithmetic,
   tok::kw___is_array,
+  tok::kw___is_assignable,
   tok::kw___is_base_of,
   tok::kw___is_class,
   tok::kw___is_complete_type,

Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/P

Re: r270457 - [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)

2016-05-23 Thread Aaron Ballman via cfe-commits
On Mon, May 23, 2016 at 1:16 PM, David Majnemer via cfe-commits
 wrote:
> Author: majnemer
> Date: Mon May 23 12:16:12 2016
> New Revision: 270457
>
> URL: http://llvm.org/viewvc/llvm-project?rev=270457&view=rev
> Log:
> [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)
>
> The layout_version attribute is pretty straightforward: use the layout
> rules from version XYZ of MSVC when used like
> struct __declspec(layout_version(XYZ)) S {};
>
> The empty_bases attribute is more interesting.  It tries to get the C++
> empty base optimization to fire more often by tweaking the MSVC ABI
> rules in subtle ways:
> 1. Disable the leading and trailing zero-sized object flags if a class
>is marked __declspec(empty_bases) and is empty.
>
>This means that given:
>struct __declspec(empty_bases) A {};
>struct __declspec(empty_bases) B {};
>struct C : A, B {};
>
>'C' will have size 1 and nvsize 0 despite not being annotated
>__declspec(empty_bases).
>
> 2. When laying out virtual or non-virtual bases, disable the injection
>of padding between classes if the most derived class is marked
>__declspec(empty_bases).
>
>This means that given:
>struct A {};
>struct B {};
>struct __declspec(empty_bases) C : A, B {};
>
>'C' will have size 1 and nvsize 0.
>
> 3. When calculating the offset of a non-virtual base, choose offset zero
>if the most derived class is marked __declspec(empty_bases) and the
>base is empty _and_ has an nvsize of 0.
>
>Because of the ABI rules, this does not mean that empty bases
>reliably get placed at offset 0!
>
>For example:
>struct A {};
>struct B {};
>struct __declspec(empty_bases) C : A, B { virtual ~C(); };
>
>'C' will be pointer sized to account for the vfptr at offset 0.
>'A' and 'B' will _not_ be at offset 0 despite being empty!
>Instead, they will be located right after the vfptr.
>
>This occurs due to the interaction betweeen non-virtual base layout
>and virtual function pointer injection: injection occurs after the
>nv-bases and shifts them down by the size of a pointer.
>
> Added:
> cfe/trunk/test/Layout/ms-x86-declspec-empty_bases.cpp
> cfe/trunk/test/SemaCXX/ms-empty_bases.cpp
> cfe/trunk/test/SemaCXX/ms-layout_version.cpp
> Modified:
> cfe/trunk/include/clang/AST/RecordLayout.h
> cfe/trunk/include/clang/Basic/Attr.td
> cfe/trunk/include/clang/Basic/AttrDocs.td
> cfe/trunk/lib/AST/RecordLayout.cpp
> cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
> cfe/trunk/lib/Sema/SemaDeclAttr.cpp
>
> Modified: cfe/trunk/include/clang/AST/RecordLayout.h
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecordLayout.h?rev=270457&r1=270456&r2=270457&view=diff
> ==
> --- cfe/trunk/include/clang/AST/RecordLayout.h (original)
> +++ cfe/trunk/include/clang/AST/RecordLayout.h Mon May 23 12:16:12 2016
> @@ -104,10 +104,10 @@ private:
>  /// a primary base class.
>  bool HasExtendableVFPtr : 1;
>
> -/// HasZeroSizedSubObject - True if this class contains a zero sized 
> member
> -/// or base or a base with a zero sized member or base.  Only used for
> -/// MS-ABI.
> -bool HasZeroSizedSubObject : 1;
> +/// EndsWithZeroSizedObject - True if this class contains a zero sized
> +/// member or base or a base with a zero sized member or base.
> +/// Only used for MS-ABI.
> +bool EndsWithZeroSizedObject : 1;
>
>  /// \brief True if this class is zero sized or first base is zero sized 
> or
>  /// has this property.  Only used for MS-ABI.
> @@ -154,7 +154,7 @@ private:
>const CXXRecordDecl *PrimaryBase,
>bool IsPrimaryBaseVirtual,
>const CXXRecordDecl *BaseSharingVBPtr,
> -  bool HasZeroSizedSubObject,
> +  bool EndsWithZeroSizedObject,
>bool LeadsWithZeroSizedBase,
>const BaseOffsetsMapTy& BaseOffsets,
>const VBaseOffsetsMapTy& VBaseOffsets);
> @@ -283,8 +283,8 @@ public:
>  return RequiredAlignment;
>}
>
> -  bool hasZeroSizedSubObject() const {
> -return CXXInfo && CXXInfo->HasZeroSizedSubObject;
> +  bool endsWithZeroSizedObject() const {
> +return CXXInfo && CXXInfo->EndsWithZeroSizedObject;
>}
>
>bool leadsWithZeroSizedBase() const {
>
> Modified: cfe/trunk/include/clang/Basic/Attr.td
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=270457&r1=270456&r2=270457&view=diff
> ==
> --- cfe/trunk/include/clang/Basic/Attr.td (original)
> +++ cfe/trunk/include/clang/Basic/Attr.td Mon May 23 12:16:12 2016
> @@ -745,6 +745,12 @@ def Destructor : InheritableAttr {
>let Documentation = [Undocumented];
>  }
>
> +def EmptyBases : Inheri

Re: [PATCH] D20492: Clang support for __is_assignable intrinsic

2016-05-23 Thread David Majnemer via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL270458: Clang support for __is_assignable intrinsic 
(authored by majnemer).

Changed prior to commit:
  http://reviews.llvm.org/D20492?vs=58014&id=58112#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20492

Files:
  cfe/trunk/docs/LanguageExtensions.rst
  cfe/trunk/include/clang/Basic/TokenKinds.def
  cfe/trunk/include/clang/Basic/TypeTraits.h
  cfe/trunk/lib/Lex/PPMacroExpansion.cpp
  cfe/trunk/lib/Parse/ParseDeclCXX.cpp
  cfe/trunk/lib/Parse/ParseExpr.cpp
  cfe/trunk/lib/Sema/SemaExprCXX.cpp
  cfe/trunk/test/Lexer/has_feature_type_traits.cpp
  cfe/trunk/test/PCH/cxx-traits.cpp
  cfe/trunk/test/PCH/cxx-traits.h
  cfe/trunk/test/SemaCXX/type-traits.cpp

Index: cfe/trunk/docs/LanguageExtensions.rst
===
--- cfe/trunk/docs/LanguageExtensions.rst
+++ cfe/trunk/docs/LanguageExtensions.rst
@@ -1022,6 +1022,7 @@
 * ``__is_nothrow_assignable`` (MSVC 2013, clang)
 * ``__is_constructible`` (MSVC 2013, clang)
 * ``__is_nothrow_constructible`` (MSVC 2013, clang)
+* ``__is_assignable`` (MSVC 2015, clang)
 
 Blocks
 ==
Index: cfe/trunk/include/clang/Basic/TypeTraits.h
===
--- cfe/trunk/include/clang/Basic/TypeTraits.h
+++ cfe/trunk/include/clang/Basic/TypeTraits.h
@@ -74,6 +74,7 @@
 BTT_IsConvertibleTo,
 BTT_IsSame,
 BTT_TypeCompatible,
+BTT_IsAssignable,
 BTT_IsNothrowAssignable,
 BTT_IsTriviallyAssignable,
 BTT_Last = BTT_IsTriviallyAssignable,
Index: cfe/trunk/include/clang/Basic/TokenKinds.def
===
--- cfe/trunk/include/clang/Basic/TokenKinds.def
+++ cfe/trunk/include/clang/Basic/TokenKinds.def
@@ -407,6 +407,9 @@
 TYPE_TRAIT_N(__is_constructible, IsConstructible, KEYCXX)
 TYPE_TRAIT_N(__is_nothrow_constructible, IsNothrowConstructible, KEYCXX)
 
+// MSVC14.0 / VS2015 Type Traits
+TYPE_TRAIT_2(__is_assignable, IsAssignable, KEYCXX)
+
 // GNU and MS Type Traits
 TYPE_TRAIT_1(__has_nothrow_assign, HasNothrowAssign, KEYCXX)
 TYPE_TRAIT_1(__has_nothrow_move_assign, HasNothrowMoveAssign, KEYCXX)
Index: cfe/trunk/test/Lexer/has_feature_type_traits.cpp
===
--- cfe/trunk/test/Lexer/has_feature_type_traits.cpp
+++ cfe/trunk/test/Lexer/has_feature_type_traits.cpp
@@ -45,6 +45,11 @@
 #endif
 // CHECK: int is_abstract();
 
+#if __has_feature(is_assignable)
+int is_assignable();
+#endif
+// CHECK: int is_assignable();
+
 #if __has_feature(is_base_of)
 int is_base_of();
 #endif
Index: cfe/trunk/test/PCH/cxx-traits.cpp
===
--- cfe/trunk/test/PCH/cxx-traits.cpp
+++ cfe/trunk/test/PCH/cxx-traits.cpp
@@ -18,6 +18,7 @@
 bool _is_abstract_result = __is_abstract(int);
 bool _is_arithmetic_result = __is_arithmetic(int);
 bool _is_array_result = __is_array(int);
+bool _is_assignable_result = __is_assignable(int, int);
 bool _is_base_of_result = __is_base_of(int, int);
 bool _is_class_result = __is_class(int);
 bool _is_complete_type_result = __is_complete_type(int);
Index: cfe/trunk/test/PCH/cxx-traits.h
===
--- cfe/trunk/test/PCH/cxx-traits.h
+++ cfe/trunk/test/PCH/cxx-traits.h
@@ -20,6 +20,7 @@
 struct __is_abstract {};  // expected-warning {{made available}}
 struct __is_arithmetic {};  // expected-warning {{made available}}
 struct __is_array {};  // expected-warning {{made available}}
+struct __is_assignable {};  // expected-warning {{made available}}
 struct __is_base_of {};  // expected-warning {{made available}}
 struct __is_class {};  // expected-warning {{made available}}
 struct __is_complete_type {};  // expected-warning {{made available}}
Index: cfe/trunk/test/SemaCXX/type-traits.cpp
===
--- cfe/trunk/test/SemaCXX/type-traits.cpp
+++ cfe/trunk/test/SemaCXX/type-traits.cpp
@@ -1514,6 +1514,9 @@
 
   { int arr[T(__is_nothrow_assignable(HasNoThrowMoveAssign, HasNoThrowMoveAssign))]; }
   { int arr[F(__is_nothrow_assignable(HasThrowMoveAssign, HasThrowMoveAssign))]; }
+
+  { int arr[T(__is_assignable(HasNoThrowMoveAssign, HasNoThrowMoveAssign))]; }
+  { int arr[T(__is_assignable(HasThrowMoveAssign, HasThrowMoveAssign))]; }
 }
 
 void has_trivial_move_assign() {
@@ -1974,6 +1977,46 @@
  TrivialMoveButNotCopy)))]; }
   { int arr[T((__is_trivially_assignable(TrivialMoveButNotCopy&,
  TrivialMoveButNotCopy&&)))]; }
+  { int arr[T((__is_trivially_assignable(int&, int)))]; }
+  { int arr[T((__is_trivially_assignable(int&, int&)))]; }
+  { int arr[T((__is_trivially_assignable(int&, int&&)))]; }
+  { int arr[T((__is_trivially_assignable(int&, const int&)))]; }
+  { int arr[T((__is_trivially_

Re: r270457 - [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)

2016-05-23 Thread David Majnemer via cfe-commits
On Mon, May 23, 2016 at 10:28 AM, Aaron Ballman 
wrote:

> On Mon, May 23, 2016 at 1:16 PM, David Majnemer via cfe-commits
>  wrote:
> > Author: majnemer
> > Date: Mon May 23 12:16:12 2016
> > New Revision: 270457
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=270457&view=rev
> > Log:
> > [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)
> >
> > The layout_version attribute is pretty straightforward: use the layout
> > rules from version XYZ of MSVC when used like
> > struct __declspec(layout_version(XYZ)) S {};
> >
> > The empty_bases attribute is more interesting.  It tries to get the C++
> > empty base optimization to fire more often by tweaking the MSVC ABI
> > rules in subtle ways:
> > 1. Disable the leading and trailing zero-sized object flags if a class
> >is marked __declspec(empty_bases) and is empty.
> >
> >This means that given:
> >struct __declspec(empty_bases) A {};
> >struct __declspec(empty_bases) B {};
> >struct C : A, B {};
> >
> >'C' will have size 1 and nvsize 0 despite not being annotated
> >__declspec(empty_bases).
> >
> > 2. When laying out virtual or non-virtual bases, disable the injection
> >of padding between classes if the most derived class is marked
> >__declspec(empty_bases).
> >
> >This means that given:
> >struct A {};
> >struct B {};
> >struct __declspec(empty_bases) C : A, B {};
> >
> >'C' will have size 1 and nvsize 0.
> >
> > 3. When calculating the offset of a non-virtual base, choose offset zero
> >if the most derived class is marked __declspec(empty_bases) and the
> >base is empty _and_ has an nvsize of 0.
> >
> >Because of the ABI rules, this does not mean that empty bases
> >reliably get placed at offset 0!
> >
> >For example:
> >struct A {};
> >struct B {};
> >struct __declspec(empty_bases) C : A, B { virtual ~C(); };
> >
> >'C' will be pointer sized to account for the vfptr at offset 0.
> >'A' and 'B' will _not_ be at offset 0 despite being empty!
> >Instead, they will be located right after the vfptr.
> >
> >This occurs due to the interaction betweeen non-virtual base layout
> >and virtual function pointer injection: injection occurs after the
> >nv-bases and shifts them down by the size of a pointer.
> >
> > Added:
> > cfe/trunk/test/Layout/ms-x86-declspec-empty_bases.cpp
> > cfe/trunk/test/SemaCXX/ms-empty_bases.cpp
> > cfe/trunk/test/SemaCXX/ms-layout_version.cpp
> > Modified:
> > cfe/trunk/include/clang/AST/RecordLayout.h
> > cfe/trunk/include/clang/Basic/Attr.td
> > cfe/trunk/include/clang/Basic/AttrDocs.td
> > cfe/trunk/lib/AST/RecordLayout.cpp
> > cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
> > cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> >
> > Modified: cfe/trunk/include/clang/AST/RecordLayout.h
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecordLayout.h?rev=270457&r1=270456&r2=270457&view=diff
> >
> ==
> > --- cfe/trunk/include/clang/AST/RecordLayout.h (original)
> > +++ cfe/trunk/include/clang/AST/RecordLayout.h Mon May 23 12:16:12 2016
> > @@ -104,10 +104,10 @@ private:
> >  /// a primary base class.
> >  bool HasExtendableVFPtr : 1;
> >
> > -/// HasZeroSizedSubObject - True if this class contains a zero
> sized member
> > -/// or base or a base with a zero sized member or base.  Only used
> for
> > -/// MS-ABI.
> > -bool HasZeroSizedSubObject : 1;
> > +/// EndsWithZeroSizedObject - True if this class contains a zero
> sized
> > +/// member or base or a base with a zero sized member or base.
> > +/// Only used for MS-ABI.
> > +bool EndsWithZeroSizedObject : 1;
> >
> >  /// \brief True if this class is zero sized or first base is zero
> sized or
> >  /// has this property.  Only used for MS-ABI.
> > @@ -154,7 +154,7 @@ private:
> >const CXXRecordDecl *PrimaryBase,
> >bool IsPrimaryBaseVirtual,
> >const CXXRecordDecl *BaseSharingVBPtr,
> > -  bool HasZeroSizedSubObject,
> > +  bool EndsWithZeroSizedObject,
> >bool LeadsWithZeroSizedBase,
> >const BaseOffsetsMapTy& BaseOffsets,
> >const VBaseOffsetsMapTy& VBaseOffsets);
> > @@ -283,8 +283,8 @@ public:
> >  return RequiredAlignment;
> >}
> >
> > -  bool hasZeroSizedSubObject() const {
> > -return CXXInfo && CXXInfo->HasZeroSizedSubObject;
> > +  bool endsWithZeroSizedObject() const {
> > +return CXXInfo && CXXInfo->EndsWithZeroSizedObject;
> >}
> >
> >bool leadsWithZeroSizedBase() const {
> >
> > Modified: cfe/trunk/include/clang/Basic/Attr.td
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=270457&r1=270456&r2=270457&view=diff
> >
> 

r270461 - Address post-commit review feedback to r270457

2016-05-23 Thread David Majnemer via cfe-commits
Author: majnemer
Date: Mon May 23 12:32:35 2016
New Revision: 270461

URL: http://llvm.org/viewvc/llvm-project?rev=270461&view=rev
Log:
Address post-commit review feedback to r270457

Add two tests which show our error handling behavior for invalid
parameters in the layout_version and empty_bases attributes.

Amend our documentation to make it more clear that
__declspec(empty_bases) and __declspec(layout_version) can only apply to
classes, structs, and unions.

Modified:
cfe/trunk/include/clang/Basic/AttrDocs.td
cfe/trunk/test/SemaCXX/ms-empty_bases.cpp
cfe/trunk/test/SemaCXX/ms-layout_version.cpp

Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=270461&r1=270460&r2=270461&view=diff
==
--- cfe/trunk/include/clang/Basic/AttrDocs.td (original)
+++ cfe/trunk/include/clang/Basic/AttrDocs.td Mon May 23 12:32:35 2016
@@ -1558,6 +1558,7 @@ def EmptyBasesDocs : Documentation {
   let Content = [{
 The empty_bases attribute permits the compiler to utilize the
 empty-base-optimization more frequently.
+This attribute only applies to struct, class, and union types.
 It is only supported when using the Microsoft C++ ABI.
   }];
 }
@@ -1567,6 +1568,7 @@ def LayoutVersionDocs : Documentation {
   let Content = [{
 The layout_version attribute requests that the compiler utilize the class
 layout rules of a particular compiler version.
+This attribute only applies to struct, class, and union types.
 It is only supported when using the Microsoft C++ ABI.
   }];
 }

Modified: cfe/trunk/test/SemaCXX/ms-empty_bases.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/ms-empty_bases.cpp?rev=270461&r1=270460&r2=270461&view=diff
==
--- cfe/trunk/test/SemaCXX/ms-empty_bases.cpp (original)
+++ cfe/trunk/test/SemaCXX/ms-empty_bases.cpp Mon May 23 12:32:35 2016
@@ -5,3 +5,5 @@ enum __declspec(empty_bases) E {}; // ex
 int __declspec(empty_bases) I; // expected-warning{{'empty_bases' attribute 
only applies to classes}}
 typedef struct T __declspec(empty_bases) U; // expected-warning{{'empty_bases' 
attribute only applies to classes}}
 auto z = []() __declspec(empty_bases) { return nullptr; }; // 
expected-warning{{'empty_bases' attribute only applies to classes}}
+
+struct __declspec(empty_bases(1)) X {}; // expected-error{{'empty_bases' 
attribute takes no arguments}}

Modified: cfe/trunk/test/SemaCXX/ms-layout_version.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/ms-layout_version.cpp?rev=270461&r1=270460&r2=270461&view=diff
==
--- cfe/trunk/test/SemaCXX/ms-layout_version.cpp (original)
+++ cfe/trunk/test/SemaCXX/ms-layout_version.cpp Mon May 23 12:32:35 2016
@@ -8,3 +8,4 @@ auto z = []() __declspec(layout_version(
 
 struct __declspec(layout_version(18)) X {}; // 
expected-error{{'layout_version' attribute parameter 18 is out of bounds}}
 struct __declspec(layout_version(20)) Y {}; // 
expected-error{{'layout_version' attribute parameter 20 is out of bounds}}
+struct __declspec(layout_version) Z {}; // expected-error{{attribute takes one 
argument}}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r270457 - [MS ABI] Implement __declspec(empty_bases) and __declspec(layout_version)

2016-05-23 Thread Aaron Ballman via cfe-commits
On Mon, May 23, 2016 at 1:36 PM, David Majnemer
 wrote:
>
>
> On Mon, May 23, 2016 at 10:28 AM, Aaron Ballman 
> wrote:
>>
>> On Mon, May 23, 2016 at 1:16 PM, David Majnemer via cfe-commits
>>  wrote:
>> > Author: majnemer
>> > Date: Mon May 23 12:16:12 2016
>> > New Revision: 270457
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=270457&view=rev
>> > Log:
>> > [MS ABI] Implement __declspec(empty_bases) and
>> > __declspec(layout_version)
>> >
>> > The layout_version attribute is pretty straightforward: use the layout
>> > rules from version XYZ of MSVC when used like
>> > struct __declspec(layout_version(XYZ)) S {};
>> >
>> > The empty_bases attribute is more interesting.  It tries to get the C++
>> > empty base optimization to fire more often by tweaking the MSVC ABI
>> > rules in subtle ways:
>> > 1. Disable the leading and trailing zero-sized object flags if a class
>> >is marked __declspec(empty_bases) and is empty.
>> >
>> >This means that given:
>> >struct __declspec(empty_bases) A {};
>> >struct __declspec(empty_bases) B {};
>> >struct C : A, B {};
>> >
>> >'C' will have size 1 and nvsize 0 despite not being annotated
>> >__declspec(empty_bases).
>> >
>> > 2. When laying out virtual or non-virtual bases, disable the injection
>> >of padding between classes if the most derived class is marked
>> >__declspec(empty_bases).
>> >
>> >This means that given:
>> >struct A {};
>> >struct B {};
>> >struct __declspec(empty_bases) C : A, B {};
>> >
>> >'C' will have size 1 and nvsize 0.
>> >
>> > 3. When calculating the offset of a non-virtual base, choose offset zero
>> >if the most derived class is marked __declspec(empty_bases) and the
>> >base is empty _and_ has an nvsize of 0.
>> >
>> >Because of the ABI rules, this does not mean that empty bases
>> >reliably get placed at offset 0!
>> >
>> >For example:
>> >struct A {};
>> >struct B {};
>> >struct __declspec(empty_bases) C : A, B { virtual ~C(); };
>> >
>> >'C' will be pointer sized to account for the vfptr at offset 0.
>> >'A' and 'B' will _not_ be at offset 0 despite being empty!
>> >Instead, they will be located right after the vfptr.
>> >
>> >This occurs due to the interaction betweeen non-virtual base layout
>> >and virtual function pointer injection: injection occurs after the
>> >nv-bases and shifts them down by the size of a pointer.
>> >
>> > Added:
>> > cfe/trunk/test/Layout/ms-x86-declspec-empty_bases.cpp
>> > cfe/trunk/test/SemaCXX/ms-empty_bases.cpp
>> > cfe/trunk/test/SemaCXX/ms-layout_version.cpp
>> > Modified:
>> > cfe/trunk/include/clang/AST/RecordLayout.h
>> > cfe/trunk/include/clang/Basic/Attr.td
>> > cfe/trunk/include/clang/Basic/AttrDocs.td
>> > cfe/trunk/lib/AST/RecordLayout.cpp
>> > cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
>> > cfe/trunk/lib/Sema/SemaDeclAttr.cpp
>> >
>> > Modified: cfe/trunk/include/clang/AST/RecordLayout.h
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecordLayout.h?rev=270457&r1=270456&r2=270457&view=diff
>> >
>> > ==
>> > --- cfe/trunk/include/clang/AST/RecordLayout.h (original)
>> > +++ cfe/trunk/include/clang/AST/RecordLayout.h Mon May 23 12:16:12 2016
>> > @@ -104,10 +104,10 @@ private:
>> >  /// a primary base class.
>> >  bool HasExtendableVFPtr : 1;
>> >
>> > -/// HasZeroSizedSubObject - True if this class contains a zero
>> > sized member
>> > -/// or base or a base with a zero sized member or base.  Only used
>> > for
>> > -/// MS-ABI.
>> > -bool HasZeroSizedSubObject : 1;
>> > +/// EndsWithZeroSizedObject - True if this class contains a zero
>> > sized
>> > +/// member or base or a base with a zero sized member or base.
>> > +/// Only used for MS-ABI.
>> > +bool EndsWithZeroSizedObject : 1;
>> >
>> >  /// \brief True if this class is zero sized or first base is zero
>> > sized or
>> >  /// has this property.  Only used for MS-ABI.
>> > @@ -154,7 +154,7 @@ private:
>> >const CXXRecordDecl *PrimaryBase,
>> >bool IsPrimaryBaseVirtual,
>> >const CXXRecordDecl *BaseSharingVBPtr,
>> > -  bool HasZeroSizedSubObject,
>> > +  bool EndsWithZeroSizedObject,
>> >bool LeadsWithZeroSizedBase,
>> >const BaseOffsetsMapTy& BaseOffsets,
>> >const VBaseOffsetsMapTy& VBaseOffsets);
>> > @@ -283,8 +283,8 @@ public:
>> >  return RequiredAlignment;
>> >}
>> >
>> > -  bool hasZeroSizedSubObject() const {
>> > -return CXXInfo && CXXInfo->HasZeroSizedSubObject;
>> > +  bool endsWithZeroSizedObject() const {
>> > +return CXXInfo && CXXInfo->EndsWithZeroSizedObject;
>> >}
>> >
>> >bool leadsWithZeroSizedBase() const {
>> >
>> > Modified: cfe/trunk/in

Re: [PATCH] D20500: [ms] Allow more unqualified lookup of types in dependent base classes

2016-05-23 Thread Reid Kleckner via cfe-commits
rnk marked an inline comment as done.


Comment at: lib/Parse/ParseDecl.cpp:2282
@@ -2281,3 +2281,3 @@
 
   // Otherwise, if we don't consume this token, we are going to emit an
   // error anyway.  Try to recover from various common problems.  Check

rsmith wrote:
> Maybe put the check here instead. That way, you can apply it for any 
> DSContext.
Done. With that change, we ended up over-accepting invalid C++ like this:
  template 
  struct A : T {
C c; // MSVC rejects, C is undeclared. My patch accepted invalid.
  };
  struct B { typedef int C; };
  template struct A;

This recovery mode should only be firing inside *methods* of classes with 
dependent bases, so I tweaked ActOnMSVCUnknownType to do that.


http://reviews.llvm.org/D20500



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20500: [ms] Allow more unqualified lookup of types in dependent base classes

2016-05-23 Thread Reid Kleckner via cfe-commits
rnk updated this revision to Diff 58119.
rnk added a comment.

- Recover in ParseImplicitInt instead


http://reviews.llvm.org/D20500

Files:
  include/clang/Sema/Sema.h
  lib/Parse/ParseDecl.cpp
  lib/Sema/SemaDecl.cpp
  test/SemaTemplate/ms-delayed-default-template-args.cpp
  test/SemaTemplate/ms-lookup-template-base-classes.cpp

Index: test/SemaTemplate/ms-lookup-template-base-classes.cpp
===
--- test/SemaTemplate/ms-lookup-template-base-classes.cpp
+++ test/SemaTemplate/ms-lookup-template-base-classes.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++1y -fms-compatibility -fno-spell-checking -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++1y -fms-compatibility -fno-spell-checking -fsyntax-only -verify %s
 
 
 template 
@@ -573,3 +573,33 @@
 template  decltype(h(T())) check2(); // expected-note{{candidate template ignored: substitution failure [with T = int]: no matching function for call to 'h'}}
 decltype(check2()) y; // expected-error{{no matching function for call to 'check2'}}
 }
+
+// We also allow unqualified lookup into bases in contexts where the we know the
+// undeclared identifier *must* be a type, such as a new expression or catch
+// parameter type.
+template 
+struct UseUnqualifiedTypeNames : T {
+  void foo() {
+void *P = new TheType; // expected-warning {{unqualified lookup}} expected-error {{no type}}
+size_t x = __builtin_offsetof(TheType, f2); // expected-warning {{unqualified lookup}} expected-error {{no type}}
+try {
+} catch (TheType) { // expected-warning {{unqualified lookup}} expected-error {{no type}}
+}
+enum E : IntegerType { E0 = 42 }; // expected-warning {{unqualified lookup}} expected-error {{no type}}
+_Atomic(TheType) a; // expected-warning {{unqualified lookup}} expected-error {{no type}}
+  }
+  void out_of_line();
+};
+template 
+void UseUnqualifiedTypeNames::out_of_line() {
+  void *p = new TheType; // expected-warning {{unqualified lookup}} expected-error {{no type}}
+}
+struct Base {
+  typedef int IntegerType;
+  struct TheType {
+int f1, f2;
+  };
+};
+template struct UseUnqualifiedTypeNames;
+struct BadBase { };
+template struct UseUnqualifiedTypeNames; // expected-note-re 2 {{in instantiation {{.*}} requested here}}
Index: test/SemaTemplate/ms-delayed-default-template-args.cpp
===
--- test/SemaTemplate/ms-delayed-default-template-args.cpp
+++ test/SemaTemplate/ms-delayed-default-template-args.cpp
@@ -55,6 +55,15 @@
 typedef int Weber;
 }
 
+// MSVC accepts this, but Clang doesn't.
+namespace test_scope_spec {
+template   // expected-error {{use of undeclared identifier 'ns'}}
+struct Foo {
+  static_assert(sizeof(T) == 4, "Bar should have gotten int");
+};
+namespace ns { typedef int Bar; }
+}
+
 #ifdef __clang__
 // These are negative test cases that MSVC doesn't compile either.  Try to use
 // unique undeclared identifiers so typo correction doesn't find types declared
Index: lib/Sema/SemaDecl.cpp
===
--- lib/Sema/SemaDecl.cpp
+++ lib/Sema/SemaDecl.cpp
@@ -475,6 +475,8 @@
 
 ParsedType Sema::ActOnDelayedDefaultTemplateArg(const IdentifierInfo &II,
 SourceLocation NameLoc) {
+  assert(getLangOpts().MSVCCompat && "shouldn't be called in non-MSVC mode");
+
   // Accepting an undeclared identifier as a default argument for a template
   // type parameter is a Microsoft extension.
   Diag(NameLoc, diag::ext_ms_delayed_template_argument) << &II;
@@ -500,6 +502,55 @@
   return CreateParsedType(T, Builder.getTypeSourceInfo(Context, T));
 }
 
+/// Find the parent class with dependent bases of the innermost enclosing method
+/// context. Do not look for enclosing CXXRecordDecls directly, or we will end
+/// up allowing unqualified dependent type names at class-level, which MSVC
+/// correctly rejects.
+static const CXXRecordDecl *
+findRecordWithDependentBasesOfEnclosingMethod(const DeclContext *DC) {
+  for (; DC && DC->isDependentContext(); DC = DC->getLookupParent()) {
+DC = DC->getPrimaryContext();
+if (const auto *MD = dyn_cast(DC))
+  if (MD->getParent()->hasAnyDependentBases())
+return MD->getParent();
+  }
+  return nullptr;
+}
+
+ParsedType Sema::ActOnMSVCUnknownTypeName(const IdentifierInfo &II,
+  SourceLocation NameLoc) {
+  assert(getLangOpts().MSVCCompat && "shouldn't be called in non-MSVC mode");
+
+  const CXXRecordDecl *RD =
+  findRecordWithDependentBasesOfEnclosingMethod(CurContext);
+  if (!RD)
+return ParsedType();
+
+  // Diagnose that this identifier was undeclared, and retry the lookup during
+  // template instantiation.
+  Diag(NameLoc, diag::ext_undeclared_unqual_id_with_dependent_base) << &II
+<< RD;
+
+  //

[clang-tools-extra] r270470 - Commiting for http://reviews.llvm.org/D20365

2016-05-23 Thread Mads Ravn via cfe-commits
Author: madsravn
Date: Mon May 23 13:06:29 2016
New Revision: 270470

URL: http://llvm.org/viewvc/llvm-project?rev=270470&view=rev
Log:
Commiting for http://reviews.llvm.org/D20365

Modified:
clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp

Modified: clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp?rev=270470&r1=270469&r2=270470&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp Mon May 
23 13:06:29 2016
@@ -188,6 +188,10 @@ void MacroParenthesesPPCallbacks::argume
 if (Prev.is(tok::kw_namespace))
   continue;
 
+// Variadic templates
+if (MI->isVariadic())
+  continue;
+
 Check->diag(Tok.getLocation(), "macro argument should be enclosed in "
"parentheses")
 << FixItHint::CreateInsertion(Tok.getLocation(), "(")

Modified: clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp?rev=270470&r1=270469&r2=270470&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-macro-parentheses.cpp Mon May 
23 13:06:29 2016
@@ -37,6 +37,8 @@
 #define GOOD26(x) (a->*x)
 #define GOOD27(x) (a.*x)
 #define GOOD28(x) namespace x {int b;}
+#define GOOD29(...)   std::cout << __VA_ARGS__;
+#define GOOD30(args...)   std::cout << args;
 
 // These are allowed for now..
 #define MAYBE1*12.34


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20383: PCH + Module: make sure we write out macros associated with builtin identifiers

2016-05-23 Thread Ben Langmuir via cfe-commits
benlangmuir added a subscriber: doug.gregor.
benlangmuir added a comment.

I'd like to see Doug and/or Richard review this.  It seems reasonable to me to 
first blush, but I assume there was a good reason we weren't doing this 
already...


http://reviews.llvm.org/D20383



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] r270472 - Commiting for http://reviews.llvm.org/D20365

2016-05-23 Thread Mads Ravn via cfe-commits
Author: madsravn
Date: Mon May 23 13:15:40 2016
New Revision: 270472

URL: http://llvm.org/viewvc/llvm-project?rev=270472&view=rev
Log:
Commiting for http://reviews.llvm.org/D20365

Modified:
clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp?rev=270472&r1=270471&r2=270472&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Mon May 
23 13:15:40 2016
@@ -181,6 +181,12 @@ void PassByValueCheck::check(const Match
   if (!paramReferredExactlyOnce(Ctor, ParamDecl))
 return;
 
+
+  // If the parameter is trivial to copy, don't move it. Moving a trivivally
+  // copyable type will cause a problem with modernize-pass-by-value
+  if (ParamDecl->getType().isTriviallyCopyableType(*Result.Context)) 
+return;
+
   auto Diag = diag(ParamDecl->getLocStart(), "pass by value and use 
std::move");
 
   // Iterate over all declarations of the constructor.

Modified: clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp?rev=270472&r1=270471&r2=270472&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp Mon May 
23 13:15:40 2016
@@ -194,3 +194,9 @@ struct S {
   Movable M;
 };
 
+// Test that types that are trivially copyable will not use std::move. This 
will
+// cause problems with misc-move-const-arg, as it will revert it.
+struct T {
+  std::array a_;
+  T(std::array a) : a_(a) {}
+};


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20365: [PATCH] clang-tidy: Bug 27731 - modernize-pass-by-value suggest using std::move for types that perform copies on move

2016-05-23 Thread Mads Ravn via cfe-commits
madsravn closed this revision.
madsravn added a comment.

Code committed.


http://reviews.llvm.org/D20365



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20493: [CUDA] Add -fcuda-approx-transcendentals flag.

2016-05-23 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 58123.
jlebar added a comment.

More tightly scope the __USE_FAST_MATH__ macro.

tra pointed out that device_functions.hpp uses __USE_FAST_MATH__ for its own
purposes.  For this CL, we only want to define __USE_FAST_MATH__ around
math_functions.hpp.


http://reviews.llvm.org/D20493

Files:
  include/clang/Basic/LangOptions.def
  include/clang/Driver/Options.td
  lib/Driver/ToolChains.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Frontend/InitPreprocessor.cpp
  lib/Headers/__clang_cuda_runtime_wrapper.h
  test/Preprocessor/cuda-approx-transcendentals.cu

Index: test/Preprocessor/cuda-approx-transcendentals.cu
===
--- /dev/null
+++ test/Preprocessor/cuda-approx-transcendentals.cu
@@ -0,0 +1,8 @@
+// RUN: %clang --cuda-host-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix HOST %s
+// RUN: %clang --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-NOFAST %s
+// RUN: %clang -fcuda-approx-transcendentals --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s
+// RUN: %clang -ffast-math --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s
+
+// HOST-NOT: __CLANG_CUDA_APPROX_TRANSCENDENTALS__
+// DEVICE-NOFAST-NOT: __CLANG_CUDA_APPROX_TRANSCENDENTALS__
+// DEVICE-FAST: __CLANG_CUDA_APPROX_TRANSCENDENTALS__
Index: lib/Headers/__clang_cuda_runtime_wrapper.h
===
--- lib/Headers/__clang_cuda_runtime_wrapper.h
+++ lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -142,7 +142,20 @@
 #pragma push_macro("__forceinline__")
 #define __forceinline__ __device__ __inline__ __attribute__((always_inline))
 #include "device_functions.hpp"
+
+// math_function.hpp uses the __USE_FAST_MATH__ macro to determine whether we
+// get the slow-but-accurate or fast-but-inaccurate versions of functions like
+// sin and exp.  This is controlled in clang by -fcuda-approx-transcendentals.
+//
+// device_functions.hpp uses __USE_FAST_MATH__ for a different purpose (fast vs.
+// slow divides), so we need to scope our define carefully here.
+#pragma push_macro("__USE_FAST_MATH__")
+#if defined(__CLANG_CUDA_APPROX_TRANSCENDENTALS__)
+#define __USE_FAST_MATH__
+#endif
 #include "math_functions.hpp"
+#pragma pop_macro("__USE_FAST_MATH__")
+
 #include "math_functions_dbl_ptx3.hpp"
 #pragma pop_macro("__forceinline__")
 
@@ -296,6 +309,7 @@
 #include "curand_mtgp32_kernel.h"
 #pragma pop_macro("dim3")
 #pragma pop_macro("uint3")
+#pragma pop_macro("__USE_FAST_MATH__")
 
 #endif // __CUDA__
 #endif // __CLANG_CUDA_RUNTIME_WRAPPER_H__
Index: lib/Frontend/InitPreprocessor.cpp
===
--- lib/Frontend/InitPreprocessor.cpp
+++ lib/Frontend/InitPreprocessor.cpp
@@ -938,6 +938,12 @@
 Builder.defineMacro("__CUDA_ARCH__");
   }
 
+  // We need to communicate this to our CUDA header wrapper, which in turn
+  // informs the proper CUDA headers of this choice.
+  if (LangOpts.CUDADeviceApproxTranscendentals || LangOpts.FastMath) {
+Builder.defineMacro("__CLANG_CUDA_APPROX_TRANSCENDENTALS__");
+  }
+
   // OpenCL definitions.
   if (LangOpts.OpenCL) {
 #define OPENCLEXT(Ext) \
Index: lib/Frontend/CompilerInvocation.cpp
===
--- lib/Frontend/CompilerInvocation.cpp
+++ lib/Frontend/CompilerInvocation.cpp
@@ -1616,6 +1616,9 @@
   if (Opts.CUDAIsDevice && Args.hasArg(OPT_fcuda_flush_denormals_to_zero))
 Opts.CUDADeviceFlushDenormalsToZero = 1;
 
+  if (Opts.CUDAIsDevice && Args.hasArg(OPT_fcuda_approx_transcendentals))
+Opts.CUDADeviceApproxTranscendentals = 1;
+
   if (Opts.ObjC1) {
 if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
   StringRef value = arg->getValue();
Index: lib/Driver/ToolChains.cpp
===
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -4285,6 +4285,10 @@
  options::OPT_fno_cuda_flush_denormals_to_zero, false))
 CC1Args.push_back("-fcuda-flush-denormals-to-zero");
 
+  if (DriverArgs.hasFlag(options::OPT_fcuda_approx_transcendentals,
+ options::OPT_fno_cuda_approx_transcendentals, false))
+CC1Args.push_back("-fcuda-approx-transcendentals");
+
   if (DriverArgs.hasArg(options::OPT_nocudalib))
 return;
 
Index: include/clang/Driver/Options.td
===
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -395,6 +395,9 @@
 def fcuda_flush_denormals_to_zero : Flag<["-"], "fcuda-flush-denormals-to-zero">,
   Flags<[CC1Option]>, HelpText<"Flush denor

[clang-tools-extra] r270473 - Commiting for http://reviews.llvm.org/D20365

2016-05-23 Thread Mads Ravn via cfe-commits
Author: madsravn
Date: Mon May 23 13:27:05 2016
New Revision: 270473

URL: http://llvm.org/viewvc/llvm-project?rev=270473&view=rev
Log:
Commiting for http://reviews.llvm.org/D20365

Modified:
clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp?rev=270473&r1=270472&r2=270473&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Mon May 
23 13:27:05 2016
@@ -181,12 +181,6 @@ void PassByValueCheck::check(const Match
   if (!paramReferredExactlyOnce(Ctor, ParamDecl))
 return;
 
-
-  // If the parameter is trivial to copy, don't move it. Moving a trivivally
-  // copyable type will cause a problem with modernize-pass-by-value
-  if (ParamDecl->getType().isTriviallyCopyableType(*Result.Context)) 
-return;
-
   auto Diag = diag(ParamDecl->getLocStart(), "pass by value and use 
std::move");
 
   // Iterate over all declarations of the constructor.

Modified: clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp?rev=270473&r1=270472&r2=270473&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp Mon May 
23 13:27:05 2016
@@ -193,10 +193,3 @@ struct S {
   // CHECK-FIXES: S(Movable &&M) : M(M) {}
   Movable M;
 };
-
-// Test that types that are trivially copyable will not use std::move. This 
will
-// cause problems with misc-move-const-arg, as it will revert it.
-struct T {
-  std::array a_;
-  T(std::array a) : a_(a) {}
-};


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20493: [CUDA] Add -fcuda-approx-transcendentals flag.

2016-05-23 Thread Artem Belevich via cfe-commits
tra added a comment.

LGTM.


http://reviews.llvm.org/D20493



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20404: [Driver] Fix driver support for color diagnostics

2016-05-23 Thread Bruno Cardoso Lopes via cfe-commits
bruno added a comment.

Ping!


http://reviews.llvm.org/D20404



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang-tools-extra] r270472 - Commiting for http://reviews.llvm.org/D20365

2016-05-23 Thread Nico Weber via cfe-commits
Next time, please use real commit messages: Describe what the change does,
and why it's being done. Include a link to the review link at the end of
the commit message. If every change just had a phab link as commit message,
people bisecting changes would have to click through for every change in
`svn log` output.

On Mon, May 23, 2016 at 2:15 PM, Mads Ravn via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: madsravn
> Date: Mon May 23 13:15:40 2016
> New Revision: 270472
>
> URL: http://llvm.org/viewvc/llvm-project?rev=270472&view=rev
> Log:
> Commiting for http://reviews.llvm.org/D20365
>
> Modified:
> clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
> clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
>
> Modified: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp?rev=270472&r1=270471&r2=270472&view=diff
>
> ==
> --- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Mon
> May 23 13:15:40 2016
> @@ -181,6 +181,12 @@ void PassByValueCheck::check(const Match
>if (!paramReferredExactlyOnce(Ctor, ParamDecl))
>  return;
>
> +
> +  // If the parameter is trivial to copy, don't move it. Moving a
> trivivally
> +  // copyable type will cause a problem with modernize-pass-by-value
> +  if (ParamDecl->getType().isTriviallyCopyableType(*Result.Context))
> +return;
> +
>auto Diag = diag(ParamDecl->getLocStart(), "pass by value and use
> std::move");
>
>// Iterate over all declarations of the constructor.
>
> Modified:
> clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp?rev=270472&r1=270471&r2=270472&view=diff
>
> ==
> --- clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
> Mon May 23 13:15:40 2016
> @@ -194,3 +194,9 @@ struct S {
>Movable M;
>  };
>
> +// Test that types that are trivially copyable will not use std::move.
> This will
> +// cause problems with misc-move-const-arg, as it will revert it.
> +struct T {
> +  std::array a_;
> +  T(std::array a) : a_(a) {}
> +};
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20451: [Parser] Fix look ahead after EOF while parsing objc message and lambdas

2016-05-23 Thread Bruno Cardoso Lopes via cfe-commits
bruno added a comment.

Ping!


http://reviews.llvm.org/D20451



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20447: [OpenCL] Fixup extension list

2016-05-23 Thread Jan Vesely via cfe-commits
jvesely retitled this revision from "[OpenCL] cl_khr_msaa_sharing is OpenCL1.2 
extension" to "[OpenCL] Fixup extension list".
jvesely added a subscriber: cfe-commits.
jvesely updated this revision to Diff 58130.
jvesely added a comment.

I went through the specs and fixed up all I could find.
added test


Repository:
  rL LLVM

http://reviews.llvm.org/D20447

Files:
  include/clang/Basic/OpenCLExtensions.def
  test/SemaOpenCL/extension-version.cl

Index: test/SemaOpenCL/extension-version.cl
===
--- /dev/null
+++ test/SemaOpenCL/extension-version.cl
@@ -0,0 +1,168 @@
+// RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple spir-unknown-unknown
+// RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple spir-unknown-unknown
+// RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple spir-unknown-unknown
+// RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple spir-unknown-unknown
+// expected-no-diagnostics
+
+// Extensions in all versions
+#ifndef cl_clang_storage_class_specifiers
+#error "Missing cl_clang_storage_class_specifiers define"
+#endif
+#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers: enable
+
+#ifndef cl_khr_fp16
+#error "Missing cl_khr_fp16 define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_fp16: enable
+
+#ifndef cl_khr_int64_base_atomics
+#error "Missing cl_khr_int64_base_atomics define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_int64_base_atomics: enable
+
+#ifndef cl_khr_int64_extended_atomics
+#error "Missing cl_khr_int64_extended_atomics define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_int64_extended_atomics: enable
+
+#ifndef cl_khr_gl_sharing
+#error "Missing cl_khr_gl_sharing define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_gl_sharing: enable
+
+#ifndef cl_khr_icd
+#error "Missing cl_khr_icd define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_icd: enable
+
+// COre features in CL 1.1
+#if (__OPENCL_C_VERSION__ < 110)
+#ifndef cl_khr_byte_addressable_store
+#error "Missing cl_khr_byte_addressable_store define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_byte_addressable_store: enable
+
+#ifndef cl_khr_global_int32_base_atomics
+#error "Missing cl_khr_global_int32_base_atomics define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics: enable
+
+#ifndef cl_khr_global_int32_extended_atomics
+#error "Missing cl_khr_global_int32_extended_atomics define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_global_int32_extended_atomics: enable
+
+#ifndef cl_khr_local_int32_base_atomics
+#error "Missing cl_khr_local_int32_base_atomics define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics: enable
+
+#ifndef cl_khr_local_int32_extended_atomics
+#error "Missing cl_khr_local_int32_extended_atomics define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_local_int32_extended_atomics: enable
+
+#ifndef cl_khr_select_fprounding_mode
+#error "Missing cl_khr_select_fp_rounding_mode define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_select_fprounding_mode: enable
+
+#endif
+
+// Core feature in CL 1.2
+#if (__OPENCL_C_VERSION__ < 120)
+#ifndef cl_khr_fp64
+#error "Missing cl_khr_fp64 define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_fp64: enable
+#endif
+
+//Core feature in CL 2.0
+#if (__OPENCL_C_VERSION__ < 200)
+#ifndef cl_khr_3d_image_writes
+#error "Missing cl_khr_3d_image_writes define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_3d_image_writes: enable
+#endif
+
+
+#if (__OPENCL_C_VERSION__ >= 110)
+#ifndef cl_khr_gl_event
+#error "Missing cl_khr_gl_event define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_gl_event: enable
+
+#ifndef cl_khr_d3d10_sharing
+#error "Missing cl_khr_d3d10_sharing define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_d3d10_sharing: enable
+#endif
+
+#if (__OPENCL_C_VERSION__ >= 120)
+#ifndef cl_khr_context_abort
+#error "Missing cl_context_abort define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_context_abort: enable
+
+#ifndef cl_khr_d3d11_sharing
+#error "Missing cl_khr_d3d11_sharing define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_d3d10_sharing: enable
+
+#ifndef cl_khr_dx9_media_sharing
+#error "Missing cl_khr_dx9_media_sharing define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_dx9_media_sharing: enable
+
+#ifndef cl_khr_image2d_from_buffer
+#error "Missing cl_khr_image2d_from_buffer define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_image2d_from_buffer: enable
+
+#ifndef cl_khr_initialize_memory
+#error "Missing cl_khr_initialize_memory define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_initialize_memory: enable
+
+#ifndef cl_khr_gl_depth_images
+#error "Missing cl_khr_gl_depth_images define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_gl_depth_images: enable
+
+#ifndef cl_khr_gl_msaa_sharing
+#error "Missing cl_khr_gl_msaa_sharing define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing: enable
+
+#ifndef cl_khr_spir
+#error "Missing cl_khr_spir define"
+#endif
+#pragma OPENCL EXTENSION cl_khr_spir: enable
+#endif
+
+#if (__OPENCL_C_VERSION__ >= 200)
+#ifndef cl_khr_egl_event
+#error "Missing cl_kh

Re: [PATCH] D20500: [ms] Allow more unqualified lookup of types in dependent base classes

2016-05-23 Thread Richard Smith via cfe-commits
rsmith added inline comments.


Comment at: include/clang/Sema/Sema.h:1536-1537
@@ -1535,3 +1535,4 @@
   /// other template arguments.
   ParsedType ActOnDelayedDefaultTemplateArg(const IdentifierInfo &II,
 SourceLocation NameLoc);
+  ParsedType ActOnMSVCUnknownTypeName(const IdentifierInfo &II,

Can you remove this now, along with the corresponding recovery path in the 
parser? The new recovery path seems like it should be able to cover a superset 
of cases.


Comment at: lib/Sema/SemaDecl.cpp:524-527
@@ +523,6 @@
+
+  const CXXRecordDecl *RD =
+  findRecordWithDependentBasesOfEnclosingMethod(CurContext);
+  if (!RD)
+return ParsedType();
+

Instead of doing this, could you `synthesizeCurrentNestedNameSpecifier` as 
`ActOnDelayedDefaultTemplateArg` does, and just check for the existence of a 
dependent base class here? That way you should do the right thing even if there 
are multiple dependent base classes.


http://reviews.llvm.org/D20500



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D20537: clang-rename: fix renaming non-members variables when referenced as macro arguments

2016-05-23 Thread Miklos Vajna via cfe-commits
vmiklos created this revision.
vmiklos added reviewers: klimek, cfe-commits.

The second check failed, FOO(C::X) wasn't renamed to FOO(C::Y).

http://reviews.llvm.org/D20537

Files:
  clang-rename/USRLocFinder.cpp
  test/clang-rename/DeclRefExpr.cpp

Index: test/clang-rename/DeclRefExpr.cpp
===
--- /dev/null
+++ test/clang-rename/DeclRefExpr.cpp
@@ -0,0 +1,24 @@
+// RUN: cat %s > %t.cpp
+// RUN: clang-rename -offset=158 -new-name=Y %t.cpp -i --
+// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
+class C
+{
+public:
+  static int X;
+};
+
+int foo(int x)
+{
+  return 0;
+}
+#define FOO(a) foo(a)
+
+int main()
+{
+  C::X = 1; // CHECK: C::Y
+  FOO(C::X); // CHECK: C::Y
+  int y = C::X; // CHECK: C::Y
+}
+
+// Use grep -FUbo 'X'  to get the correct offset of foo when changing
+// this file.
Index: clang-rename/USRLocFinder.cpp
===
--- clang-rename/USRLocFinder.cpp
+++ clang-rename/USRLocFinder.cpp
@@ -94,7 +94,9 @@
 
 checkNestedNameSpecifierLoc(Expr->getQualifierLoc());
 if (getUSRForDecl(Decl) == USR) {
-  LocationsFound.push_back(Expr->getLocation());
+  const SourceManager &Manager = Decl->getASTContext().getSourceManager();
+  SourceLocation Location = Manager.getSpellingLoc(Expr->getLocation());
+  LocationsFound.push_back(Location);
 }
 
 return true;


Index: test/clang-rename/DeclRefExpr.cpp
===
--- /dev/null
+++ test/clang-rename/DeclRefExpr.cpp
@@ -0,0 +1,24 @@
+// RUN: cat %s > %t.cpp
+// RUN: clang-rename -offset=158 -new-name=Y %t.cpp -i --
+// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
+class C
+{
+public:
+  static int X;
+};
+
+int foo(int x)
+{
+  return 0;
+}
+#define FOO(a) foo(a)
+
+int main()
+{
+  C::X = 1; // CHECK: C::Y
+  FOO(C::X); // CHECK: C::Y
+  int y = C::X; // CHECK: C::Y
+}
+
+// Use grep -FUbo 'X'  to get the correct offset of foo when changing
+// this file.
Index: clang-rename/USRLocFinder.cpp
===
--- clang-rename/USRLocFinder.cpp
+++ clang-rename/USRLocFinder.cpp
@@ -94,7 +94,9 @@
 
 checkNestedNameSpecifierLoc(Expr->getQualifierLoc());
 if (getUSRForDecl(Decl) == USR) {
-  LocationsFound.push_back(Expr->getLocation());
+  const SourceManager &Manager = Decl->getASTContext().getSourceManager();
+  SourceLocation Location = Manager.getSpellingLoc(Expr->getLocation());
+  LocationsFound.push_back(Location);
 }
 
 return true;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Simon Pilgrim via cfe-commits
RKSimon added a comment.

In http://reviews.llvm.org/D20528#436893, @mkuper wrote:

> This looks right, but we may lose some end-to-end tests, since right now we 
> have a clang-level test that checks the builtin is lowered to the intrinsic, 
> and (hopefully) a CG-level test that the intrinsic is lowered to the correct 
> instruction.
>  Do you know if there are already CG tests that check we correctly lower 
> these IR patterns to CVTPS2PD, etc? If not, could you add them?


I do have the relevant changes for 
llvm\test\CodeGen\X86\sse2-intrinsics-fast-isel.ll and 
llvm\test\CodeGen\X86\avx-intrinsics-fast-isel.ll (I spent most of last week 
adding them all.). Do you want me to setup a separate llvm patch for 
review? I'm not ready to do the rest of the llvm work (removal of the llvm 
intrinsics / auto-upgrade etc.). but the fast-isel changes are very simple.



Comment at: lib/Headers/emmintrin.h:390
@@ -390,1 +389,3 @@
+  return (__m128d) __builtin_convertvector(
+  __builtin_shufflevector((__v4sf __a, (__v4sf)__a, 0, 1), __v2df);
 }

mkuper wrote:
> It looks like there's a missing paren after the first __v4sf.
> How does the test compile? Or am I misreading?
Sorry, that's me 'fixing' clang-format which I stupidly forgot to run until 
just before submission.


Repository:
  rL LLVM

http://reviews.llvm.org/D20528



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r270482 - Fix filtering of prior declarations when checking for a tag redeclaration to

2016-05-23 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Mon May 23 15:03:04 2016
New Revision: 270482

URL: http://llvm.org/viewvc/llvm-project?rev=270482&view=rev
Log:
Fix filtering of prior declarations when checking for a tag redeclaration to
map to the redecl context for both decls, not just one of them, and to properly
check that the decl contexts are equivalent.

Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/test/SemaCXX/extern-c.cpp
cfe/trunk/test/SemaCXX/friend.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=270482&r1=270481&r2=270482&view=diff
==
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon May 23 15:03:04 2016
@@ -12338,7 +12338,8 @@ Decl *Sema::ActOnTag(Scope *S, unsigned
   LookupResult::Filter F = Previous.makeFilter();
   while (F.hasNext()) {
 NamedDecl *ND = F.next();
-if (ND->getDeclContext()->getRedeclContext() != SearchDC)
+if (!ND->getDeclContext()->getRedeclContext()->Equals(
+SearchDC->getRedeclContext()))
   F.erase();
   }
   F.done();

Modified: cfe/trunk/test/SemaCXX/extern-c.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/extern-c.cpp?rev=270482&r1=270481&r2=270482&view=diff
==
--- cfe/trunk/test/SemaCXX/extern-c.cpp (original)
+++ cfe/trunk/test/SemaCXX/extern-c.cpp Mon May 23 15:03:04 2016
@@ -204,3 +204,41 @@ extern "C" {
   struct pr5065_n6 : public virtual pr5065_3 {};
 }
 struct pr5065_n7 {};
+
+namespace tag_hiding {
+  namespace namespace_with_injected_name {
+class Boo {
+  friend struct ExternCStruct1;
+};
+void ExternCStruct4(); // expected-note 2{{candidate}}
+  }
+
+  class Baz {
+friend struct ExternCStruct2;
+friend void ExternCStruct3();
+  };
+
+  using namespace namespace_with_injected_name;
+
+  extern "C" {
+struct ExternCStruct1;
+struct ExternCStruct2;
+struct ExternCStruct3;
+struct ExternCStruct4; // expected-note {{candidate}}
+  }
+  ExternCStruct1 *p1;
+  ExternCStruct2 *p2;
+  ExternCStruct3 *p3;
+  ExternCStruct4 *p4; // expected-error {{ambiguous}}
+
+  extern "C" {
+struct ExternCStruct1;
+struct ExternCStruct2;
+struct ExternCStruct3;
+struct ExternCStruct4; // expected-note {{candidate}}
+  }
+  ExternCStruct1 *q1 = p1;
+  ExternCStruct2 *q2 = p2;
+  ExternCStruct3 *q3 = p3;
+  ExternCStruct4 *q4 = p4; // expected-error {{ambiguous}}
+}

Modified: cfe/trunk/test/SemaCXX/friend.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/friend.cpp?rev=270482&r1=270481&r2=270482&view=diff
==
--- cfe/trunk/test/SemaCXX/friend.cpp (original)
+++ cfe/trunk/test/SemaCXX/friend.cpp Mon May 23 15:03:04 2016
@@ -363,3 +363,17 @@ void g_pr6954() {
   f_pr6954(5); // expected-error{{undeclared identifier 'f_pr6954'}}
 }
 
+namespace tag_redecl {
+  namespace N {
+struct X *p;
+namespace {
+  class K {
+friend struct X;
+  };
+}
+  }
+  namespace N {
+struct X;
+X *q = p;
+  }
+}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20192: [Sema] Fix bug to do with lookup of template friend function in namespace

2016-05-23 Thread Erik Pilkington via cfe-commits
erik.pilkington added a comment.

Ping!!


http://reviews.llvm.org/D20192



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Michael Kuperstein via cfe-commits
mkuper added a comment.

In http://reviews.llvm.org/D20528#437090, @RKSimon wrote:

> In http://reviews.llvm.org/D20528#436893, @mkuper wrote:
>
> > This looks right, but we may lose some end-to-end tests, since right now we 
> > have a clang-level test that checks the builtin is lowered to the 
> > intrinsic, and (hopefully) a CG-level test that the intrinsic is lowered to 
> > the correct instruction.
> >  Do you know if there are already CG tests that check we correctly lower 
> > these IR patterns to CVTPS2PD, etc? If not, could you add them?
>
>
> I do have the relevant changes for 
> llvm\test\CodeGen\X86\sse2-intrinsics-fast-isel.ll and 
> llvm\test\CodeGen\X86\avx-intrinsics-fast-isel.ll (I spent most of last week 
> adding them all.). Do you want me to setup a separate llvm patch for 
> review? I'm not ready to do the rest of the llvm work (removal of the llvm 
> intrinsics / auto-upgrade etc.). but the fast-isel changes are very simple.


Sorry, I didn't intend to imply the rest of the llvm work is necessary for this 
to go in. Just that I'd be happier with this patch knowing that we have a 
regression test for doing the (shuffle + fpext, say) lowering correctly. I 
didn't even mean fast-isel, only the DAG.


Repository:
  rL LLVM

http://reviews.llvm.org/D20528



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r270484 - [CUDA] Add -fcuda-approx-transcendentals flag.

2016-05-23 Thread Justin Lebar via cfe-commits
Author: jlebar
Date: Mon May 23 15:19:56 2016
New Revision: 270484

URL: http://llvm.org/viewvc/llvm-project?rev=270484&view=rev
Log:
[CUDA] Add -fcuda-approx-transcendentals flag.

Summary:
This lets us emit e.g. sin.approx.f32.  See
http://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sin

Reviewers: rnk

Subscribers: tra, cfe-commits

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

Added:
cfe/trunk/test/Preprocessor/cuda-approx-transcendentals.cu
Modified:
cfe/trunk/include/clang/Basic/LangOptions.def
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h

Modified: cfe/trunk/include/clang/Basic/LangOptions.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=270484&r1=270483&r2=270484&view=diff
==
--- cfe/trunk/include/clang/Basic/LangOptions.def (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.def Mon May 23 15:19:56 2016
@@ -190,6 +190,7 @@ LANGOPT(CUDAIsDevice  , 1, 0, "compi
 LANGOPT(CUDAAllowVariadicFunctions, 1, 0, "allowing variadic functions in CUDA 
device code")
 LANGOPT(CUDAHostDeviceConstexpr, 1, 1, "treating unattributed constexpr 
functions as __host__ __device__")
 LANGOPT(CUDADeviceFlushDenormalsToZero, 1, 0, "flushing denormals to zero")
+LANGOPT(CUDADeviceApproxTranscendentals, 1, 0, "using approximate 
transcendental functions")
 
 LANGOPT(SizedDeallocation , 1, 0, "enable sized deallocation functions")
 LANGOPT(ConceptsTS , 1, 0, "enable C++ Extensions for Concepts")

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=270484&r1=270483&r2=270484&view=diff
==
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon May 23 15:19:56 2016
@@ -395,6 +395,9 @@ def cuda_path_EQ : Joined<["--"], "cuda-
 def fcuda_flush_denormals_to_zero : Flag<["-"], 
"fcuda-flush-denormals-to-zero">,
   Flags<[CC1Option]>, HelpText<"Flush denormal floating point values to zero 
in CUDA device mode.">;
 def fno_cuda_flush_denormals_to_zero : Flag<["-"], 
"fno-cuda-flush-denormals-to-zero">;
+def fcuda_approx_transcendentals : Flag<["-"], "fcuda-approx-transcendentals">,
+  Flags<[CC1Option]>, HelpText<"Use approximate transcendental functions">;
+def fno_cuda_approx_transcendentals : Flag<["-"], 
"fno-cuda-approx-transcendentals">;
 def dA : Flag<["-"], "dA">, Group;
 def dD : Flag<["-"], "dD">, Group, Flags<[CC1Option]>,
   HelpText<"Print macro definitions in -E mode in addition to normal output">;

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=270484&r1=270483&r2=270484&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Mon May 23 15:19:56 2016
@@ -4502,6 +4502,10 @@ CudaToolChain::addClangTargetOptions(con
  options::OPT_fno_cuda_flush_denormals_to_zero, false))
 CC1Args.push_back("-fcuda-flush-denormals-to-zero");
 
+  if (DriverArgs.hasFlag(options::OPT_fcuda_approx_transcendentals,
+ options::OPT_fno_cuda_approx_transcendentals, false))
+CC1Args.push_back("-fcuda-approx-transcendentals");
+
   if (DriverArgs.hasArg(options::OPT_nocudalib))
 return;
 

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=270484&r1=270483&r2=270484&view=diff
==
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon May 23 15:19:56 2016
@@ -1616,6 +1616,9 @@ static void ParseLangArgs(LangOptions &O
   if (Opts.CUDAIsDevice && Args.hasArg(OPT_fcuda_flush_denormals_to_zero))
 Opts.CUDADeviceFlushDenormalsToZero = 1;
 
+  if (Opts.CUDAIsDevice && Args.hasArg(OPT_fcuda_approx_transcendentals))
+Opts.CUDADeviceApproxTranscendentals = 1;
+
   if (Opts.ObjC1) {
 if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
   StringRef value = arg->getValue();

Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=270484&r1=270483&r2=270484&view=diff
==
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Mon May 23 15:19:56 2016
@@ -938,6 +938

Re: [PATCH] D20493: [CUDA] Add -fcuda-approx-transcendentals flag.

2016-05-23 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL270484: [CUDA] Add -fcuda-approx-transcendentals flag. 
(authored by jlebar).

Changed prior to commit:
  http://reviews.llvm.org/D20493?vs=58123&id=58145#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20493

Files:
  cfe/trunk/include/clang/Basic/LangOptions.def
  cfe/trunk/include/clang/Driver/Options.td
  cfe/trunk/lib/Driver/ToolChains.cpp
  cfe/trunk/lib/Frontend/CompilerInvocation.cpp
  cfe/trunk/lib/Frontend/InitPreprocessor.cpp
  cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
  cfe/trunk/test/Preprocessor/cuda-approx-transcendentals.cu

Index: cfe/trunk/test/Preprocessor/cuda-approx-transcendentals.cu
===
--- cfe/trunk/test/Preprocessor/cuda-approx-transcendentals.cu
+++ cfe/trunk/test/Preprocessor/cuda-approx-transcendentals.cu
@@ -0,0 +1,8 @@
+// RUN: %clang --cuda-host-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix HOST %s
+// RUN: %clang --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-NOFAST %s
+// RUN: %clang -fcuda-approx-transcendentals --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s
+// RUN: %clang -ffast-math --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s
+
+// HOST-NOT: __CLANG_CUDA_APPROX_TRANSCENDENTALS__
+// DEVICE-NOFAST-NOT: __CLANG_CUDA_APPROX_TRANSCENDENTALS__
+// DEVICE-FAST: __CLANG_CUDA_APPROX_TRANSCENDENTALS__
Index: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
===
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp
@@ -938,6 +938,12 @@
 Builder.defineMacro("__CUDA_ARCH__");
   }
 
+  // We need to communicate this to our CUDA header wrapper, which in turn
+  // informs the proper CUDA headers of this choice.
+  if (LangOpts.CUDADeviceApproxTranscendentals || LangOpts.FastMath) {
+Builder.defineMacro("__CLANG_CUDA_APPROX_TRANSCENDENTALS__");
+  }
+
   // OpenCL definitions.
   if (LangOpts.OpenCL) {
 #define OPENCLEXT(Ext) \
Index: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
===
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp
@@ -1616,6 +1616,9 @@
   if (Opts.CUDAIsDevice && Args.hasArg(OPT_fcuda_flush_denormals_to_zero))
 Opts.CUDADeviceFlushDenormalsToZero = 1;
 
+  if (Opts.CUDAIsDevice && Args.hasArg(OPT_fcuda_approx_transcendentals))
+Opts.CUDADeviceApproxTranscendentals = 1;
+
   if (Opts.ObjC1) {
 if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
   StringRef value = arg->getValue();
Index: cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
===
--- cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -142,7 +142,20 @@
 #pragma push_macro("__forceinline__")
 #define __forceinline__ __device__ __inline__ __attribute__((always_inline))
 #include "device_functions.hpp"
+
+// math_function.hpp uses the __USE_FAST_MATH__ macro to determine whether we
+// get the slow-but-accurate or fast-but-inaccurate versions of functions like
+// sin and exp.  This is controlled in clang by -fcuda-approx-transcendentals.
+//
+// device_functions.hpp uses __USE_FAST_MATH__ for a different purpose (fast vs.
+// slow divides), so we need to scope our define carefully here.
+#pragma push_macro("__USE_FAST_MATH__")
+#if defined(__CLANG_CUDA_APPROX_TRANSCENDENTALS__)
+#define __USE_FAST_MATH__
+#endif
 #include "math_functions.hpp"
+#pragma pop_macro("__USE_FAST_MATH__")
+
 #include "math_functions_dbl_ptx3.hpp"
 #pragma pop_macro("__forceinline__")
 
@@ -296,6 +309,7 @@
 #include "curand_mtgp32_kernel.h"
 #pragma pop_macro("dim3")
 #pragma pop_macro("uint3")
+#pragma pop_macro("__USE_FAST_MATH__")
 
 #endif // __CUDA__
 #endif // __CLANG_CUDA_RUNTIME_WRAPPER_H__
Index: cfe/trunk/lib/Driver/ToolChains.cpp
===
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -4502,6 +4502,10 @@
  options::OPT_fno_cuda_flush_denormals_to_zero, false))
 CC1Args.push_back("-fcuda-flush-denormals-to-zero");
 
+  if (DriverArgs.hasFlag(options::OPT_fcuda_approx_transcendentals,
+ options::OPT_fno_cuda_approx_transcendentals, false))
+CC1Args.push_back("-fcuda-approx-transcendentals");
+
   if (DriverArgs.hasArg(options::OPT_nocudalib))
 return;
 
Index: cfe/trunk/include/clang/Driver/Options.td
===

Re: [PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Simon Pilgrim via cfe-commits
RKSimon updated this revision to Diff 58146.

Repository:
  rL LLVM

http://reviews.llvm.org/D20528

Files:
  include/clang/Basic/BuiltinsX86.def
  lib/Headers/avxintrin.h
  lib/Headers/emmintrin.h
  test/CodeGen/avx-builtins.c
  test/CodeGen/builtins-x86.c
  test/CodeGen/sse2-builtins.c
  test/CodeGen/target-builtin-error-2.c

Index: test/CodeGen/target-builtin-error-2.c
===
--- test/CodeGen/target-builtin-error-2.c
+++ test/CodeGen/target-builtin-error-2.c
@@ -5,9 +5,9 @@
 
 // Since we do code generation on a function level this needs to error out since
 // the subtarget feature won't be available.
-__m256d wombat(__m128i a) {
+__m128 wombat(__m128i a) {
   if (__builtin_cpu_supports("avx"))
-return __builtin_ia32_cvtdq2pd256((__v4si)a); // expected-error {{'__builtin_ia32_cvtdq2pd256' needs target feature avx}}
+return __builtin_ia32_vpermilvarps((__v4sf) {0.0f, 1.0f, 2.0f, 3.0f}, (__v4si)a); // expected-error {{'__builtin_ia32_vpermilvarps' needs target feature avx}}
   else
-return (__m256d){0, 0, 0, 0};
+return (__m128){0, 0};
 }
Index: test/CodeGen/sse2-builtins.c
===
--- test/CodeGen/sse2-builtins.c
+++ test/CodeGen/sse2-builtins.c
@@ -415,7 +415,8 @@
 
 __m128d test_mm_cvtepi32_pd(__m128i A) {
   // CHECK-LABEL: test_mm_cvtepi32_pd
-  // CHECK: call <2 x double> @llvm.x86.sse2.cvtdq2pd(<4 x i32> %{{.*}})
+  // CHECK: shufflevector <4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <2 x i32> 
+  // CHECK: sitofp <2 x i32> %{{.*}} to <2 x double>
   return _mm_cvtepi32_pd(A);
 }
 
@@ -445,7 +446,8 @@
 
 __m128d test_mm_cvtps_pd(__m128 A) {
   // CHECK-LABEL: test_mm_cvtps_pd
-  // CHECK: call <2 x double> @llvm.x86.sse2.cvtps2pd(<4 x float> %{{.*}})
+  // CHECK: shufflevector <4 x float> %{{.*}}, <4 x float> %{{.*}}, <2 x i32> 
+  // CHECK: fpext <2 x float> %{{.*}} to <2 x double>
   return _mm_cvtps_pd(A);
 }
 
Index: test/CodeGen/builtins-x86.c
===
--- test/CodeGen/builtins-x86.c
+++ test/CodeGen/builtins-x86.c
@@ -325,7 +325,6 @@
   tmp_V2LLi = __builtin_ia32_psadbw128(tmp_V16c, tmp_V16c);
   tmp_V2d = __builtin_ia32_sqrtpd(tmp_V2d);
   tmp_V2d = __builtin_ia32_sqrtsd(tmp_V2d);
-  tmp_V2d = __builtin_ia32_cvtdq2pd(tmp_V4i);
   tmp_V4f = __builtin_ia32_cvtdq2ps(tmp_V4i);
   tmp_V2LLi = __builtin_ia32_cvtpd2dq(tmp_V2d);
   tmp_V2i = __builtin_ia32_cvtpd2pi(tmp_V2d);
@@ -338,7 +337,6 @@
   tmp_LLi = __builtin_ia32_cvtsd2si64(tmp_V2d);
 #endif
   tmp_V4i = __builtin_ia32_cvtps2dq(tmp_V4f);
-  tmp_V2d = __builtin_ia32_cvtps2pd(tmp_V4f);
   tmp_V4i = __builtin_ia32_cvttps2dq(tmp_V4f);
   (void) __builtin_ia32_clflush(tmp_vCp);
   (void) __builtin_ia32_lfence();
@@ -423,11 +421,9 @@
   tmp_V8f = __builtin_ia32_dpps256(tmp_V8f, tmp_V8f, 0x7);
   tmp_V4d = __builtin_ia32_cmppd256(tmp_V4d, tmp_V4d, 0);
   tmp_V8f = __builtin_ia32_cmpps256(tmp_V8f, tmp_V8f, 0);
-  tmp_V4d = __builtin_ia32_cvtdq2pd256(tmp_V4i);
   tmp_V8f = __builtin_ia32_cvtdq2ps256(tmp_V8i);
   tmp_V4f = __builtin_ia32_cvtpd2ps256(tmp_V4d);
   tmp_V8i = __builtin_ia32_cvtps2dq256(tmp_V8f);
-  tmp_V4d = __builtin_ia32_cvtps2pd256(tmp_V4f);
   tmp_V4i = __builtin_ia32_cvttpd2dq256(tmp_V4d);
   tmp_V4i = __builtin_ia32_cvtpd2dq256(tmp_V4d);
   tmp_V8i = __builtin_ia32_cvttps2dq256(tmp_V8f);
Index: test/CodeGen/avx-builtins.c
===
--- test/CodeGen/avx-builtins.c
+++ test/CodeGen/avx-builtins.c
@@ -250,7 +250,7 @@
 
 __m256d test_mm256_cvtepi32_pd(__m128i A) {
   // CHECK-LABEL: test_mm256_cvtepi32_pd
-  // CHECK: call <4 x double> @llvm.x86.avx.cvtdq2.pd.256(<4 x i32> %{{.*}})
+  // CHECK: sitofp <4 x i32> %{{.*}} to <4 x double>
   return _mm256_cvtepi32_pd(A);
 }
 
@@ -280,7 +280,7 @@
 
 __m256d test_mm256_cvtps_pd(__m128 A) {
   // CHECK-LABEL: test_mm256_cvtps_pd
-  // CHECK: call <4 x double> @llvm.x86.avx.cvt.ps2.pd.256(<4 x float> %{{.*}})
+  // CHECK: fpext <4 x float> %{{.*}} to <4 x double>
   return _mm256_cvtps_pd(A);
 }
 
Index: lib/Headers/emmintrin.h
===
--- lib/Headers/emmintrin.h
+++ lib/Headers/emmintrin.h
@@ -386,13 +386,15 @@
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_cvtps_pd(__m128 __a)
 {
-  return __builtin_ia32_cvtps2pd((__v4sf)__a);
+  return (__m128d) __builtin_convertvector(
+  __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 1), __v2df);
 }
 
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_cvtepi32_pd(__m128i __a)
 {
-  return __builtin_ia32_cvtdq2pd((__v4si)__a);
+  return (__m128d) __builtin_convertvector(
+  __builtin_shufflevector((__v4si)__a, (__v4si)__a, 0, 1), __v2df);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS
Index: lib/Headers/avxintrin.h
===
--- lib/Headers/avxintrin.h
+++ lib/Headers/avxintri

Re: [PATCH] D20407: [CodeGen][ObjC] zero-ext an i1 value to i8

2016-05-23 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 58144.
ahatanak added a comment.

Rewrote the patch based on John's review comment.

Remove typedefs and _Atomic from the return and parameter types of getters and 
setters of objective-c properties.


http://reviews.llvm.org/D20407

Files:
  include/clang/AST/Type.h
  lib/AST/Type.cpp
  lib/CodeGen/CGObjC.cpp
  lib/Sema/SemaDeclObjC.cpp
  lib/Sema/SemaObjCProperty.cpp
  test/CodeGenObjC/property-atomic-bool.m
  test/SemaObjC/property-atomic-bool.m

Index: test/SemaObjC/property-atomic-bool.m
===
--- /dev/null
+++ test/SemaObjC/property-atomic-bool.m
@@ -0,0 +1,61 @@
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -ast-dump "%s" 2>&1 | FileCheck %s
+
+// CHECK: TypedefDecl {{.*}} referenced AtomicBool '_Atomic(_Bool)'
+// CHECK:  AtomicType {{.*}} '_Atomic(_Bool)'
+// CHECK:   BuiltinType {{.*}} '_Bool'
+// CHECK: ObjCInterfaceDecl {{.*}} A0
+// CHECK:  ObjCPropertyDecl {{.*}} p '_Atomic(_Bool)' {{.*}} nonatomic
+// CHECK:  ObjCMethodDecl {{.*}} implicit - p '_Bool'
+// CHECK:  ObjCMethodDecl {{.*}} implicit - setP: 'void'
+// CHECK:   ParmVarDecl {{.*}} p '_Bool'
+// CHECK: ObjCInterfaceDecl {{.*}} A1
+// CHECK:  ObjCPropertyDecl {{.*}} p 'AtomicBool':'_Atomic(_Bool)' {{.*}} nonatomic
+// CHECK:  ObjCMethodDecl {{.*}} implicit - p '_Bool'
+// CHECK:  ObjCMethodDecl {{.*}} implicit - setP: 'void'
+// CHECK:   ParmVarDecl {{.*}} p '_Bool'
+// CHECK: ObjCInterfaceDecl {{.*}} A2
+// CHECK:  ObjCIvarDecl {{.*}} p '_Atomic(_Bool)' protected
+// CHECK:  ObjCPropertyDecl {{.*}} p '_Atomic(_Bool)'
+// CHECK:  ObjCMethodDecl {{.*}} implicit - p '_Bool'
+// CHECK:  ObjCMethodDecl {{.*}} implicit - setP: 'void'
+// CHECK:   ParmVarDecl {{.*}} p '_Bool'
+// CHECK: ObjCInterfaceDecl {{.*}} A3
+// CHECK:  ObjCIvarDecl {{.*}} p 'AtomicBool':'_Atomic(_Bool)' protected
+// CHECK:  ObjCPropertyDecl {{.*}} p 'AtomicBool':'_Atomic(_Bool)'
+// CHECK:  ObjCMethodDecl {{.*}} implicit - p '_Bool'
+// CHECK:  ObjCMethodDecl {{.*}} implicit - setP: 'void'
+// CHECK:   ParmVarDecl {{.*}} p '_Bool'
+
+typedef _Atomic(_Bool) AtomicBool;
+
+@interface A0
+@property(nonatomic) _Atomic(_Bool) p;
+@end
+@implementation A0
+@end
+
+@interface A1
+@property(nonatomic) AtomicBool p;
+@end
+@implementation A1
+@end
+
+@interface A2 {
+  _Atomic(_Bool) p;
+}
+@property _Atomic(_Bool) p;
+@end
+
+@implementation A2
+@synthesize p;
+@end
+
+@interface A3 {
+  AtomicBool p;
+}
+@property AtomicBool p;
+@end
+
+@implementation A3
+@synthesize p;
+@end
Index: test/CodeGenObjC/property-atomic-bool.m
===
--- /dev/null
+++ test/CodeGenObjC/property-atomic-bool.m
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10 -emit-llvm -x objective-c %s -o - | FileCheck %s
+
+// CHECK: define internal zeroext i1 @"\01-[A0 p]"(
+// CHECK:   %[[ATOMIC_LOAD:.*]] = load atomic i8, i8* %{{.*}} seq_cst
+// CHECK:   %[[TOBOOL:.*]] = trunc i8 %[[ATOMIC_LOAD]] to i1
+// CHECK:   ret i1 %[[TOBOOL]]
+
+// CHECK: define internal void @"\01-[A0 setP:]"({{.*}} i1 zeroext {{.*}})
+// CHECK:   store atomic i8 %{{.*}}, i8* %{{.*}} seq_cst
+// CHECK:   ret void
+
+// CHECK: define internal zeroext i1 @"\01-[A1 p]"(
+// CHECK:   %[[ATOMIC_LOAD:.*]] = load atomic i8, i8* %{{.*}} unordered
+// CHECK:   %[[TOBOOL:.*]] = trunc i8 %load to i1
+// CHECK:   ret i1 %[[TOBOOL]]
+
+// CHECK: define internal void @"\01-[A1 setP:]"({{.*}} i1 zeroext %p)
+// CHECK:   store atomic i8 %{{.*}}, i8* %{{.*}} unordered
+// CHECK:   ret void
+
+@interface A0
+@property(nonatomic) _Atomic(_Bool) p;
+@end
+@implementation A0
+@end
+
+@interface A1 {
+  _Atomic(_Bool) p;
+}
+@property _Atomic(_Bool) p;
+@end
+@implementation A1
+@synthesize p;
+@end
Index: lib/Sema/SemaObjCProperty.cpp
===
--- lib/Sema/SemaObjCProperty.cpp
+++ lib/Sema/SemaObjCProperty.cpp
@@ -1494,6 +1494,7 @@
 return false;
   QualType GetterType = GetterMethod->getReturnType().getNonReferenceType();
   QualType PropertyIvarType = property->getType().getNonReferenceType();
+  PropertyIvarType = PropertyIvarType.getDesugaredAtomicValueType(Context);
   bool compat = Context.hasSameType(PropertyIvarType, GetterType);
   if (!compat) {
 const ObjCObjectPointerType *propertyObjCPtr = nullptr;
@@ -2205,7 +2206,8 @@
 SourceLocation Loc = property->getLocation();
 
 // If the property is null_resettable, the getter returns nonnull.
-QualType resultTy = property->getType();
+QualType resultTy =
+property->getType().getDesugaredAtomicValueType(Context);
 if (property->getPropertyAttributes() &
 ObjCPropertyDecl::OBJC_PR_null_resettable) {
   QualType modifiedTy = resultTy;
@@ -2277,6 +2279,7 @@
   // If the property is null_resettable, the setter accepts a
   // nullable value.
   QualType paramTy = property->getType().getUnqualifiedType()

Re: [PATCH] D20192: [Sema] Fix bug to do with lookup of template friend function in namespace

2016-05-23 Thread Richard Smith via cfe-commits
rsmith added a comment.

It sounds like we're failing to properly inherit default template arguments 
onto redeclarations generated by template instantiation, resulting in a 
violation of our AST invariants. This patch will hide the problem in some 
cases, but the right thing to do is to fix the root cause: we should call 
CheckTemplateParameterList to inherit the default template arguments when 
instantiating a function template declaration. (Note that 
`TemplateDeclInstantiator::VisitClassTemplateDecl` remembers to do this but 
`TemplateDeclInstantiator::VisitFunctionTemplateDecl` forgets -- as does our 
handling for variable templates, and for partial specializations of class 
templates and variable templates.)


http://reviews.llvm.org/D20192



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-05-23 Thread Bruno Cardoso Lopes via cfe-commits
bruno added a subscriber: bruno.
bruno added a comment.

Hi Cameron,

Can you add a testcase?


Repository:
  rL LLVM

http://reviews.llvm.org/D20338



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Simon Pilgrim via cfe-commits
RKSimon added a comment.

In http://reviews.llvm.org/D20528#437117, @mkuper wrote:

> Sorry, I didn't intend to imply the rest of the llvm work is necessary for 
> this to go in. Just that I'd be happier with this patch knowing that we have 
> a regression test for doing the (shuffle + fpext, say) lowering correctly. I 
> didn't even mean fast-isel, only the DAG.


The fast-isel tests are the most self contained (and are useful to show the 
non-optimized codegen for every intrinsic in the headers). I can submit them 
now if you wish.


Repository:
  rL LLVM

http://reviews.llvm.org/D20528



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20243: [PCH] Disable inclusion of timestamps when generating pch files on windows.

2016-05-23 Thread Bruno Cardoso Lopes via cfe-commits
bruno added a subscriber: bruno.
bruno added a comment.

Hi Pierre,



Comment at: test/PCH/pragma-once-timestamp.cpp:17
@@ +16,3 @@
+
+// REQUIRES: system-windows
+

Can you move this to the beginning of the file? It makes it easier to spot that 
this is windows only.


http://reviews.llvm.org/D20243



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18821: Add bugprone-bool-to-integer-conversion

2016-05-23 Thread Piotr Padlewski via cfe-commits
Prazek updated this revision to Diff 58148.
Prazek added a comment.

+Fixed bug with operators
+ added fixup for function return type

I will post changes on clang tomorrow


http://reviews.llvm.org/D18821

Files:
  clang-tidy/CMakeLists.txt
  clang-tidy/bugprone/BoolToIntegerConversionCheck.cpp
  clang-tidy/bugprone/BoolToIntegerConversionCheck.h
  clang-tidy/bugprone/BugProneModule.cpp
  clang-tidy/bugprone/CMakeLists.txt
  clang-tidy/plugin/CMakeLists.txt
  clang-tidy/tool/CMakeLists.txt
  clang-tidy/tool/ClangTidyMain.cpp
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/bugprone-bool-to-integer-conversion.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/index.rst
  test/clang-tidy/bugprone-bool-to-integer-conversion.cpp

Index: test/clang-tidy/bugprone-bool-to-integer-conversion.cpp
===
--- /dev/null
+++ test/clang-tidy/bugprone-bool-to-integer-conversion.cpp
@@ -0,0 +1,163 @@
+// RUN: %check_clang_tidy %s bugprone-bool-to-integer-conversion %t
+
+const int is42Answer = true;
+// CHECK-MESSAGES: :[[@LINE-1]]:24: warning: implicitly converting bool literal to 'int'; use integer literal instead [bugprone-bool-to-integer-conversion]
+// CHECK-FIXES: const int is42Answer = 1;{{$}}
+
+volatile int noItsNot = false;
+// CHECK-MESSAGES: :[[@LINE-1]]:25: warning: implicitly converting bool literal to 'int'; {{..}}
+// CHECK-FIXES: volatile int noItsNot = 0;{{$}}
+int a = 42;
+int az = a;
+
+long long ll = true;
+// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: implicitly converting bool literal to 'long long';{{..}}
+// CHECK-FIXES: long long ll = 1;{{$}}
+
+void fun(int) {}
+#define ONE true
+
+// No fixup for macros.
+int one = ONE;
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: implicitly converting bool literal to 'int'; use integer literal instead [bugprone-bool-to-integer-conversion]
+
+void test() {
+  fun(ONE);
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: implicitly converting bool{{..}}
+
+  fun(42);
+  fun(true);
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: implicitly {{..}}
+// CHECK-FIXES: fun(1);{{$}}
+}
+
+char c = true;
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: implicitly {{..}}
+// CHECK-FIXES: char c = 1;
+
+float f = false;
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: implicitly converting bool literal to 'float';{{..}}
+// CHECK-FIXES: float f = 0;
+
+struct Blah {
+  Blah(int blah) { }
+};
+
+const int &ref = false;
+// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: implicitly converting bool literal to 'int'{{..}}
+// CHECK-FIXES: const int &ref = 0;
+
+Blah bla = true;
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: implicitly converting bool literal to 'int'{{..}}
+// CHECK-FIXES: Blah bla = 1;
+
+Blah bla2 = 1;
+
+char c2 = 1;
+char c3 = '0';
+bool b = true;
+
+// Don't warn of bitfields of size 1. Unfortunately we can't just
+// change type of flag to bool, because some compilers like MSVC doesn't
+// pack bitfields of different types.
+struct BitFields {
+  BitFields() : a(true), flag(false) {}
+// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: implicitly converting
+// CHECK-FIXES: BitFields() : a(1), flag(false) {}
+
+  unsigned a : 3;
+  unsigned flag : 1;
+};
+
+void testBitFields() {
+  BitFields b;
+  b.flag = true;
+  b.a = true;
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: implicitly converting
+// CHECK-FIXES: b.a = 1;
+}
+
+void test_operators() {
+  bool p = false;
+  if (p == false) {
+
+  }
+  int z = 1;
+  if (z == true) {
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: implicitly converting
+// CHECK-FIXES: if (z == 1) {
+
+  }
+  bool p2 = false != p;
+
+  int z2 = z - true;
+// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: implicitly converting
+// CHECK-FIXES: int z2 = z - 1;
+
+  bool p3 = z + true;
+// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: implicitly converting
+// CHECK-FIXES: bool p3 = z + 1;
+}
+
+bool ok() {
+  return true;
+  {
+return false;
+  }
+  bool z;
+  return z;
+}
+
+int change_type();
+// CHECK-FIXES: bool change_type();
+
+// This function returns only bools
+int change_type() {
+  // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: function 'change_type' has return type 'int' but returns only bools [bugprone-bool-to-integer-conversion]
+  // CHECK-FIXES: bool change_type() {
+
+  bool p;
+  return p;
+  // CHECK-MESSAGES: :[[@LINE-1]]:10: note: converting bool to 'int' here
+
+  return true;
+  {
+return false;
+  }
+  return ok();
+}
+
+int change_type(int);
+
+char change_type2() {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'change_type2' has return type 'char' but returns only bools [bugprone-bool-to-integer-conversion]
+  // CHECK-FIXES: bool change_type2() {
+
+  bool z;
+  return z;
+  // CHECK-MESSAGES: :[[@LINE-1]]:10: note: converting bool to 'char' here
+}
+
+int return_int() {
+  return 2;
+  {
+return true;
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: implicitly converting bool literal
+// CHECK-FIXES: return 1;
+  }
+  bool p;
+  return p;
+}
+
+int ret

Re: [clang-tools-extra] r270472 - Commiting for http://reviews.llvm.org/D20365

2016-05-23 Thread Piotr Padlewski via cfe-commits
BTW why did you revert this change? And why the commit message doesn't have
"revert" in name?

2016-05-23 20:51 GMT+02:00 Nico Weber via cfe-commits <
cfe-commits@lists.llvm.org>:

> Next time, please use real commit messages: Describe what the change does,
> and why it's being done. Include a link to the review link at the end of
> the commit message. If every change just had a phab link as commit message,
> people bisecting changes would have to click through for every change in
> `svn log` output.
>
> On Mon, May 23, 2016 at 2:15 PM, Mads Ravn via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: madsravn
>> Date: Mon May 23 13:15:40 2016
>> New Revision: 270472
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=270472&view=rev
>> Log:
>> Commiting for http://reviews.llvm.org/D20365
>>
>> Modified:
>> clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
>> clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
>>
>> Modified:
>> clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp?rev=270472&r1=270471&r2=270472&view=diff
>>
>> ==
>> --- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp
>> (original)
>> +++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Mon
>> May 23 13:15:40 2016
>> @@ -181,6 +181,12 @@ void PassByValueCheck::check(const Match
>>if (!paramReferredExactlyOnce(Ctor, ParamDecl))
>>  return;
>>
>> +
>> +  // If the parameter is trivial to copy, don't move it. Moving a
>> trivivally
>> +  // copyable type will cause a problem with modernize-pass-by-value
>> +  if (ParamDecl->getType().isTriviallyCopyableType(*Result.Context))
>> +return;
>> +
>>auto Diag = diag(ParamDecl->getLocStart(), "pass by value and use
>> std::move");
>>
>>// Iterate over all declarations of the constructor.
>>
>> Modified:
>> clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp?rev=270472&r1=270471&r2=270472&view=diff
>>
>> ==
>> --- clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
>> (original)
>> +++ clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
>> Mon May 23 13:15:40 2016
>> @@ -194,3 +194,9 @@ struct S {
>>Movable M;
>>  };
>>
>> +// Test that types that are trivially copyable will not use std::move.
>> This will
>> +// cause problems with misc-move-const-arg, as it will revert it.
>> +struct T {
>> +  std::array a_;
>> +  T(std::array a) : a_(a) {}
>> +};
>>
>>
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Michael Kuperstein via cfe-commits
mkuper added a comment.

Presumably, the fast-isel lowering of the IR pattern is already correct, and in 
any case, it isn't affected by this patch.
I just want to make sure we don't regress the optimized DAG codegen - that is, 
it still produces the instruction we'd expect from the intrinsic (or something 
at least as good).


Repository:
  rL LLVM

http://reviews.llvm.org/D20528



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18073: Add memory allocating functions

2016-05-23 Thread Alexander Riccio via cfe-commits
ariccio added a comment.

I should elaborate. The principle of operation of this latest patch is that the 
`FunctionDecl` in `IsCMemFunction` should never return a `nullptr` 
`IdentifierInfo*` from `getIdentifier` (is that a valid assumption?)... Thus, 
when`! isWindowsMSVCEnvironment`, I leave the Windows-only memory allocating 
functions initialized to `nullptr`, which will never equal a non-null 
`IdentifierInfo*`, and never trigger on a non-Windows platform.


http://reviews.llvm.org/D18073



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r269769 - [PCH] Fixed bug with preamble invalidation when overridden files change

2016-05-23 Thread Bruno Cardoso Lopes via cfe-commits
Ping on the testcase :-)

On Tue, May 17, 2016 at 9:36 AM, Nico Weber via cfe-commits
 wrote:
> Is it possible to write a test for this?
>
> On Tue, May 17, 2016 at 10:34 AM, Cameron Desrochers via cfe-commits
>  wrote:
>>
>> Author: cameron314
>> Date: Tue May 17 09:34:53 2016
>> New Revision: 269769
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=269769&view=rev
>> Log:
>> [PCH] Fixed bug with preamble invalidation when overridden files change
>>
>> When remapped files were changed, they would not always cause the
>> preamble's PCH to be invalidated, because the remapped path didn't
>> necessarily match the include path (e.g. slash direction -- this happens a
>> lot on Windows). I fixed this by moving to a llvm::sys::fs::UniqueID-based
>> map instead of comparing paths stringwise.
>>
>> Differential Revision: http://reviews.llvm.org/D20137
>>
>> Modified:
>> cfe/trunk/lib/Frontend/ASTUnit.cpp
>>
>> Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=269769&r1=269768&r2=269769&view=diff
>>
>> ==
>> --- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
>> +++ cfe/trunk/lib/Frontend/ASTUnit.cpp Tue May 17 09:34:53 2016
>> @@ -1378,7 +1378,7 @@ ASTUnit::getMainBufferWithPrecompiledPre
>>
>>// First, make a record of those files that have been overridden
>> via
>>// remapping or unsaved_files.
>> -  llvm::StringMap OverriddenFiles;
>> +  std::map
>> OverriddenFiles;
>>for (const auto &R : PreprocessorOpts.RemappedFiles) {
>>  if (AnyFileChanged)
>>break;
>> @@ -1391,24 +1391,38 @@ ASTUnit::getMainBufferWithPrecompiledPre
>>break;
>>  }
>>
>> -OverriddenFiles[R.first] = PreambleFileHash::createForFile(
>> +OverriddenFiles[Status.getUniqueID()] =
>> PreambleFileHash::createForFile(
>>  Status.getSize(),
>> Status.getLastModificationTime().toEpochTime());
>>}
>>
>>for (const auto &RB : PreprocessorOpts.RemappedFileBuffers) {
>>  if (AnyFileChanged)
>>break;
>> -OverriddenFiles[RB.first] =
>> +
>> +vfs::Status Status;
>> +if (FileMgr->getNoncachedStatValue(RB.first, Status)) {
>> +  AnyFileChanged = true;
>> +  break;
>> +}
>> +
>> +OverriddenFiles[Status.getUniqueID()] =
>>  PreambleFileHash::createForMemoryBuffer(RB.second);
>>}
>>
>>// Check whether anything has changed.
>> -  for (llvm::StringMap::iterator
>> +  for (llvm::StringMap::iterator
>>   F = FilesInPreamble.begin(), FEnd = FilesInPreamble.end();
>> !AnyFileChanged && F != FEnd;
>> ++F) {
>> -llvm::StringMap::iterator Overridden
>> -  = OverriddenFiles.find(F->first());
>> +vfs::Status Status;
>> +if (FileMgr->getNoncachedStatValue(F->first(), Status)) {
>> +  // If we can't stat the file, assume that something horrible
>> happened.
>> +  AnyFileChanged = true;
>> +  break;
>> +}
>> +
>> +std::map::iterator
>> Overridden
>> +  = OverriddenFiles.find(Status.getUniqueID());
>>  if (Overridden != OverriddenFiles.end()) {
>>// This file was remapped; check whether the newly-mapped file
>>// matches up with the previous mapping.
>> @@ -1418,13 +1432,9 @@ ASTUnit::getMainBufferWithPrecompiledPre
>>  }
>>
>>  // The file was not remapped; check whether it has changed on
>> disk.
>> -vfs::Status Status;
>> -if (FileMgr->getNoncachedStatValue(F->first(), Status)) {
>> -  // If we can't stat the file, assume that something horrible
>> happened.
>> -  AnyFileChanged = true;
>> -} else if (Status.getSize() != uint64_t(F->second.Size) ||
>> -   Status.getLastModificationTime().toEpochTime() !=
>> -   uint64_t(F->second.ModTime))
>> +if (Status.getSize() != uint64_t(F->second.Size) ||
>> +Status.getLastModificationTime().toEpochTime() !=
>> +uint64_t(F->second.ModTime))
>>AnyFileChanged = true;
>>}
>>
>>
>>
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>



-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D18575: [clang-tidy] New checker to replace deprecated throw() specifications

2016-05-23 Thread don hinton via cfe-commits
hintonda updated this revision to Diff 58151.
hintonda added a comment.

Fixed matcher -- added 'unless(isImplicit())'.  Thanks to Aaron Ballman for the 
suggestion.


http://reviews.llvm.org/D18575

Files:
  clang-tidy/modernize/CMakeLists.txt
  clang-tidy/modernize/ModernizeTidyModule.cpp
  clang-tidy/modernize/UseNoexceptCheck.cpp
  clang-tidy/modernize/UseNoexceptCheck.h
  clang-tidy/modernize/UseOverrideCheck.cpp
  clang-tidy/utils/LexerUtils.cpp
  clang-tidy/utils/LexerUtils.h
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/modernize-use-noexcept.rst
  test/clang-tidy/modernize-use-noexcept-macro.cpp
  test/clang-tidy/modernize-use-noexcept.cpp

Index: test/clang-tidy/modernize-use-noexcept.cpp
===
--- /dev/null
+++ test/clang-tidy/modernize-use-noexcept.cpp
@@ -0,0 +1,59 @@
+// RUN: %check_clang_tidy %s modernize-use-noexcept %t -- \
+// RUN:   -- -std=c++11
+
+class A {};
+class B {};
+
+void foo() throw();
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'foo' uses dynamic exception specification 'throw()' [modernize-use-noexcept]
+// CHECK-FIXES: void foo() noexcept;
+
+void bar() throw(...);
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'bar' uses dynamic exception specification 'throw(...)' [modernize-use-noexcept]
+// CHECK-FIXES: void bar() noexcept(false);
+
+void foobar() throw(A, B)
+{}
+// CHECK-MESSAGES: :[[@LINE-2]]:6: warning: function 'foobar' uses dynamic exception specification 'throw(A, B)' [modernize-use-noexcept]
+// CHECK-FIXES: void foobar() noexcept(false)
+
+void baz(int = (throw A(), 0)) throw(A, B) {}
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'baz' uses dynamic exception specification 'throw(A, B)' [modernize-use-noexcept]
+// CHECK-FIXES: void baz(int = (throw A(), 0)) noexcept(false) {}
+
+// We can fix this one because the matcher finds the trailing throw().
+void f(void (*fp)(void) throw()) throw(char);
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'f' uses dynamic exception specification 'throw()' [modernize-use-noexcept]
+// CHECK-MESSAGES: :[[@LINE-2]]:6: warning: function 'f' uses dynamic exception specification 'throw(char)' [modernize-use-noexcept]
+// CHECK-FIXES: void f(void (*fp)(void) noexcept) noexcept(false);
+
+// FIXME: We can't fix this one -- need help developing an appropriate matcher.
+void g(void (*fp)(void) throw());
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'g' uses dynamic exception specification 'throw()' [modernize-use-noexcept]
+// CHECK-FIXES: void g(void (*fp)(void) noexcept);
+
+void j() throw(int(int) throw(void(void) throw(int)));
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'j' uses dynamic exception specification 'throw(int(int) throw(void(void) throw(int)))' [modernize-use-noexcept]
+// CHECK-FIXES: void j() noexcept(false);
+
+void k() throw(int(int));
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'k' uses dynamic exception specification 'throw(int(int))' [modernize-use-noexcept]
+// CHECK-FIXES: void k() noexcept(false);
+
+// Should not trigger a replacement.
+void titi() noexcept {}
+void toto() noexcept(true) {}
+
+
+class Y {
+  Y() throw() = default;
+};
+// CHECK-MESSAGES: :[[@LINE-2]]:3: warning: function 'Y' uses dynamic exception specification 'throw()' [modernize-use-noexcept]
+// CHECK-FIXES: Y() noexcept = default;
+
+// We can't find this
+#define xxx X() throw() = default
+class X {
+  xxx;
+};
+
Index: test/clang-tidy/modernize-use-noexcept-macro.cpp
===
--- /dev/null
+++ test/clang-tidy/modernize-use-noexcept-macro.cpp
@@ -0,0 +1,24 @@
+// RUN: %check_clang_tidy %s modernize-use-noexcept %t -- \
+// RUN:   -config="{CheckOptions: [{key: modernize-use-noexcept.ReplacementString, value: 'NOEXCEPT'}]}" \
+// RUN:   -- -std=c++11
+
+// Example definition of NOEXCEPT -- simplified test to see if noexcept is supported. 
+#if (__has_feature(cxx_noexcept))
+#define NOEXCEPT noexcept
+#else
+#define NOEXCEPT throw()
+#endif
+
+void bar() throw() {}
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'bar' uses dynamic exception specification 'throw()' [modernize-use-noexcept]
+// CHECK-FIXES: void bar() NOEXCEPT {}
+
+// Should not trigger a FixItHint, since macros only support noexcept, and this
+// case throws.
+class A {};
+class B {};
+void foobar() throw(A, B);
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'foobar' uses dynamic exception specification 'throw(A, B)' [modernize-use-noexcept]
+
+// Should not trigger a replacement.
+void foo() noexcept(true);
Index: docs/clang-tidy/checks/modernize-use-noexcept.rst
===
--- /dev/null
+++ docs/clang-tidy/checks/modernize-use-noexcept.rst
@@ -0,0 +1,55 @@
+.. title:: clang-tidy - modernize-use-noexcept
+
+modernize-use-noexcept
+==
+
+The check converts dynamic exception specifications, e.g., ``throw

Re: [PATCH] D18575: [clang-tidy] New checker to replace deprecated throw() specifications

2016-05-23 Thread don hinton via cfe-commits
hintonda added a comment.

In http://reviews.llvm.org/D18575#435388, @alexfh wrote:

> Let's wait for http://reviews.llvm.org/D20428


No worries.


http://reviews.llvm.org/D18575



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20119: [libunwind] Improve unwinder stack usage

2016-05-23 Thread Asiri Rathnayake via cfe-commits
rmaprath added a comment.

In http://reviews.llvm.org/D20119#436849, @jroelofs wrote:

> In http://reviews.llvm.org/D20119#431997, @rmaprath wrote:
>
> > Addressing review comments from @jroelofs:
> >
> > - Moved the assertion in `libunwind.cpp` back to `UnwindCursor.cpp` where 
> > it really belogs.
> >
> >   @jroelofs: I just realized that, with this new native-only build of 
> > `libunwind`, users of `libunwind.h` would have to explicitly `#define` the 
> > flag `_LIBUNWIND_IS_NATIVE_ONLY` in order to get the header in-sync with 
> > the library. I can't see an immediate problem if they don't define that 
> > flag though, it's just that they'll end up passing larger buffers than the 
> > library needs. Do you see a problem here?
>
>
> I'm not convinced it's a problem, (though possibly performance left on the 
> table)...
>
> > 'libc++' uses a `__config_site` mechanism to wire the cmake build options 
> > into the `__config` header. We can implement a similar mechanism in 
> > `libunwind`, not sure if that's necessary here.
>
>
> I think that's the right way to go.
>
> Jon
>
> > WDYT?
>
> > 
>
> > Thanks.
>
> > 
>
> > / Asiri
>


Apologies, it looks like we don't have any targets for installing `libunwind.h` 
header (or any other headers from `libunwind` project for that matter). I think 
this means we use `libunwind.h` only for building libunwind+libcxxabi 
libraries, and there's no need to explicitly adjust `libunwind.h` header as it 
is not used from outside as it is. Hope this makes sense.

OK to commit? Sorry for the diversion.

/ Asiri


http://reviews.llvm.org/D20119



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20243: [PCH] Disable inclusion of timestamps when generating pch files on windows.

2016-05-23 Thread Nico Weber via cfe-commits
thakis added a comment.

Hm, the ASTReader code this works around is over 6 years old (r100866). Maybe 
we could try enabling the access time check instead?


http://reviews.llvm.org/D20243



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Simon Pilgrim via cfe-commits
RKSimon added a comment.

In http://reviews.llvm.org/D20528#437165, @mkuper wrote:

> Presumably, the fast-isel lowering of the IR pattern is already correct, and 
> in any case, it isn't affected by this patch.
>  I just want to make sure we don't regress the optimized DAG codegen - that 
> is, it still produces the instruction we'd expect from the intrinsic (or 
> something at least as good).


The existing llvm\test\CodeGen\X86\vec_fpext.ll and 
llvm\test\CodeGen\X86\vec_int_to_fp.ll already demonstrate the correct 
optimized DAG codegen using the same IR as output in the 
clang\test\CodeGen\*-builtins.c here.

Also, the aim is to keep the llvm\test\CodeGen\X86\*-intrinsics-fast-isel.ll 
tests in sync with the llvm\tools\clang\test\CodeGen\*-builtins.c equivalents.


Repository:
  rL LLVM

http://reviews.llvm.org/D20528



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Michael Kuperstein via cfe-commits
mkuper accepted this revision.
mkuper added a comment.
This revision is now accepted and ready to land.

> The existing llvm\test\CodeGen\X86\vec_fpext.ll and 
> llvm\test\CodeGen\X86\vec_int_to_fp.ll already demonstrate the correct 
> optimized DAG codegen using the same IR as output in the 
> clang\test\CodeGen\*-builtins.c here.


That's what I meant by "Do you know if there are already CG tests that check we 
correctly lower these IR patterns", sorry I wasn't more clear.
This LGTM.


Repository:
  rL LLVM

http://reviews.llvm.org/D20528



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20528: [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Simon Pilgrim via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL270499: [X86][SSE] Replace lossless i32/f32 to f64 
conversion intrinsics with generic IR (authored by RKSimon).

Changed prior to commit:
  http://reviews.llvm.org/D20528?vs=58146&id=58160#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20528

Files:
  cfe/trunk/include/clang/Basic/BuiltinsX86.def
  cfe/trunk/lib/Headers/avxintrin.h
  cfe/trunk/lib/Headers/emmintrin.h
  cfe/trunk/test/CodeGen/avx-builtins.c
  cfe/trunk/test/CodeGen/builtins-x86.c
  cfe/trunk/test/CodeGen/sse2-builtins.c
  cfe/trunk/test/CodeGen/target-builtin-error-2.c

Index: cfe/trunk/test/CodeGen/target-builtin-error-2.c
===
--- cfe/trunk/test/CodeGen/target-builtin-error-2.c
+++ cfe/trunk/test/CodeGen/target-builtin-error-2.c
@@ -5,9 +5,9 @@
 
 // Since we do code generation on a function level this needs to error out since
 // the subtarget feature won't be available.
-__m256d wombat(__m128i a) {
+__m128 wombat(__m128i a) {
   if (__builtin_cpu_supports("avx"))
-return __builtin_ia32_cvtdq2pd256((__v4si)a); // expected-error {{'__builtin_ia32_cvtdq2pd256' needs target feature avx}}
+return __builtin_ia32_vpermilvarps((__v4sf) {0.0f, 1.0f, 2.0f, 3.0f}, (__v4si)a); // expected-error {{'__builtin_ia32_vpermilvarps' needs target feature avx}}
   else
-return (__m256d){0, 0, 0, 0};
+return (__m128){0, 0};
 }
Index: cfe/trunk/test/CodeGen/sse2-builtins.c
===
--- cfe/trunk/test/CodeGen/sse2-builtins.c
+++ cfe/trunk/test/CodeGen/sse2-builtins.c
@@ -415,7 +415,8 @@
 
 __m128d test_mm_cvtepi32_pd(__m128i A) {
   // CHECK-LABEL: test_mm_cvtepi32_pd
-  // CHECK: call <2 x double> @llvm.x86.sse2.cvtdq2pd(<4 x i32> %{{.*}})
+  // CHECK: shufflevector <4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <2 x i32> 
+  // CHECK: sitofp <2 x i32> %{{.*}} to <2 x double>
   return _mm_cvtepi32_pd(A);
 }
 
@@ -445,7 +446,8 @@
 
 __m128d test_mm_cvtps_pd(__m128 A) {
   // CHECK-LABEL: test_mm_cvtps_pd
-  // CHECK: call <2 x double> @llvm.x86.sse2.cvtps2pd(<4 x float> %{{.*}})
+  // CHECK: shufflevector <4 x float> %{{.*}}, <4 x float> %{{.*}}, <2 x i32> 
+  // CHECK: fpext <2 x float> %{{.*}} to <2 x double>
   return _mm_cvtps_pd(A);
 }
 
Index: cfe/trunk/test/CodeGen/avx-builtins.c
===
--- cfe/trunk/test/CodeGen/avx-builtins.c
+++ cfe/trunk/test/CodeGen/avx-builtins.c
@@ -250,7 +250,7 @@
 
 __m256d test_mm256_cvtepi32_pd(__m128i A) {
   // CHECK-LABEL: test_mm256_cvtepi32_pd
-  // CHECK: call <4 x double> @llvm.x86.avx.cvtdq2.pd.256(<4 x i32> %{{.*}})
+  // CHECK: sitofp <4 x i32> %{{.*}} to <4 x double>
   return _mm256_cvtepi32_pd(A);
 }
 
@@ -280,7 +280,7 @@
 
 __m256d test_mm256_cvtps_pd(__m128 A) {
   // CHECK-LABEL: test_mm256_cvtps_pd
-  // CHECK: call <4 x double> @llvm.x86.avx.cvt.ps2.pd.256(<4 x float> %{{.*}})
+  // CHECK: fpext <4 x float> %{{.*}} to <4 x double>
   return _mm256_cvtps_pd(A);
 }
 
Index: cfe/trunk/test/CodeGen/builtins-x86.c
===
--- cfe/trunk/test/CodeGen/builtins-x86.c
+++ cfe/trunk/test/CodeGen/builtins-x86.c
@@ -325,7 +325,6 @@
   tmp_V2LLi = __builtin_ia32_psadbw128(tmp_V16c, tmp_V16c);
   tmp_V2d = __builtin_ia32_sqrtpd(tmp_V2d);
   tmp_V2d = __builtin_ia32_sqrtsd(tmp_V2d);
-  tmp_V2d = __builtin_ia32_cvtdq2pd(tmp_V4i);
   tmp_V4f = __builtin_ia32_cvtdq2ps(tmp_V4i);
   tmp_V2LLi = __builtin_ia32_cvtpd2dq(tmp_V2d);
   tmp_V2i = __builtin_ia32_cvtpd2pi(tmp_V2d);
@@ -338,7 +337,6 @@
   tmp_LLi = __builtin_ia32_cvtsd2si64(tmp_V2d);
 #endif
   tmp_V4i = __builtin_ia32_cvtps2dq(tmp_V4f);
-  tmp_V2d = __builtin_ia32_cvtps2pd(tmp_V4f);
   tmp_V4i = __builtin_ia32_cvttps2dq(tmp_V4f);
   (void) __builtin_ia32_clflush(tmp_vCp);
   (void) __builtin_ia32_lfence();
@@ -423,11 +421,9 @@
   tmp_V8f = __builtin_ia32_dpps256(tmp_V8f, tmp_V8f, 0x7);
   tmp_V4d = __builtin_ia32_cmppd256(tmp_V4d, tmp_V4d, 0);
   tmp_V8f = __builtin_ia32_cmpps256(tmp_V8f, tmp_V8f, 0);
-  tmp_V4d = __builtin_ia32_cvtdq2pd256(tmp_V4i);
   tmp_V8f = __builtin_ia32_cvtdq2ps256(tmp_V8i);
   tmp_V4f = __builtin_ia32_cvtpd2ps256(tmp_V4d);
   tmp_V8i = __builtin_ia32_cvtps2dq256(tmp_V8f);
-  tmp_V4d = __builtin_ia32_cvtps2pd256(tmp_V4f);
   tmp_V4i = __builtin_ia32_cvttpd2dq256(tmp_V4d);
   tmp_V4i = __builtin_ia32_cvtpd2dq256(tmp_V4d);
   tmp_V8i = __builtin_ia32_cvttps2dq256(tmp_V8f);
Index: cfe/trunk/lib/Headers/avxintrin.h
===
--- cfe/trunk/lib/Headers/avxintrin.h
+++ cfe/trunk/lib/Headers/avxintrin.h
@@ -2050,7 +2050,7 @@
 static __inline __m256d __DEFAULT_FN_ATTRS
 _mm256_cvtepi32_pd(__m128i __a)
 {
-  return (__m256d)__builtin_ia32_cvtdq2pd256((__v4si) __a);
+  return (__m256d)__builtin_convertvector((__v4si)__a, __v4df);
 }
 
 /// \brief Converts

r270499 - [X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

2016-05-23 Thread Simon Pilgrim via cfe-commits
Author: rksimon
Date: Mon May 23 17:13:02 2016
New Revision: 270499

URL: http://llvm.org/viewvc/llvm-project?rev=270499&view=rev
Log:
[X86][SSE] Replace lossless i32/f32 to f64 conversion intrinsics with generic IR

Both the (V)CVTDQ2PD(Y) (i32 to f64) and (V)CVTPS2PD(Y) (f32 to f64) conversion 
instructions are lossless and can be safely represented as generic 
__builtin_convertvector calls instead of x86 intrinsics without affecting final 
codegen.

This patch removes the clang builtins and their use in the sse2/avx headers - a 
future patch will deal with removing the llvm intrinsics, but that will require 
a bit more work.

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

Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avxintrin.h
cfe/trunk/lib/Headers/emmintrin.h
cfe/trunk/test/CodeGen/avx-builtins.c
cfe/trunk/test/CodeGen/builtins-x86.c
cfe/trunk/test/CodeGen/sse2-builtins.c
cfe/trunk/test/CodeGen/target-builtin-error-2.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=270499&r1=270498&r2=270499&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Mon May 23 17:13:02 2016
@@ -330,7 +330,6 @@ TARGET_BUILTIN(__builtin_ia32_movntdq, "
 TARGET_BUILTIN(__builtin_ia32_psadbw128, "V2LLiV16cV16c", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_sqrtpd, "V2dV2d", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_sqrtsd, "V2dV2d", "", "sse2")
-TARGET_BUILTIN(__builtin_ia32_cvtdq2pd, "V2dV4i", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_cvtdq2ps, "V4fV4i", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2dq, "V2LLiV2d", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2ps, "V4fV2d", "", "sse2")
@@ -338,7 +337,6 @@ TARGET_BUILTIN(__builtin_ia32_cvttpd2dq,
 TARGET_BUILTIN(__builtin_ia32_cvtsd2si, "iV2d", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_cvtsd2si64, "LLiV2d", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_cvtps2dq, "V4iV4f", "", "sse2")
-TARGET_BUILTIN(__builtin_ia32_cvtps2pd, "V2dV4f", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_cvttps2dq, "V4iV4f", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_clflush, "vvC*", "", "sse2")
 TARGET_BUILTIN(__builtin_ia32_lfence, "v", "", "sse2")
@@ -466,11 +464,9 @@ TARGET_BUILTIN(__builtin_ia32_blendvps25
 TARGET_BUILTIN(__builtin_ia32_dpps256, "V8fV8fV8fIc", "", "avx")
 TARGET_BUILTIN(__builtin_ia32_cmppd256, "V4dV4dV4dIc", "", "avx")
 TARGET_BUILTIN(__builtin_ia32_cmpps256, "V8fV8fV8fIc", "", "avx")
-TARGET_BUILTIN(__builtin_ia32_cvtdq2pd256, "V4dV4i", "", "avx")
 TARGET_BUILTIN(__builtin_ia32_cvtdq2ps256, "V8fV8i", "", "avx")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2ps256, "V4fV4d", "", "avx")
 TARGET_BUILTIN(__builtin_ia32_cvtps2dq256, "V8iV8f", "", "avx")
-TARGET_BUILTIN(__builtin_ia32_cvtps2pd256, "V4dV4f", "", "avx")
 TARGET_BUILTIN(__builtin_ia32_cvttpd2dq256, "V4iV4d", "", "avx")
 TARGET_BUILTIN(__builtin_ia32_cvtpd2dq256, "V4iV4d", "", "avx")
 TARGET_BUILTIN(__builtin_ia32_cvttps2dq256, "V8iV8f", "", "avx")

Modified: cfe/trunk/lib/Headers/avxintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avxintrin.h?rev=270499&r1=270498&r2=270499&view=diff
==
--- cfe/trunk/lib/Headers/avxintrin.h (original)
+++ cfe/trunk/lib/Headers/avxintrin.h Mon May 23 17:13:02 2016
@@ -2050,7 +2050,7 @@ _mm256_insert_epi64(__m256i __a, long lo
 static __inline __m256d __DEFAULT_FN_ATTRS
 _mm256_cvtepi32_pd(__m128i __a)
 {
-  return (__m256d)__builtin_ia32_cvtdq2pd256((__v4si) __a);
+  return (__m256d)__builtin_convertvector((__v4si)__a, __v4df);
 }
 
 /// \brief Converts a vector of [8 x i32] into a vector of [8 x float].
@@ -2102,7 +2102,7 @@ _mm256_cvtps_epi32(__m256 __a)
 static __inline __m256d __DEFAULT_FN_ATTRS
 _mm256_cvtps_pd(__m128 __a)
 {
-  return (__m256d)__builtin_ia32_cvtps2pd256((__v4sf) __a);
+  return (__m256d)__builtin_convertvector((__v4sf)__a, __v4df);
 }
 
 static __inline __m128i __DEFAULT_FN_ATTRS

Modified: cfe/trunk/lib/Headers/emmintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/emmintrin.h?rev=270499&r1=270498&r2=270499&view=diff
==
--- cfe/trunk/lib/Headers/emmintrin.h (original)
+++ cfe/trunk/lib/Headers/emmintrin.h Mon May 23 17:13:02 2016
@@ -386,13 +386,15 @@ _mm_cvtpd_ps(__m128d __a)
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_cvtps_pd(__m128 __a)
 {
-  return __builtin_ia32_cvtps2pd((__v4sf)__a);
+  return (__m128d) __builtin_convertvector(
+  __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 1), __v2df);
 }
 
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_cvtepi32_pd(__m128i __a)
 {
-  return __builtin_ia32_cvtdq2pd((__v4si)__a);
+  return (__m128d) __builti

Re: [PATCH] D20428: Tracking exception specification source locations

2016-05-23 Thread Alexander Kornienko via cfe-commits
alexfh added a comment.

Richard, ping.


http://reviews.llvm.org/D20428



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r270505 - Visualizer for Pack template arguments

2016-05-23 Thread Mike Spertus via cfe-commits
Author: mps
Date: Mon May 23 17:27:44 2016
New Revision: 270505

URL: http://llvm.org/viewvc/llvm-project?rev=270505&view=rev
Log:
Visualizer for Pack template arguments


Modified:
cfe/trunk/utils/ClangVisualizers/clang.natvis

Modified: cfe/trunk/utils/ClangVisualizers/clang.natvis
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ClangVisualizers/clang.natvis?rev=270505&r1=270504&r2=270505&view=diff
==
--- cfe/trunk/utils/ClangVisualizers/clang.natvis (original)
+++ cfe/trunk/utils/ClangVisualizers/clang.natvis Mon May 23 17:27:44 2016
@@ -231,9 +231,14 @@ For later versions of Visual Studio, no
   
   
 {*(clang::QualType 
*)&TypeOrValue.V,view(cpp)}
-{(clang::TemplateArgument::ArgKind)TypeOrValue.Kind,en} 
template parameter: {*(clang::QualType *)&TypeOrValue.V}
+{(clang::TemplateArgument::ArgKind)TypeOrValue.Kind,en}
 template parameter: {*(clang::QualType *)&TypeOrValue.V}
+
{(clang::TemplateArgument::ArgKind)TypeOrValue.Kind,en}
 
   *(clang::QualType 
*)&TypeOrValue.V
+  
+Args.NumArgs
+Args.Args
+  
   
 
   


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20365: [PATCH] clang-tidy: Bug 27731 - modernize-pass-by-value suggest using std::move for types that perform copies on move

2016-05-23 Thread Alexander Kornienko via cfe-commits
alexfh added a comment.

In http://reviews.llvm.org/D20365#436335, @madsravn wrote:

> Just curious, as I'm sort of new to this. How long will it take before its 
> merged in?


I was waiting for an answer to the "Do you need me to submit the patch for 
you?" question. Apparently, the answer is "no" ;)


http://reviews.llvm.org/D20365



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D20365: [PATCH] clang-tidy: Bug 27731 - modernize-pass-by-value suggest using std::move for types that perform copies on move

2016-05-23 Thread Piotr Padlewski via cfe-commits
Prazek added a comment.

Did you revert the commit? I see that it is commieted, but after it I see 
revert.
Also please stick to convention of commit messages 
http://llvm.org/docs/DeveloperPolicy.html#commit-messages
Commit message like "[clang-tidy] modernize-pass-by-value bugfix" would be much 
better.


http://reviews.llvm.org/D20365



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang-tools-extra] r260944 - clang-tools-extra/test/Unit/lit.site.cfg.in: Prune on_clone. I guess it has been unused since r188006.

2016-05-23 Thread NAKAMURA Takumi via cfe-commits
Ping.

On Tue, Apr 5, 2016 at 11:46 AM NAKAMURA Takumi 
wrote:

> Tom, may I commit it into release_38?
> It has been preventing "lit --use-processes" on windows.
>
> 2016-02-16 17:13 GMT+09:00 NAKAMURA Takumi via cfe-commits
> :
> > Author: chapuni
> > Date: Tue Feb 16 02:13:36 2016
> > New Revision: 260944
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=260944&view=rev
> > Log:
> > clang-tools-extra/test/Unit/lit.site.cfg.in: Prune on_clone. I guess it
> has been unused since r188006.
> >
> > Modified:
> > clang-tools-extra/trunk/test/Unit/lit.site.cfg.in
> >
> > Modified: clang-tools-extra/trunk/test/Unit/lit.site.cfg.in
> > URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/Unit/lit.site.cfg.in?rev=260944&r1=260943&r2=260944&view=diff
> >
> ==
> > --- clang-tools-extra/trunk/test/Unit/lit.site.cfg.in (original)
> > +++ clang-tools-extra/trunk/test/Unit/lit.site.cfg.in Tue Feb 16
> 02:13:36 2016
> > @@ -6,10 +6,4 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
> >  config.shlibdir = "@SHLIBDIR@"
> >  config.target_triple = "@TARGET_TRIPLE@"
> >
> > -# Make sure any custom vars defined above that are required in
> lit.local.cfg
> > -# files are made available.
> > -def on_clone(parent, clone, path):
> > -  clone.extra_tools_src_dir = parent.extra_tools_src_dir
> > -
> > -config.on_clone = on_clone
> >  lit_config.load_config(config, "@CLANG_TOOLS_SOURCE_DIR@
> /test/Unit/lit.cfg")
> >
> >
> > ___
> > cfe-commits mailing list
> > cfe-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Buildbot numbers for the week of 5/15/2016 - 5/21/2016

2016-05-23 Thread Galina Kistanova via cfe-commits
Hello everyone,

Below are some buildbot numbers for the last week of 5/15/2016 - 5/21/2016.

Thanks

Galina


"Status change ratio" by active builder (percent of builds that changed the
builder status from greed to red or from red to green):

 buildername| builds |
changes | status change ratio
++-+-
 lldb-windows7-android  |114 |
42 |36.8
 perf-x86_64-penryn-O3-polly| 51 |
16 |31.4
 clang-ppc64le-linux-lnt|223 |
48 |21.5
 clang-native-aarch64-full  | 10
|   2 |20.0
 lldb-x86_64-darwin-13.4|117 |
19 |16.2
 clang-ppc64le-linux-multistage | 92 |
14 |15.2
 clang-x64-ninja-win7   |182 |
25 |13.7
 sanitizer-x86_64-linux | 78
|   9 |11.5
 lldb-x86-windows-msvc2015  |286 |
30 |10.5
 sanitizer-ppc64be-linux|100 |
10 |10.0
 llvm-mips-linux| 40
|   4 |10.0
 clang-atom-d525-fedora-rel | 85
|   8 | 9.4
 lldb-x86_64-ubuntu-14.04-android   |114 |
10 | 8.8
 clang-cmake-thumbv7-a15-full-sh| 23
|   2 | 8.7
 sanitizer-x86_64-linux-bootstrap   | 48
|   4 | 8.3
 clang-cmake-mips   | 96
|   8 | 8.3
 clang-hexagon-elf  |408 |
33 | 8.1
 perf-x86_64-penryn-O3  | 52
|   4 | 7.7
 clang-cmake-aarch64-full   | 52
|   4 | 7.7
 perf-x86_64-penryn-O3-polly-fast   | 27
|   2 | 7.4
 clang-s390x-linux  |387 |
28 | 7.2
 clang-bpf-build|412 |
28 | 6.8
 clang-ppc64be-linux-multistage |118
|   8 | 6.8
 clang-ppc64be-linux-lnt|271 |
18 | 6.6
 sanitizer-ppc64le-linux| 61
|   4 | 6.6
 clang-x86-win2008-selfhost |108
|   7 | 6.5
 clang-ppc64le-linux|252 |
16 | 6.3
 sanitizer-x86_64-linux-fast|195 |
12 | 6.2
 lldb-amd64-ninja-netbsd7   |104
|   6 | 5.8
 llvm-clang-lld-x86_64-debian-fast  |193 |
11 | 5.7
 clang-ppc64be-linux|360 |
20 | 5.6
 clang-cmake-aarch64-42vma  |178 |
10 | 5.6
 lldb-x86_64-ubuntu-14.04-cmake |255 |
14 | 5.5
 lld-x86_64-darwin13|303 |
16 | 5.3
 llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast |457 |
24 | 5.3
 perf-x86_64-penryn-O3-polly-before-vectorizer-unprofitable |276 |
14 | 5.1
 clang-cmake-armv7-a15-full |120
|   6 | 5.0
 clang-x86_64-linux-selfhost-modules|238 |
12 | 5.0
 lldb-x86_64-ubuntu-14.04-buildserver   |162
|   8 | 4.9
 perf-x86_64-penryn-O3-polly-unprofitable   |246 |
12 | 4.9
 sanitizer-x86_64-linux-fuzzer  |179
|   8 | 4.5
 clang-cmake-thumbv7-a15|224 |
10 | 4.5
 llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast   |458 |
20 | 4.4
 clang-x86_64-linux-abi-test|417 |
18 | 4.3
 clang-cmake-armv7-a15  |185
|   8 | 4.3
 clang-x86_64-debian-fast   |150
|   6 | 4.0
 clang-native-arm-lnt

  1   2   >