Re: [PATCH] D20352: Add XRay flags to Clang

2016-06-26 Thread Dean Michael Berris via cfe-commits
dberris marked an inline comment as done.


Comment at: include/clang/Basic/Attr.td:432
@@ +431,3 @@
+   CXX11<"clang", "xray_always_instrument">];
+  let Subjects = SubjectList<[CXXMethod, Function], WarnDiag,
+  "ExpectedFunctionOrMethod">;

Yes it does, done.


Comment at: include/clang/Basic/Attr.td:433
@@ +432,3 @@
+  let Subjects = SubjectList<[CXXMethod, Function], WarnDiag,
+  "ExpectedFunctionOrMethod">;
+  let Documentation = [Undocumented];  // TODO(dberris): Document this!

Done the latter to include ObjC methods.


Comment at: include/clang/Basic/Attr.td:437
@@ +436,3 @@
+
+def XRayNeverInstrument : InheritableAttr {
+  let Spellings = [GNU<"xray_never_instrument">,

This actually makes a lot of sense. I've done some of the consolidation to make 
it a lot easier to check in the code and to expand later on too. I suppose 
other attributes that are XRay-specific with additional values/arguments would 
make a better candidate for additional attributes. Will cross that bridge when 
we get to that part of the implementation. :)


Comment at: include/clang/Frontend/CodeGenOptions.def:75
@@ -74,3 +74,3 @@
 CODEGENOPT(FunctionSections  , 1, 0) ///< Set when -ffunction-sections is 
enabled.
 CODEGENOPT(InstrumentFunctions , 1, 0) ///< Set when -finstrument-functions is
///< enabled.

I'm open to this idea, except this might break compatibility with GCC (as this 
seems to be a gcc-inspired flag).

I'm happy to explore consolidating the different instrumentation flags under 
`-finstrument=` which then has namespace values internally (profile-..., 
xray-...) for different modes, etc. For now the simplest thing to do might be 
to have XRay do this independently first, then have a cleanup later to 
consolidate flags on the driver and deprecate the flags.


http://reviews.llvm.org/D20352



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


Re: [PATCH] D20352: Add XRay flags to Clang

2016-06-26 Thread Dean Michael Berris via cfe-commits
dberris updated this revision to Diff 61932.
dberris marked 2 inline comments as done.
dberris added a comment.

- Address review comments; see details.


http://reviews.llvm.org/D20352

Files:
  include/clang/Basic/Attr.td
  include/clang/Basic/AttrDocs.td
  include/clang/Driver/Options.td
  include/clang/Frontend/CodeGenOptions.def
  lib/CodeGen/CodeGenFunction.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Sema/SemaDeclAttr.cpp
  test/CodeGen/xray-attributes-supported.cpp
  test/Sema/xray-always-instrument-attr.c
  test/Sema/xray-always-instrument-attr.cpp

Index: test/Sema/xray-always-instrument-attr.cpp
===
--- /dev/null
+++ test/Sema/xray-always-instrument-attr.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only -std=c++11 -x c++
+void foo [[clang::xray_always_instrument]] ();
+
+struct [[clang::xray_always_instrument]] a { int x; }; // expected-warning {{'xray_always_instrument' attribute only applies to functions and methods}}
+
+class b {
+ void c [[clang::xray_always_instrument]] ();
+};
+
+void baz [[clang::xray_always_instrument("not-supported")]] (); // expected-error {{'xray_always_instrument' attribute takes no arguments}}
Index: test/Sema/xray-always-instrument-attr.c
===
--- /dev/null
+++ test/Sema/xray-always-instrument-attr.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only -std=c11
+void foo() __attribute__((xray_always_instrument));
+
+struct __attribute__((xray_always_instrument)) a { int x; }; // expected-warning {{'xray_always_instrument' attribute only applies to functions and methods}}
+
+void bar() __attribute__((xray_always_instrument("not-supported"))); // expected-error {{'xray_always_instrument' attribute takes no arguments}}
Index: test/CodeGen/xray-attributes-supported.cpp
===
--- /dev/null
+++ test/CodeGen/xray-attributes-supported.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple x86_64-unknown-linux-gnu | FileCheck %s
+
+// Make sure that the LLVM attribute for XRay-annotated functions do show up.
+[[clang::xray_always_instrument]] void foo() {
+// CHECK: define void @_Z3foov() #0
+};
+
+[[clang::xray_never_instrument]] void bar() {
+// CHECK: define void @_Z3barv() #1
+};
+
+// CHECK: #0 = {{.*}}"function-instrument"="xray-always"
+// CHECK: #1 = {{.*}}"function-instrument"="xray-never"
Index: lib/Sema/SemaDeclAttr.cpp
===
--- lib/Sema/SemaDeclAttr.cpp
+++ lib/Sema/SemaDeclAttr.cpp
@@ -5913,10 +5913,13 @@
   case AttributeList::AT_TypeTagForDatatype:
 handleTypeTagForDatatypeAttr(S, D, Attr);
 break;
-
   case AttributeList::AT_RenderScriptKernel:
 handleSimpleAttribute(S, D, Attr);
 break;
+  // XRay attributes.
+  case AttributeList::AT_XRayInstrument:
+handleSimpleAttribute(S, D, Attr);
+break;
   }
 }
 
Index: lib/Frontend/CompilerInvocation.cpp
===
--- lib/Frontend/CompilerInvocation.cpp
+++ lib/Frontend/CompilerInvocation.cpp
@@ -685,6 +685,9 @@
   }
 
   Opts.InstrumentFunctions = Args.hasArg(OPT_finstrument_functions);
+  Opts.XRayInstrumentFunctions = Args.hasArg(OPT_fxray_instrument);
+  Opts.XRayInstructionThreshold =
+  getLastArgIntValue(Args, OPT_fxray_instruction_threshold_, 200, Diags);
   Opts.InstrumentForProfiling = Args.hasArg(OPT_pg);
   Opts.EmitOpenCLArgMetadata = Args.hasArg(OPT_cl_kernel_arg_info);
   Opts.CompressDebugSections = Args.hasArg(OPT_compress_debug_sections);
Index: lib/Driver/Tools.cpp
===
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -3178,6 +3178,28 @@
   return !StaticRuntimes.empty();
 }
 
+static bool addXRayRuntime(const ToolChain &TC, const ArgList &Args,
+   ArgStringList &CmdArgs) {
+  if (Args.hasArg(options::OPT_fxray_instrument,
+  options::OPT_fnoxray_instrument, false)) {
+CmdArgs.push_back("-whole-archive");
+CmdArgs.push_back(TC.getCompilerRTArgString(Args, "xray", false));
+CmdArgs.push_back("-no-whole-archive");
+return true;
+  }
+  return false;
+}
+
+static void linkXRayRuntimeDeps(const ToolChain &TC, ArgStringList &CmdArgs) {
+  CmdArgs.push_back("--no-as-needed");
+  CmdArgs.push_back("-lpthread");
+  CmdArgs.push_back("-lrt");
+  CmdArgs.push_back("-lm");
+  CmdArgs.push_back("-latomic");
+  if (TC.getTriple().getOS() != llvm::Triple::FreeBSD)
+CmdArgs.push_back("-ldl");
+}
+
 static bool areOptimizationsEnabled(const ArgList &Args) {
   // Find the last -O arg and see if it is non-zero.
   if (Arg *A = Args.getLastArg(options::OPT_O_Group))
@@ -4579,6 +4601,16 @@
 
   Args.AddAllArgs(CmdArgs, options::OP

Re: [PATCH] D21617: [OpenMP] Diagnose missing cases of statements between target and teams directives

2016-06-26 Thread Alexey Bataev via cfe-commits
ABataev added a comment.

LG


http://reviews.llvm.org/D21617



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


r273841 - [clang-cl] Implement support for /std

2016-06-26 Thread David Majnemer via cfe-commits
Author: majnemer
Date: Sun Jun 26 21:32:12 2016
New Revision: 273841

URL: http://llvm.org/viewvc/llvm-project?rev=273841&view=rev
Log:
[clang-cl] Implement support for /std

/std: supports two arguments, c++14 and c++latest.  Currently, c++latest
maps to c++1z but this might change down the road.

Modified:
cfe/trunk/include/clang/Driver/CLCompatOptions.td
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/cl-options.c

Modified: cfe/trunk/include/clang/Driver/CLCompatOptions.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=273841&r1=273840&r2=273841&view=diff
==
--- cfe/trunk/include/clang/Driver/CLCompatOptions.td (original)
+++ cfe/trunk/include/clang/Driver/CLCompatOptions.td Sun Jun 26 21:32:12 2016
@@ -120,6 +120,8 @@ def _SLASH_Qvec_ : CLFlag<"Qvec-">,
 def _SLASH_showIncludes : CLFlag<"showIncludes">,
   HelpText<"Print info about included files to stderr">,
   Alias;
+def _SLASH_std : CLCompileJoined<"std:">,
+  HelpText<"Language standard to compile for">;
 def _SLASH_U : CLJoinedOrSeparate<"U">, HelpText<"Undefine macro">,
   MetaVarName<"">, Alias;
 def _SLASH_W0 : CLFlag<"W0">, HelpText<"Disable all warnings">, Alias;

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=273841&r1=273840&r2=273841&view=diff
==
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sun Jun 26 21:32:12 2016
@@ -5362,10 +5362,25 @@ void Clang::ConstructJob(Compilation &C,
 
   bool IsMSVC2015Compatible = MSVT.getMajor() >= 19;
   if (ImplyVCPPCXXVer) {
-if (IsMSVC2015Compatible)
-  CmdArgs.push_back("-std=c++14");
-else
-  CmdArgs.push_back("-std=c++11");
+StringRef LanguageStandard;
+if (const Arg *StdArg = Args.getLastArg(options::OPT__SLASH_std)) {
+  LanguageStandard = llvm::StringSwitch(StdArg->getValue())
+ .Case("c++14", "-std=c++14")
+ .Case("c++latest", "-std=c++1z")
+ .Default("");
+  if (LanguageStandard.empty())
+D.Diag(clang::diag::warn_drv_unused_argument)
+<< StdArg->getAsString(Args);
+}
+
+if (LanguageStandard.empty()) {
+  if (IsMSVC2015Compatible)
+LanguageStandard = "-std=c++14";
+  else
+LanguageStandard = "-std=c++11";
+}
+
+CmdArgs.push_back(LanguageStandard.data());
   }
 
   // -fno-borland-extensions is default.

Modified: cfe/trunk/test/Driver/cl-options.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=273841&r1=273840&r2=273841&view=diff
==
--- cfe/trunk/test/Driver/cl-options.c (original)
+++ cfe/trunk/test/Driver/cl-options.c Sun Jun 26 21:32:12 2016
@@ -452,6 +452,12 @@
 // RUN: %clang_cl -fmsc-version=1900 -TP -### -- %s 2>&1 | FileCheck 
-check-prefix=CXX14 %s
 // CXX14: -std=c++14
 
+// RUN: %clang_cl -fmsc-version=1900 -TP -std:c++14 -### -- %s 2>&1 | 
FileCheck -check-prefix=STDCXX14 %s
+// STDCXX14: -std=c++14
+
+// RUN: %clang_cl -fmsc-version=1900 -TP -std:c++latest -### -- %s 2>&1 | 
FileCheck -check-prefix=STDCXXLATEST %s
+// STDCXXLATEST: -std=c++1z
+
 // RUN: env CL="/Gy" %clang_cl -### -- %s 2>&1 | FileCheck 
-check-prefix=ENV-CL %s
 // ENV-CL: "-ffunction-sections"
 


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


[PATCH] D21741: Add test for D21736 and D21737.

2016-06-26 Thread Marcin Koƛcielnicki via cfe-commits
koriakin created this revision.
koriakin added reviewers: vsk, betulb.
koriakin added a subscriber: cfe-commits.
koriakin set the repository for this revision to rL LLVM.

Repository:
  rL LLVM

http://reviews.llvm.org/D21741

Files:
  test/Profile/c-indirect-call.c
  test/Profile/cxx-indirect-call.cpp

Index: test/Profile/cxx-indirect-call.cpp
===
--- test/Profile/cxx-indirect-call.cpp
+++ test/Profile/cxx-indirect-call.cpp
@@ -1,6 +1,6 @@
 // Check the value profiling instrinsics emitted by instrumentation.
 
-// RUN: %clang_cc1 %s -o - -emit-llvm -fprofile-instrument=clang -mllvm 
-enable-value-profiling -fexceptions -fcxx-exceptions -triple 
%itanium_abi_triple | FileCheck %s
+// RUN: %clang_cc1 %s -o - -emit-llvm -fprofile-instrument=clang -mllvm 
-enable-value-profiling -fexceptions -fcxx-exceptions -triple 
x86_64-apple-macosx10.9 | FileCheck %s
 
 void (*foo) (void);
 
Index: test/Profile/c-indirect-call.c
===
--- test/Profile/c-indirect-call.c
+++ test/Profile/c-indirect-call.c
@@ -1,16 +1,22 @@
 // Check the value profiling instrinsics emitted by instrumentation.
 
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name 
c-indirect-call.c %s -o - -emit-llvm -fprofile-instrument=clang -mllvm 
-enable-value-profiling | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name 
c-indirect-call.c %s -o - -emit-llvm -fprofile-instrument=clang -mllvm 
-enable-value-profiling | FileCheck --check-prefix=NOEXT %s
+// RUN: %clang_cc1 -triple s390x-ibm-linux -main-file-name c-indirect-call.c 
%s -o - -emit-llvm -fprofile-instrument=clang -mllvm -enable-value-profiling | 
FileCheck --check-prefix=EXT %s
 
 void (*foo)(void);
 
 int main(void) {
-// CHECK:  [[REG1:%[0-9]+]] = load void ()*, void ()** @foo, align 8
-// CHECK-NEXT:  [[REG2:%[0-9]+]] = ptrtoint void ()* [[REG1]] to i64
-// CHECK-NEXT:  call void @__llvm_profile_instrument_target(i64 [[REG2]], i8* 
bitcast ({{.*}}* @__profd_main to i8*), i32 0)
-// CHECK-NEXT:  call void [[REG1]]()
+// NOEXT:  [[REG1:%[0-9]+]] = load void ()*, void ()** @foo, align 8
+// NOEXT-NEXT:  [[REG2:%[0-9]+]] = ptrtoint void ()* [[REG1]] to i64
+// NOEXT-NEXT:  call void @__llvm_profile_instrument_target(i64 [[REG2]], i8* 
bitcast ({{.*}}* @__profd_main to i8*), i32 0)
+// NOEXT-NEXT:  call void [[REG1]]()
+// EXT:  [[REG1:%[0-9]+]] = load void ()*, void ()** @foo, align 8
+// EXT-NEXT:  [[REG2:%[0-9]+]] = ptrtoint void ()* [[REG1]] to i64
+// EXT-NEXT:  call void @__llvm_profile_instrument_target(i64 [[REG2]], i8* 
bitcast ({{.*}}* @__profd_main to i8*), i32 zeroext 0)
+// EXT-NEXT:  call void [[REG1]]()
   foo();
   return 0;
 }
 
-// CHECK: declare void @__llvm_profile_instrument_target(i64, i8*, i32)
+// NOEXT: declare void @__llvm_profile_instrument_target(i64, i8*, i32)
+// EXT: declare void @__llvm_profile_instrument_target(i64, i8*, i32 zeroext)


Index: test/Profile/cxx-indirect-call.cpp
===
--- test/Profile/cxx-indirect-call.cpp
+++ test/Profile/cxx-indirect-call.cpp
@@ -1,6 +1,6 @@
 // Check the value profiling instrinsics emitted by instrumentation.
 
-// RUN: %clang_cc1 %s -o - -emit-llvm -fprofile-instrument=clang -mllvm -enable-value-profiling -fexceptions -fcxx-exceptions -triple %itanium_abi_triple | FileCheck %s
+// RUN: %clang_cc1 %s -o - -emit-llvm -fprofile-instrument=clang -mllvm -enable-value-profiling -fexceptions -fcxx-exceptions -triple x86_64-apple-macosx10.9 | FileCheck %s
 
 void (*foo) (void);
 
Index: test/Profile/c-indirect-call.c
===
--- test/Profile/c-indirect-call.c
+++ test/Profile/c-indirect-call.c
@@ -1,16 +1,22 @@
 // Check the value profiling instrinsics emitted by instrumentation.
 
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-indirect-call.c %s -o - -emit-llvm -fprofile-instrument=clang -mllvm -enable-value-profiling | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-indirect-call.c %s -o - -emit-llvm -fprofile-instrument=clang -mllvm -enable-value-profiling | FileCheck --check-prefix=NOEXT %s
+// RUN: %clang_cc1 -triple s390x-ibm-linux -main-file-name c-indirect-call.c %s -o - -emit-llvm -fprofile-instrument=clang -mllvm -enable-value-profiling | FileCheck --check-prefix=EXT %s
 
 void (*foo)(void);
 
 int main(void) {
-// CHECK:  [[REG1:%[0-9]+]] = load void ()*, void ()** @foo, align 8
-// CHECK-NEXT:  [[REG2:%[0-9]+]] = ptrtoint void ()* [[REG1]] to i64
-// CHECK-NEXT:  call void @__llvm_profile_instrument_target(i64 [[REG2]], i8* bitcast ({{.*}}* @__profd_main to i8*), i32 0)
-// CHECK-NEXT:  call void [[REG1]]()
+// NOEXT:  [[REG1:%[0-9]+]] = load void ()*, void ()** @foo, align 8
+// NOEXT-NEXT:  [[REG2:%[0-9]+]] = ptrtoint void ()* [[REG1]] to i64
+// NOEXT-NEXT:  call void @__ll

[libcxx] r273840 - Fix UB in uses_alloc_types.hpp

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 20:52:14 2016
New Revision: 273840

URL: http://llvm.org/viewvc/llvm-project?rev=273840&view=rev
Log:
Fix UB in uses_alloc_types.hpp

Modified:
libcxx/trunk/test/support/uses_alloc_types.hpp

Modified: libcxx/trunk/test/support/uses_alloc_types.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/uses_alloc_types.hpp?rev=273840&r1=273839&r2=273840&view=diff
==
--- libcxx/trunk/test/support/uses_alloc_types.hpp (original)
+++ libcxx/trunk/test/support/uses_alloc_types.hpp Sun Jun 26 20:52:14 2016
@@ -172,12 +172,12 @@ protected:
 
 private:
 template 
-static CtorAlloc const& getAllocatorFromPack(ArgumentListID, 
Args&&... args) {
+static CtorAlloc getAllocatorFromPack(ArgumentListID, Args&&... 
args) {
 return getAllocatorFromPackImp(args...);
 }
 
 template 
-static CtorAlloc const& getAllocatorFromPackImp(
+static CtorAlloc getAllocatorFromPackImp(
 typename detail::Identity::type..., CtorAlloc const& alloc) {
 return alloc;
 }


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


[PATCH 1/1] tools/clang-format: fix git-clang-format shebang

2016-06-26 Thread Austin English via cfe-commits
git-clang-format requires python2.7, but the current shebang uses
whatever is the system default, making it fail on python3 systems.

This was originally reported here:
https://bugs.gentoo.org/show_bug.cgi?id=562688

-- 
-Austin
GPG: 14FB D7EA A041 937B
From 67b271552f228bb6f92518ff13c6f89639d0a920 Mon Sep 17 00:00:00 2001
From: Austin English 
Date: Sun, 26 Jun 2016 20:30:28 -0500
Subject: [PATCH 1/1] tools/clang-format: fix git-clang-format shebang

Signed-off-by: Austin English 
---
 tools/clang-format/git-clang-format | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/clang-format/git-clang-format b/tools/clang-format/git-clang-format
index 0c45762..3cd8ab7 100755
--- a/tools/clang-format/git-clang-format
+++ b/tools/clang-format/git-clang-format
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2.7
 #
 #===- git-clang-format - ClangFormat Git Integration -*- python -*--===#
 #
-- 
2.7.3



signature.asc
Description: OpenPGP digital signature
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r273839 - Implement P0163r0. Add shared_ptr::weak_type.

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 20:02:43 2016
New Revision: 273839

URL: http://llvm.org/viewvc/llvm-project?rev=273839&view=rev
Log:
Implement P0163r0. Add shared_ptr::weak_type.

This patch adds the weak_type typedef in shared_ptr. It is available in
C++17 and newer.

This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to
have the value of 16, since 2016 is the current year.

Modified:
libcxx/trunk/include/__config
libcxx/trunk/include/memory

libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp
libcxx/trunk/test/support/test_macros.h

Modified: libcxx/trunk/include/__config
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=273839&r1=273838&r2=273839&view=diff
==
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Sun Jun 26 20:02:43 2016
@@ -756,7 +756,7 @@ template  struct __static_asse
 #  elif __cplusplus <= 201402L
 #define _LIBCPP_STD_VER 14
 #  else
-#define _LIBCPP_STD_VER 15  // current year, or date of c++17 ratification
+#define _LIBCPP_STD_VER 16  // current year, or date of c++17 ratification
 #  endif
 #endif  // _LIBCPP_STD_VER
 

Modified: libcxx/trunk/include/memory
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=273839&r1=273838&r2=273839&view=diff
==
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Sun Jun 26 20:02:43 2016
@@ -361,6 +361,7 @@ class shared_ptr
 {
 public:
 typedef T element_type;
+typedef weak_ptr weak_type; // C++17
 
 // constructors:
 constexpr shared_ptr() noexcept;
@@ -3863,6 +3864,9 @@ class _LIBCPP_TYPE_VIS_ONLY shared_ptr
 {
 public:
 typedef _Tp element_type;
+#if _LIBCPP_STD_VER > 14
+typedef weak_ptr<_Tp> weak_type;
+#endif
 private:
 element_type*  __ptr_;
 __shared_weak_count* __cntrl_;

Modified: 
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp?rev=273839&r1=273838&r2=273839&view=diff
==
--- 
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.shared/types.pass.cpp
 Sun Jun 26 20:02:43 2016
@@ -13,14 +13,20 @@
 // {
 // public:
 // typedef T element_type;
+// typedef weak_ptr weak_type; // C++17
 // ...
 // };
 
 #include 
 
+#include "test_macros.h"
+
 struct A;  // purposefully incomplete
 
 int main()
 {
 static_assert((std::is_same::element_type, A>::value), 
"");
+#if TEST_STD_VER > 14
+static_assert((std::is_same::weak_type, 
std::weak_ptr>::value), "");
+#endif
 }

Modified: libcxx/trunk/test/support/test_macros.h
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_macros.h?rev=273839&r1=273838&r2=273839&view=diff
==
--- libcxx/trunk/test/support/test_macros.h (original)
+++ libcxx/trunk/test/support/test_macros.h Sun Jun 26 20:02:43 2016
@@ -43,7 +43,7 @@
 #elif __cplusplus <= 201402L
 # define TEST_STD_VER 14
 #else
-# define TEST_STD_VER 99// greater than current standard
+# define TEST_STD_VER 16// current year; greater than current standard
 #endif
 #endif
 


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


[libcxx] r273838 - Implement p0337r0. Delete operator= for polymorphic_allocator.

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 19:55:25 2016
New Revision: 273838

URL: http://llvm.org/viewvc/llvm-project?rev=273838&view=rev
Log:
Implement p0337r0. Delete operator= for polymorphic_allocator.

Modified:
libcxx/trunk/include/experimental/memory_resource

libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp
libcxx/trunk/test/support/uses_alloc_types.hpp

Modified: libcxx/trunk/include/experimental/memory_resource
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/memory_resource?rev=273838&r1=273837&r2=273838&view=diff
==
--- libcxx/trunk/include/experimental/memory_resource (original)
+++ libcxx/trunk/include/experimental/memory_resource Sun Jun 26 19:55:25 2016
@@ -176,7 +176,7 @@ public:
 {}
 
 polymorphic_allocator &
-operator=(polymorphic_allocator const &) = default;
+operator=(polymorphic_allocator const &) = delete;
 
 // 8.6.3, memory.polymorphic.allocator.mem
 _LIBCPP_INLINE_VISIBILITY

Modified: 
libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp?rev=273838&r1=273837&r2=273838&view=diff
==
--- 
libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp
 Sun Jun 26 19:55:25 2016
@@ -24,6 +24,6 @@ namespace ex = std::experimental::pmr;
 int main()
 {
 typedef ex::polymorphic_allocator T;
-static_assert(std::is_copy_assignable::value, "");
-static_assert(std::is_move_assignable::value, "");
+static_assert(!std::is_copy_assignable::value, "");
+static_assert(!std::is_move_assignable::value, "");
 }

Modified: libcxx/trunk/test/support/uses_alloc_types.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/uses_alloc_types.hpp?rev=273838&r1=273837&r2=273838&view=diff
==
--- libcxx/trunk/test/support/uses_alloc_types.hpp (original)
+++ libcxx/trunk/test/support/uses_alloc_types.hpp Sun Jun 26 19:55:25 2016
@@ -160,26 +160,26 @@ protected:
   allocator(a)
 {}
 
-template 
+template >
 UsesAllocatorTestBase(AllocLastTag, Args&&... args)
-: args_id(nullptr),
-  constructor_called(UA_AllocLast)
+: args_id(&makeTypeID()),
+  constructor_called(UA_AllocLast),
+  allocator(getAllocatorFromPack(
+typename ArgsIDL::type{},
+std::forward(args)...))
 {
-typedef typename detail::TakeNArgs::type
-ArgIDL;
-args_id = &makeTypeID();
-getAllocatorFromPack(ArgIDL{}, std::forward(args)...);
 }
 
 private:
 template 
-void getAllocatorFromPack(ArgumentListID, Args&&... args) {
-getAllocatorFromPackImp(args...);
+static CtorAlloc const& getAllocatorFromPack(ArgumentListID, 
Args&&... args) {
+return getAllocatorFromPackImp(args...);
 }
 
 template 
-void getAllocatorFromPackImp(typename detail::Identity::type..., 
CtorAlloc const& alloc) {
-allocator = alloc;
+static CtorAlloc const& getAllocatorFromPackImp(
+typename detail::Identity::type..., CtorAlloc const& alloc) {
+return alloc;
 }
 
 const TypeID* args_id;


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


[libcxx] r273837 - Implement P0358r1. Fixes for not_fn.

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 19:40:41 2016
New Revision: 273837

URL: http://llvm.org/viewvc/llvm-project?rev=273837&view=rev
Log:
Implement P0358r1. Fixes for not_fn.

Modified:
libcxx/trunk/include/functional
libcxx/trunk/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp

Modified: libcxx/trunk/include/functional
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/functional?rev=273837&r1=273836&r2=273837&view=diff
==
--- libcxx/trunk/include/functional (original)
+++ libcxx/trunk/include/functional Sun Jun 26 19:40:41 2016
@@ -2618,18 +2618,33 @@ public:
 
 template 
 _LIBCPP_INLINE_VISIBILITY
-auto operator()(_Args&& ...__args)
+auto operator()(_Args&& ...__args) &
 noexcept(noexcept(!_VSTD::invoke(__fd, 
_VSTD::forward<_Args>(__args)...)))
 -> decltype(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
 { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
 
 template 
 _LIBCPP_INLINE_VISIBILITY
-auto operator()(_Args&& ...__args) const
+auto operator()(_Args&& ...__args) &&
+noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), 
_VSTD::forward<_Args>(__args)...)))
+-> decltype(!_VSTD::invoke(_VSTD::move(__fd), 
_VSTD::forward<_Args>(__args)...))
+{ return !_VSTD::invoke(_VSTD::move(__fd), 
_VSTD::forward<_Args>(__args)...); }
+
+template 
+_LIBCPP_INLINE_VISIBILITY
+auto operator()(_Args&& ...__args) const&
 noexcept(noexcept(!_VSTD::invoke(__fd, 
_VSTD::forward<_Args>(__args)...)))
 -> decltype(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
 { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
 
+
+template 
+_LIBCPP_INLINE_VISIBILITY
+auto operator()(_Args&& ...__args) const&&
+noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), 
_VSTD::forward<_Args>(__args)...)))
+-> decltype(!_VSTD::invoke(_VSTD::move(__fd), 
_VSTD::forward<_Args>(__args)...))
+{ return !_VSTD::invoke(_VSTD::move(__fd), 
_VSTD::forward<_Args>(__args)...); }
+
 private:
 template , 
__not_fn_imp>::value>>

Modified: 
libcxx/trunk/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp?rev=273837&r1=273836&r2=273837&view=diff
==
--- 
libcxx/trunk/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp 
(original)
+++ 
libcxx/trunk/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp 
Sun Jun 26 19:40:41 2016
@@ -88,7 +88,6 @@ struct NoExceptCallable {
   Ret value;
 };
 
-
 struct CopyAssignableWrapper {
   CopyAssignableWrapper(CopyAssignableWrapper const&) = default;
   CopyAssignableWrapper(CopyAssignableWrapper&&) = default;
@@ -124,32 +123,44 @@ struct MemFunCallable {
   bool value;
 };
 
-enum CallType {
+enum CallType : unsigned {
   CT_None,
-  CT_Const,
-  CT_NonConst
+  CT_NonConst = 1,
+  CT_Const = 2,
+  CT_LValue = 4,
+  CT_RValue = 8
 };
 
+inline constexpr CallType operator|(CallType LHS, CallType RHS) {
+return static_cast(static_cast(LHS) | 
static_cast(RHS));
+}
+
 struct ForwardingCallObject {
 
   template 
   bool operator()(Args&&... args) & {
-  set_call(CT_NonConst);
+  set_call(CT_NonConst | CT_LValue);
   return true;
   }
 
   template 
   bool operator()(Args&&... args) const & {
-  set_call(CT_Const);
+  set_call(CT_Const | CT_LValue);
   return true;
   }
 
   // Don't allow the call operator to be invoked as an rvalue.
   template 
-  bool operator()(Args&&... args) && = delete;
+  bool operator()(Args&&... args) && {
+  set_call(CT_NonConst | CT_RValue);
+  return true;
+  }
 
   template 
-  bool operator()(Args&&... args) const && = delete;
+  bool operator()(Args&&... args) const && {
+  set_call(CT_Const | CT_RValue);
+  return true;
+  }
 
   template 
   static void set_call(CallType type) {
@@ -450,52 +461,82 @@ void call_operator_forwarding_test()
 const auto& c_obj = obj;
 { // test zero args
 obj();
-assert(Fn::check_call<>(CT_NonConst));
+assert(Fn::check_call<>(CT_NonConst | CT_LValue));
+std::move(obj)();
+assert(Fn::check_call<>(CT_NonConst | CT_RValue));
 c_obj();
-assert(Fn::check_call<>(CT_Const));
+assert(Fn::check_call<>(CT_Const | CT_LValue));
+std::move(c_obj)();
+assert(Fn::check_call<>(CT_Const | CT_RValue));
 }
 { // test value categories
 int x = 42;
 const int cx = 42;
 obj(x);
-assert(Fn::check_call(CT_NonConst));
+assert(Fn::check_call(CT_NonConst | CT_LValue));
 obj(cx);
-assert(Fn::check_call(CT_NonConst));
+assert(Fn::check_call(CT_N

[libcxx] r273836 - Fix C++03 failure in enable_shared_from_this test

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 19:38:28 2016
New Revision: 273836

URL: http://llvm.org/viewvc/llvm-project?rev=273836&view=rev
Log:
Fix C++03 failure in enable_shared_from_this test

Modified:

libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp

Modified: 
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp?rev=273836&r1=273835&r2=273836&view=diff
==
--- 
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
 Sun Jun 26 19:38:28 2016
@@ -56,9 +56,10 @@ int main()
 std::shared_ptr t2(std::make_shared());
 }
 { // https://llvm.org/bugs/show_bug.cgi?id=27115
+int x = 42;
 std::shared_ptr t1(new Bar(42));
 assert(t1->shared_from_this() == t1);
-std::shared_ptr t2(std::make_shared(42));
+std::shared_ptr t2(std::make_shared(x));
 assert(t2->shared_from_this() == t2);
 }
 {


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


[libcxx] r273835 - Fix PR27115 - enable_shared_from_this does not work as a virtual base class.

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 18:56:32 2016
New Revision: 273835

URL: http://llvm.org/viewvc/llvm-project?rev=273835&view=rev
Log:
Fix PR27115 - enable_shared_from_this does not work as a virtual base class.

See https://llvm.org/bugs/show_bug.cgi?id=27115

The problem was that the conversion from
'const enable_shared_from_this*' to 'const T*' didn't work if
T inherited enable_shared_from_this as a virtual base class. The fix
is to take the original pointer passed to shared_ptr's constructor in the
__enable_weak_this method and perform an upcast to 'const T*' instead of
performing a downcast from the enable_shared_from_this base.

Modified:
libcxx/trunk/include/memory

libcxx/trunk/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp

Modified: libcxx/trunk/include/memory
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=273835&r1=273834&r2=273835&view=diff
==
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Sun Jun 26 18:56:32 2016
@@ -4115,23 +4115,22 @@ public:
 
 private:
 
-template 
+template 
 _LIBCPP_INLINE_VISIBILITY
 void
-__enable_weak_this(const enable_shared_from_this<_Yp>* __e) _NOEXCEPT
+__enable_weak_this(const enable_shared_from_this<_Yp>* __e,
+   _OrigPtr* __ptr) _NOEXCEPT
 {
+typedef typename remove_cv<_Yp>::type _RawYp;
 if (__e && __e->__weak_this_.expired())
 {
-weak_ptr<_Yp> __tmp;
-__tmp.__ptr_ = const_cast<_Yp*>(static_cast(__e));
-__tmp.__cntrl_ = __cntrl_;
-__cntrl_->__add_weak();
-__e->__weak_this_.swap(__tmp);
+__e->__weak_this_ = shared_ptr<_RawYp>(*this,
+const_cast<_RawYp*>(static_cast(__ptr)));
 }
 }
 
 _LIBCPP_INLINE_VISIBILITY
-void __enable_weak_this(const volatile void*) _NOEXCEPT {}
+void __enable_weak_this(const volatile void*, const volatile void*) 
_NOEXCEPT {}
 
 template  friend class _LIBCPP_TYPE_VIS_ONLY shared_ptr;
 template  friend class _LIBCPP_TYPE_VIS_ONLY weak_ptr;
@@ -4165,7 +4164,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p,
 typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > 
_CntrlBlk;
 __cntrl_ = new _CntrlBlk(__p, default_delete<_Yp>(), allocator<_Yp>());
 __hold.release();
-__enable_weak_this(__p);
+__enable_weak_this(__p, __p);
 }
 
 template
@@ -4180,7 +4179,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _D
 #endif  // _LIBCPP_NO_EXCEPTIONS
 typedef __shared_ptr_pointer<_Yp*, _Dp, allocator<_Yp> > _CntrlBlk;
 __cntrl_ = new _CntrlBlk(__p, __d, allocator<_Yp>());
-__enable_weak_this(__p);
+__enable_weak_this(__p, __p);
 #ifndef _LIBCPP_NO_EXCEPTIONS
 }
 catch (...)
@@ -4230,7 +4229,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _D
 ::new(static_cast(_VSTD::addressof(*__hold2.get(
 _CntrlBlk(__p, __d, __a);
 __cntrl_ = _VSTD::addressof(*__hold2.release());
-__enable_weak_this(__p);
+__enable_weak_this(__p, __p);
 #ifndef _LIBCPP_NO_EXCEPTIONS
 }
 catch (...)
@@ -4341,7 +4340,7 @@ shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp
 {
 typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > 
_CntrlBlk;
 __cntrl_ = new _CntrlBlk(__r.get(), default_delete<_Yp>(), 
allocator<_Yp>());
-__enable_weak_this(__r.get());
+__enable_weak_this(__r.get(), __r.get());
 __r.release();
 }
 
@@ -4369,7 +4368,7 @@ shared_ptr<_Tp>::shared_ptr(unique_ptr<_
 {
 typedef __shared_ptr_pointer<_Yp*, _Dp, allocator<_Yp> > _CntrlBlk;
 __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), 
allocator<_Yp>());
-__enable_weak_this(__r.get());
+__enable_weak_this(__r.get(), __r.get());
 }
 __r.release();
 }
@@ -4400,7 +4399,7 @@ shared_ptr<_Tp>::shared_ptr(unique_ptr<_
  reference_wrapper::type>,
  allocator<_Yp> > _CntrlBlk;
 __cntrl_ = new _CntrlBlk(__r.get(), ref(__r.get_deleter()), 
allocator<_Yp>());
-__enable_weak_this(__r.get());
+__enable_weak_this(__r.get(), __r.get());
 }
 __r.release();
 }
@@ -4421,7 +4420,7 @@ shared_ptr<_Tp>::make_shared(_Args&& ...
 shared_ptr<_Tp> __r;
 __r.__ptr_ = __hold2.get()->get();
 __r.__cntrl_ = __hold2.release();
-__r.__enable_weak_this(__r.__ptr_);
+__r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
 return __r;
 }
 
@@ -4440,7 +4439,7 @@ shared_ptr<_Tp>::allocate_shared(const _
 shared_ptr<_Tp> __r;
 __r.__ptr_ = __hold2.get()->get();
 __r.__cntrl_ = _VSTD::addressof(*__hold2.release());
-__r.__enable_weak_this(__r.__ptr_);
+__r.__enable_weak_this(__r.__ptr_, __r.__ptr_)

[clang-tools-extra] r273834 - clang-tools-extra/test/clang-tidy/modernize-use-using.cpp: Satisfy thiscall.

2016-06-26 Thread NAKAMURA Takumi via cfe-commits
Author: chapuni
Date: Sun Jun 26 18:56:07 2016
New Revision: 273834

URL: http://llvm.org/viewvc/llvm-project?rev=273834&view=rev
Log:
clang-tools-extra/test/clang-tidy/modernize-use-using.cpp: Satisfy thiscall.

Modified:
clang-tools-extra/trunk/test/clang-tidy/modernize-use-using.cpp

Modified: clang-tools-extra/trunk/test/clang-tidy/modernize-use-using.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-use-using.cpp?rev=273834&r1=273833&r2=273834&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/modernize-use-using.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-use-using.cpp Sun Jun 26 
18:56:07 2016
@@ -32,7 +32,7 @@ class Class {
 
 typedef void (Class::*MyPtrType)(Bla) const;
 // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef'
-// CHECK-FIXES: using MyPtrType = void (Class::*)(Bla) const;
+// CHECK-FIXES: using MyPtrType = void (Class::*)(Bla)[[ATTR:( 
__attribute__\(\(thiscall\)\))?]] const;
 
 class Iterable {
 public:
@@ -52,7 +52,7 @@ union A {};
 
 typedef void (A::*PtrType)(int, int) const;
 // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef'
-// CHECK-FIXES: using PtrType = void (A::*)(int, int) const;
+// CHECK-FIXES: using PtrType = void (A::*)(int, int)[[ATTR]] const;
 
 typedef Class some_class;
 // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef'
@@ -70,7 +70,7 @@ class cclass {};
 
 typedef void (cclass::*MyPtrType3)(Bla);
 // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef'
-// CHECK-FIXES: using MyPtrType3 = void (cclass::*)(Bla);
+// CHECK-FIXES: using MyPtrType3 = void (cclass::*)(Bla)[[ATTR]];
 
 using my_class = int;
 


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


[libcxx] r273832 - Fix C++03 build

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 18:18:23 2016
New Revision: 273832

URL: http://llvm.org/viewvc/llvm-project?rev=273832&view=rev
Log:
Fix C++03 build

Modified:

libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp

libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp

Modified: 
libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp?rev=273832&r1=273831&r2=273832&view=diff
==
--- 
libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
 (original)
+++ 
libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
 Sun Jun 26 18:18:23 2016
@@ -7,6 +7,8 @@
 //
 
//===--===//
 
+// UNSUPPORTED: c++98, c++03
+
 // 
 
 // wstring_convert

Modified: 
libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp?rev=273832&r1=273831&r2=273832&view=diff
==
--- 
libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
 Sun Jun 26 18:18:23 2016
@@ -7,6 +7,10 @@
 //
 
//===--===//
 
+// These constructors are still unavailable in C++03, but this test depends
+// on access control SFINAE and fails without it.
+// UNSUPPORTED: c++98, c++03
+
 // 
 
 // wstring_convert


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


[libcxx] r273831 - Fix PR28079 - std::wstring_convert move constructor broken.

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 17:56:26 2016
New Revision: 273831

URL: http://llvm.org/viewvc/llvm-project?rev=273831&view=rev
Log:
Fix PR28079 - std::wstring_convert move constructor broken.

The move constructor for wstring_convert accidentally copied the state member
into the converted count member in the move constructor. This patch fixes
the typo.

While working on this I discovered that wstring_convert doesn't actually
provide a move constructor according to the standard and therefore this
constructor is a libc++ extension. I'll look further into whether libc++ should
provide this constructor at all. Neither libstdc++ or MSVC's STL provide it.

Added:
libcxx/trunk/test/libcxx/localization/locales/locale.convenience/

libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/

libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/

libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp

libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
Modified:
libcxx/trunk/include/locale

Modified: libcxx/trunk/include/locale
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/locale?rev=273831&r1=273830&r2=273831&view=diff
==
--- libcxx/trunk/include/locale (original)
+++ libcxx/trunk/include/locale Sun Jun 26 17:56:26 2016
@@ -3634,7 +3634,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_a
 : __byte_err_string_(_VSTD::move(__wc.__byte_err_string_)),
   __wide_err_string_(_VSTD::move(__wc.__wide_err_string_)),
   __cvtptr_(__wc.__cvtptr_),
-  __cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtstate_)
+  __cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtcount_)
 {
 __wc.__cvtptr_ = nullptr;
 }

Added: 
libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp?rev=273831&view=auto
==
--- 
libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
 (added)
+++ 
libcxx/trunk/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
 Sun Jun 26 17:56:26 2016
@@ -0,0 +1,33 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+// 
+
+// wstring_convert
+
+// wstring_convert(wstring_convert&& other); // EXTENSION
+
+#include 
+#include 
+#include 
+
+int main()
+{
+typedef std::codecvt_utf8 Codecvt;
+typedef std::wstring_convert Myconv;
+// create a converter and perform some conversions to generate some
+// interesting state.
+Myconv myconv;
+myconv.from_bytes("\xF1\x80\x80\x83");
+const int old_converted = myconv.converted();
+assert(myconv.converted() == 4);
+// move construct a new converter and make sure the state is the same.
+Myconv myconv2(std::move(myconv));
+assert(myconv2.converted() == 4);
+}

Added: 
libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp?rev=273831&view=auto
==
--- 
libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
 (added)
+++ 
libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
 Sun Jun 26 17:56:26 2016
@@ -0,0 +1,27 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+// 
+
+// wstring_convert
+
+// wstring_convert(wstring_convert const&) = delete;
+// wstring_convert& operator=(wstring_convert const&) = delete;
+
+#include 
+#include 
+#include 
+
+int main()
+{
+typedef std::codecvt_utf8 Codecvt;
+typedef std::wstring_convert Myconv;
+static_assert(!std::is_copy_constructible::value, "");
+st

Re: [PATCH] D21737: [PATCH] [CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.

2016-06-26 Thread Anton Korobeynikov via cfe-commits
asl added a comment.

Hrm? Why I'm set to review this?


Repository:
  rL LLVM

http://reviews.llvm.org/D21737



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


Re: [PATCH] D21673: [libcxx] guard throw with exception enabling check

2016-06-26 Thread Asiri Rathnayake via cfe-commits
rmaprath added a comment.

In http://reviews.llvm.org/D21673#467317, @mclow.lists wrote:

> Just a reminder - the people who can approve patches for libc++ are 
> @mclow.lists and @ericWF.


My bad, I thought it was too trivial. Won't happen again :)

/ Asiri


Repository:
  rL LLVM

http://reviews.llvm.org/D21673



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


[PATCH] D21737: [PATCH] [CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.

2016-06-26 Thread Marcin Koƛcielnicki via cfe-commits
koriakin created this revision.
koriakin added a reviewer: asl.
koriakin added a subscriber: cfe-commits.
koriakin set the repository for this revision to rL LLVM.

Currently, TargetLibraryInfoWrapperPass is inserted by PMBuilder.
However, some passes are inserted manually before the PMBuilder
ones - if any of them happens to use TargetLibraryInfoWrapperPass,
it'll get a default-constructed one, with an unknown target triple.
This happens to InstrProfiling in D21736, breaking it.

Repository:
  rL LLVM

http://reviews.llvm.org/D21737

Files:
  lib/CodeGen/BackendUtil.cpp

Index: lib/CodeGen/BackendUtil.cpp
===
--- lib/CodeGen/BackendUtil.cpp
+++ lib/CodeGen/BackendUtil.cpp
@@ -329,7 +329,8 @@
 
   // Figure out TargetLibraryInfo.
   Triple TargetTriple(TheModule->getTargetTriple());
-  PMBuilder.LibraryInfo = createTLII(TargetTriple, CodeGenOpts);
+  std::unique_ptr TLII(
+  createTLII(TargetTriple, CodeGenOpts));
 
   switch (Inlining) {
   case CodeGenOptions::NoInlining:
@@ -364,6 +365,7 @@
   PMBuilder.RerollLoops = CodeGenOpts.RerollLoops;
 
   legacy::PassManager *MPM = getPerModulePasses();
+  MPM->add(new TargetLibraryInfoWrapperPass(*TLII));
 
   // If we are performing a ThinLTO importing compile, invoke the LTO
   // pipeline and pass down the in-memory module summary index.
@@ -454,6 +456,7 @@
 
   // Set up the per-function pass manager.
   legacy::FunctionPassManager *FPM = getPerFunctionPasses();
+  FPM->add(new TargetLibraryInfoWrapperPass(*TLII));
   if (CodeGenOpts.VerifyModule)
 FPM->add(createVerifierPass());
 


Index: lib/CodeGen/BackendUtil.cpp
===
--- lib/CodeGen/BackendUtil.cpp
+++ lib/CodeGen/BackendUtil.cpp
@@ -329,7 +329,8 @@
 
   // Figure out TargetLibraryInfo.
   Triple TargetTriple(TheModule->getTargetTriple());
-  PMBuilder.LibraryInfo = createTLII(TargetTriple, CodeGenOpts);
+  std::unique_ptr TLII(
+  createTLII(TargetTriple, CodeGenOpts));
 
   switch (Inlining) {
   case CodeGenOptions::NoInlining:
@@ -364,6 +365,7 @@
   PMBuilder.RerollLoops = CodeGenOpts.RerollLoops;
 
   legacy::PassManager *MPM = getPerModulePasses();
+  MPM->add(new TargetLibraryInfoWrapperPass(*TLII));
 
   // If we are performing a ThinLTO importing compile, invoke the LTO
   // pipeline and pass down the in-memory module summary index.
@@ -454,6 +456,7 @@
 
   // Set up the per-function pass manager.
   legacy::FunctionPassManager *FPM = getPerFunctionPasses();
+  FPM->add(new TargetLibraryInfoWrapperPass(*TLII));
   if (CodeGenOpts.VerifyModule)
 FPM->add(createVerifierPass());
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r273824 - Implement LWG 2488 - Make the placeholders constexpr.

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 16:01:34 2016
New Revision: 273824

URL: http://llvm.org/viewvc/llvm-project?rev=273824&view=rev
Log:
Implement LWG 2488 - Make the placeholders constexpr.

This patch makes the bind placeholders in std::placeholders both (1) const and
(2) constexpr (See below).

This is technically a breaking change for any code using the placeholders
outside of std::bind and depending on them being non-const. However I don't
think this will break any real world code.

(1) Previously the placeholders were non-const extern globals in all
dialects. This patch changes these extern globals to be const in all dialects.
Since the cv-qualifiers don't participate in name mangling for globals this
is an ABI compatible change.

(2) Make the placeholders constexpr in C++11 and beyond. Although LWG 2488 only
applies to C++17 I don't see any reason not to backport this change.

Modified:
libcxx/trunk/include/functional
libcxx/trunk/src/bind.cpp

libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
libcxx/trunk/www/cxx1z_status.html

Modified: libcxx/trunk/include/functional
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/functional?rev=273824&r1=273823&r2=273824&view=diff
==
--- libcxx/trunk/include/functional (original)
+++ libcxx/trunk/include/functional Sun Jun 26 16:01:34 2016
@@ -1980,16 +1980,29 @@ namespace placeholders
 
 template  struct __ph {};
 
-_LIBCPP_FUNC_VIS extern __ph<1>   _1;
-_LIBCPP_FUNC_VIS extern __ph<2>   _2;
-_LIBCPP_FUNC_VIS extern __ph<3>   _3;
-_LIBCPP_FUNC_VIS extern __ph<4>   _4;
-_LIBCPP_FUNC_VIS extern __ph<5>   _5;
-_LIBCPP_FUNC_VIS extern __ph<6>   _6;
-_LIBCPP_FUNC_VIS extern __ph<7>   _7;
-_LIBCPP_FUNC_VIS extern __ph<8>   _8;
-_LIBCPP_FUNC_VIS extern __ph<9>   _9;
-_LIBCPP_FUNC_VIS extern __ph<10> _10;
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_BIND)
+_LIBCPP_FUNC_VIS extern const __ph<1>   _1;
+_LIBCPP_FUNC_VIS extern const __ph<2>   _2;
+_LIBCPP_FUNC_VIS extern const __ph<3>   _3;
+_LIBCPP_FUNC_VIS extern const __ph<4>   _4;
+_LIBCPP_FUNC_VIS extern const __ph<5>   _5;
+_LIBCPP_FUNC_VIS extern const __ph<6>   _6;
+_LIBCPP_FUNC_VIS extern const __ph<7>   _7;
+_LIBCPP_FUNC_VIS extern const __ph<8>   _8;
+_LIBCPP_FUNC_VIS extern const __ph<9>   _9;
+_LIBCPP_FUNC_VIS extern const __ph<10> _10;
+#else
+constexpr __ph<1>   _1{};
+constexpr __ph<2>   _2{};
+constexpr __ph<3>   _3{};
+constexpr __ph<4>   _4{};
+constexpr __ph<5>   _5{};
+constexpr __ph<6>   _6{};
+constexpr __ph<7>   _7{};
+constexpr __ph<8>   _8{};
+constexpr __ph<9>   _9{};
+constexpr __ph<10> _10{};
+#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_BIND)
 
 }  // placeholders
 

Modified: libcxx/trunk/src/bind.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/bind.cpp?rev=273824&r1=273823&r2=273824&view=diff
==
--- libcxx/trunk/src/bind.cpp (original)
+++ libcxx/trunk/src/bind.cpp Sun Jun 26 16:01:34 2016
@@ -7,6 +7,7 @@
 //
 
//===--===//
 
+#define _LIBCPP_BUILDING_BIND
 #include "functional"
 
 _LIBCPP_BEGIN_NAMESPACE_STD
@@ -14,16 +15,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 namespace placeholders
 {
 
-__ph<1>   _1;
-__ph<2>   _2;
-__ph<3>   _3;
-__ph<4>   _4;
-__ph<5>   _5;
-__ph<6>   _6;
-__ph<7>   _7;
-__ph<8>   _8;
-__ph<9>   _9;
-__ph<10> _10;
+const __ph<1>   _1{};
+const __ph<2>   _2{};
+const __ph<3>   _3{};
+const __ph<4>   _4{};
+const __ph<5>   _5{};
+const __ph<6>   _6{};
+const __ph<7>   _7{};
+const __ph<8>   _8{};
+const __ph<9>   _9{};
+const __ph<10> _10{};
 
 }  // placeholders
 

Modified: 
libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp?rev=273824&r1=273823&r2=273824&view=diff
==
--- 
libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
 Sun Jun 26 16:01:34 2016
@@ -10,10 +10,14 @@
 // 
 
 // placeholders
+// The placeholders are constexpr in C++17 and beyond.
+// libc++ provides constexpr placeholders in C++11 and beyond.
 
 #include 
 #include 
 
+#include "test_macros.h"
+
 template 
 void
 test(const T& t)
@@ -28,6 +32,30 @@ test(const T& t)
 static_assert(std::is_nothrow_move_constructible::value, "");
 }
 
+#if TEST_STD_VER >= 11
+constexpr decltype(std::placeholders::_1)  default1{};
+constexpr decltype(std::placeholders::_2)  default2{};
+constexpr decltype(std::placeholders::_3)  default3{};
+con

Re: [PATCH] D21718: [libcxx] [test] Make move_assign_noexcept.pass.cpp tests more portable.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.

Please add the missing "test_macros.h" includes.


http://reviews.llvm.org/D21718



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


Re: [PATCH] D21717: [libcxx] [test] Make dtor_noexcept.pass.cpp tests more portable.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.

Please add the missing "test_macros.h" includes.


http://reviews.llvm.org/D21717



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


Re: [PATCH] D21716: [libcxx] [test] Make move_noexcept.pass.cpp tests more portable.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.

Please add the required "test_macros.h" includes.


http://reviews.llvm.org/D21716



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


Re: [PATCH] D21734: [Intrinsics][AVX512][BuiltIn] adding intrinsics for vrangesd instruction set

2016-06-26 Thread Igor Breger via cfe-commits
igorb accepted this revision.
igorb added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D21734



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


Re: [PATCH] D21715: [libcxx] [test] Make default_noexcept.pass.cpp tests more portable.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF closed this revision.
EricWF added a comment.

r273823.


http://reviews.llvm.org/D21715



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


[libcxx] r273823 - Make default_noexcept.pass.cpp container tests more portable. Patch from s...@microsoft.com

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 15:21:22 2016
New Revision: 273823

URL: http://llvm.org/viewvc/llvm-project?rev=273823&view=rev
Log:
Make default_noexcept.pass.cpp container tests more portable. Patch from 
s...@microsoft.com

Modified:

libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp

libcxx/trunk/test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp

Modified: 
libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp?rev=273823&r1=273822&r2=273823&view=diff
==
--- 
libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
 Sun Jun 26 15:21:22 2016
@@ -22,6 +22,7 @@
 #include 
 #include 
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -38,11 +39,11 @@ int main()
 typedef std::pair V;
 {
 typedef std::map C;
-static_assert(std::is_nothrow_default_constructible::value, "");
+LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible::value, 
"");
 }
 {
 typedef std::map, 
test_allocator> C;
-static_assert(std::is_nothrow_default_constructible::value, "");
+LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible::value, 
"");
 }
 {
 typedef std::map, 
other_allocator> C;

Modified: 
libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp?rev=273823&r1=273822&r2=273823&view=diff
==
--- 
libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
 Sun Jun 26 15:21:22 2016
@@ -22,6 +22,7 @@
 #include 
 #include 
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -38,11 +39,11 @@ int main()
 typedef std::pair V;
 {
 typedef std::multimap C;
-static_assert(std::is_nothrow_default_constructible::value, "");
+LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible::value, 
"");
 }
 {
 typedef std::multimap, 
test_allocator> C;
-static_assert(std::is_nothrow_default_constructible::value, "");
+LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible::value, 
"");
 }
 {
 typedef std::multimap, 
other_allocator> C;

Modified: 
libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp?rev=273823&r1=273822&r2=273823&view=diff
==
--- 
libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
 Sun Jun 26 15:21:22 2016
@@ -22,6 +22,7 @@
 #include 
 #include 
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -37,11 +38,11 @@ int main()
 {
 {
 typedef std::multiset C;
-static_assert(std::is_not

Re: [PATCH] D21715: [libcxx] [test] Make default_noexcept.pass.cpp tests more portable.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

This is missing "test_macros.h" includes, but I'll add them before committing. 
I'm sure that we pick them up through another include path, but they should be 
direct includes.


http://reviews.llvm.org/D21715



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


Re: [PATCH] D21714: [libcxx] [test] In atomics.types.generic/address.pass.cpp, use T(0) for consistency.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF closed this revision.
EricWF added a comment.

r273822.


http://reviews.llvm.org/D21714



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


[libcxx] r273822 - Work around MSVC bug in atomics.types.generic/address.pass.cpp test. Patch from s...@microsoft.com

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 14:59:11 2016
New Revision: 273822

URL: http://llvm.org/viewvc/llvm-project?rev=273822&view=rev
Log:
Work around MSVC bug in atomics.types.generic/address.pass.cpp test. Patch from 
s...@microsoft.com

Modified:
libcxx/trunk/test/std/atomics/atomics.types.generic/address.pass.cpp

Modified: libcxx/trunk/test/std/atomics/atomics.types.generic/address.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/atomics/atomics.types.generic/address.pass.cpp?rev=273822&r1=273821&r2=273822&view=diff
==
--- libcxx/trunk/test/std/atomics/atomics.types.generic/address.pass.cpp 
(original)
+++ libcxx/trunk/test/std/atomics/atomics.types.generic/address.pass.cpp Sun 
Jun 26 14:59:11 2016
@@ -123,7 +123,7 @@ do_test()
 {
 _ALIGNAS_TYPE(A) char storage[sizeof(A)] = {23};
 A& zero = *new (storage) A();
-assert(zero == 0);
+assert(zero == T(0));
 zero.~A();
 }
 }


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


Re: [PATCH] D21714: [libcxx] [test] In atomics.types.generic/address.pass.cpp, use T(0) for consistency.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

Never thrilled working around a compiler bug, but this seems harmless enough.


http://reviews.llvm.org/D21714



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


Re: [PATCH] D21713: [libcxx] [test] Use L"cat" L"dog" when concatenating string literals.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

r273821.


http://reviews.llvm.org/D21713



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


[libcxx] r273821 - Use L"cat" L"dog" when concatenating string literals. Patch from s...@microsoft.com

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 14:53:46 2016
New Revision: 273821

URL: http://llvm.org/viewvc/llvm-project?rev=273821&view=rev
Log:
Use L"cat" L"dog" when concatenating string literals. Patch from 
s...@microsoft.com

Modified:

libcxx/trunk/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp

Modified: 
libcxx/trunk/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp?rev=273821&r1=273820&r2=273821&view=diff
==
--- 
libcxx/trunk/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
 Sun Jun 26 14:53:46 2016
@@ -75,7 +75,7 @@ int main()
 }
 {
 const my_facet f(LOCALE_fr_FR_UTF_8, 1);
-const wchar_t in[] = L"Sam 31 d""\xE9""c 23:55:59 2061";
+const wchar_t in[] = L"Sam 31 d" L"\xE9" L"c 23:55:59 2061";
 err = std::ios_base::goodbit;
 t = std::tm();
 I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 
'c');
@@ -105,11 +105,11 @@ int main()
 {
 const my_facet f("ru_RU", 1);
 const wchar_t in[] = L"\x441\x443\x431\x431\x43E\x442\x430"
-  ", 31 "
-  "\x434\x435\x43A\x430\x431\x440\x44F"
-  " 2061 "
-  "\x433"
-  ". 23:55:59";
+  L", 31 "
+  L"\x434\x435\x43A\x430\x431\x440\x44F"
+  L" 2061 "
+  L"\x433"
+  L". 23:55:59";
 err = std::ios_base::goodbit;
 t = std::tm();
 I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 
'c');
@@ -140,7 +140,7 @@ int main()
 {
 const my_facet f("zh_CN", 1);
 const wchar_t in[] = L"\x516D"
-  " 12/31 23:55:59 2061";
+  L" 12/31 23:55:59 2061";
 err = std::ios_base::goodbit;
 t = std::tm();
 I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 
'c');
@@ -157,7 +157,7 @@ int main()
 #endif
 {
 const my_facet f(LOCALE_zh_CN_UTF_8, 1);
-const wchar_t in[] = L"23""\x65F6""55""\x5206""59""\x79D2";
+const wchar_t in[] = L"23" L"\x65F6" L"55" L"\x5206" L"59" L"\x79D2";
 err = std::ios_base::goodbit;
 t = std::tm();
 I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 
'X');


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


Re: [PATCH] D21629: [libcxx] [test] Add assertions to quiet analysis warnings about array bounds.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF closed this revision.
EricWF added a comment.

r273820.


http://reviews.llvm.org/D21629



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


[libcxx] r273820 - Add array bounds assertions to satisfy MSVC's /analyze flag. Patch from s...@microsoft.com

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 14:48:29 2016
New Revision: 273820

URL: http://llvm.org/viewvc/llvm-project?rev=273820&view=rev
Log:
Add array bounds assertions to satisfy MSVC's /analyze flag. Patch from 
s...@microsoft.com

Modified:

libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp

libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp

libcxx/trunk/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp

Modified: 
libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp?rev=273820&r1=273819&r2=273820&view=diff
==
--- 
libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp
 Sun Jun 26 14:48:29 2016
@@ -22,13 +22,17 @@ void
 test_larger_sorts(unsigned N, unsigned M)
 {
 assert(N != 0);
+assert(N >= M);
 int* array = new int[N];
 for (int i = 0; i < N; ++i)
 array[i] = i;
 std::random_shuffle(array, array+N);
 std::partial_sort(array, array+M, array+N);
 for (int i = 0; i < M; ++i)
+{
+assert(i < N); // quiet analysis warnings
 assert(array[i] == i);
+}
 delete [] array;
 }
 

Modified: 
libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp?rev=273820&r1=273819&r2=273820&view=diff
==
--- 
libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
 Sun Jun 26 14:48:29 2016
@@ -35,13 +35,17 @@ void
 test_larger_sorts(unsigned N, unsigned M)
 {
 assert(N != 0);
+assert(N >= M);
 int* array = new int[N];
 for (int i = 0; i < N; ++i)
 array[i] = i;
 std::random_shuffle(array, array+N);
 std::partial_sort(array, array+M, array+N, std::greater());
 for (int i = 0; i < M; ++i)
+{
+assert(i < N); // quiet analysis warnings
 assert(array[i] == N-i-1);
+}
 delete [] array;
 }
 

Modified: 
libcxx/trunk/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp?rev=273820&r1=273819&r2=273820&view=diff
==
--- 
libcxx/trunk/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
 Sun Jun 26 14:48:29 2016
@@ -243,6 +243,7 @@ test4()
 a = 0;
 for (int j = 0; j < k; ++j)
 a += areas[j];
+assert(k < Np);
 m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
 bk = b[k];
 c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
@@ -281,6 +282,7 @@ test5()
 double S = 0;
 for (int i = 0; i < areas.size(); ++i)
 {
+assert(i < Np);
 areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
 S += areas[i];
 }
@@ -296,6 +298,7 @@ test5()
 a = 0;
 for (int j = 0; j < k; ++j)
 a += areas[j];
+assert(k < Np);
 m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
 bk = b[k];
 c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);


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


Re: [PATCH] D21625: [libcxx] [test] Mark throw_bad_alloc_helper() as [[noreturn]].

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

Accepting before closing.
I committed something similar in r273819. Please let me know if it doesn't work.


http://reviews.llvm.org/D21625



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


[libcxx] r273819 - Add [[noreturn]] attribute to throw_bad_alloc_helper().

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 14:42:59 2016
New Revision: 273819

URL: http://llvm.org/viewvc/llvm-project?rev=273819&view=rev
Log:
Add [[noreturn]] attribute to throw_bad_alloc_helper().

Modified:
libcxx/trunk/test/support/count_new.hpp
libcxx/trunk/test/support/test_macros.h

Modified: libcxx/trunk/test/support/count_new.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/count_new.hpp?rev=273819&r1=273818&r2=273819&view=diff
==
--- libcxx/trunk/test/support/count_new.hpp (original)
+++ libcxx/trunk/test/support/count_new.hpp Sun Jun 26 14:42:59 2016
@@ -16,14 +16,13 @@
 
 #include "test_macros.h"
 
-#if  TEST_HAS_FEATURE(address_sanitizer) \
-  || TEST_HAS_FEATURE(memory_sanitizer) \
-  || TEST_HAS_FEATURE(thread_sanitizer)
+#if defined(TEST_HAS_SANITIZERS)
 #define DISABLE_NEW_COUNT
 #endif
 
 namespace detail
 {
+   TEST_NORETURN
inline void throw_bad_alloc_helper() {
 #ifndef TEST_HAS_NO_EXCEPTIONS
throw std::bad_alloc();

Modified: libcxx/trunk/test/support/test_macros.h
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_macros.h?rev=273819&r1=273818&r2=273819&view=diff
==
--- libcxx/trunk/test/support/test_macros.h (original)
+++ libcxx/trunk/test/support/test_macros.h Sun Jun 26 14:42:59 2016
@@ -86,6 +86,12 @@
 #define TEST_HAS_SANITIZERS
 #endif
 
+#if defined(_LIBCPP_NORETURN)
+#define TEST_NORETURN _LIBCPP_NORETURN
+#else
+#define TEST_NORETURN [[noreturn]]
+#endif
+
 /* Macros for testing libc++ specific behavior and extensions */
 #if defined(_LIBCPP_VERSION)
 #define LIBCPP_ASSERT(...) assert(__VA_ARGS__)


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


Re: [PATCH] D21625: [libcxx] [test] Mark throw_bad_alloc_helper() as [[noreturn]].

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF added a comment.

I don't think all the compilers libc++ tests with support `[[noreturn]]` yet. 
I'll commit a similar patch to this though.


http://reviews.llvm.org/D21625



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


[libcxx] r273818 - Avoid narrowing conversions in quoted test. Patch from s...@microsoft.com

2016-06-26 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Jun 26 14:37:23 2016
New Revision: 273818

URL: http://llvm.org/viewvc/llvm-project?rev=273818&view=rev
Log:
Avoid narrowing conversions in quoted test. Patch from s...@microsoft.com

Modified:

libcxx/trunk/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp

Modified: 
libcxx/trunk/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp?rev=273818&r1=273817&r2=273818&view=diff
==
--- 
libcxx/trunk/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp 
(original)
+++ 
libcxx/trunk/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp 
Sun Jun 26 14:37:23 2016
@@ -65,7 +65,7 @@ void round_trip_ws ( const CharT *p ) {
 template >
 void round_trip_d ( const CharT *p, char delim ) {
 std::basic_stringstream ss;
-CharT d{delim};
+CharT d(delim);
 
 ss << std::quoted(p, d);
 std::basic_string s;
@@ -76,7 +76,7 @@ void round_trip_d ( const CharT *p, char
 template >
 void round_trip_e ( const CharT *p, char escape ) {
 std::basic_stringstream ss;
-CharT e{escape};
+CharT e(escape);
 
 ss << std::quoted(p, CharT('"'), e );
 std::basic_string s;
@@ -88,8 +88,8 @@ void round_trip_e ( const CharT *p, char
 template >
 std::basic_string quote ( const CharT *p, char delim='"', char 
escape='\\' ) {
 std::basic_stringstream ss;
-CharT d{delim};
-CharT e{escape};
+CharT d(delim);
+CharT e(escape);
 ss << std::quoted(p, d, e);
 std::basic_string s;
 ss >> s;// no quote
@@ -101,8 +101,8 @@ std::basic_string unquote
 std::basic_stringstream ss;
 ss << p;
 
-CharT d{delim};
-CharT e{escape};
+CharT d(delim);
+CharT e(escape);
 std::basic_string s;
 ss >> std::quoted(s, d, e);
 return s;


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


Re: [PATCH] D21712: [libcxx] [test] Avoid narrowing conversions in quoted.pass.cpp.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF closed this revision.
EricWF added a comment.

r273818.


http://reviews.llvm.org/D21712



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


Re: [PATCH] D21712: [libcxx] [test] Avoid narrowing conversions in quoted.pass.cpp.

2016-06-26 Thread Eric Fiselier via cfe-commits
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

It seems like this has the possibility to lose some useful diagnostics if a 
narrowing conversion actually occurs.
However I'm OK with the change.


http://reviews.llvm.org/D21712



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


Re: [clang-tools-extra] r273786 - [clang-tidy] Add modernize-use-using

2016-06-26 Thread Miklos Vajna via cfe-commits
Hi,

On Sat, Jun 25, 2016 at 06:37:54PM -, Krystyna Gajczyk via cfe-commits 
 wrote:
> Author: krystynka
> Date: Sat Jun 25 13:37:53 2016
> New Revision: 273786
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=273786&view=rev
> Log:
> [clang-tidy] Add modernize-use-using

Thanks, sounds like a useful check. :-) I just run it on a codebase that
uses cppunit for testing, and it turns out cppunit provides a number of
macros, that expand to typedefs. The macros are provided by system
headers, so it's not easy to change them. Is it possible to filter out
warnings that appear in code that's expanded from system headers?
Example:

/git/dotfiles/.vim/bundle/libclang-vim/qa/deduction.cpp:8:5: error: use 'using' 
instead of 'typedef' [modernize-use-using,-warnings-as-errors]
CPPUNIT_TEST_SUITE(deduction_test);
^
/usr/include/cppunit/extensions/HelperMacros.h:102:5: note: expanded from macro 
'CPPUNIT_TEST_SUITE'
typedef ATestFixtureType TestFixtureType;   \
^

If the problem is not clear enough, I'm happy to put together a
self-contained example, and file a bugreport if it helps.

Thanks,

Miklos


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


Re: [PATCH] D21642: [clang-tidy] boost-use-to-string arg expr location bugfix

2016-06-26 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG with a couple of nits.



Comment at: test/clang-tidy/boost-use-to-string.cpp:154
@@ +153,3 @@
+  float floating;
+  Fields* wierd;
+  const int &getConstInteger() const {return integer;}

"wierd" is weird ;)


Comment at: test/clang-tidy/boost-use-to-string.cpp:161
@@ +160,3 @@
+  auto s1 = boost::lexical_cast(fields.integer);
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: use std::to_string{{..}}
+  // CHECK-FIXES: auto s1 = std::to_string(fields.integer);

nit: The `{{..}}` part doesn't seem to be useful. Above as well.


http://reviews.llvm.org/D21642



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


Re: [PATCH] D21504: [X86] add _mm_loadu_si64

2016-06-26 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL273812: [X86] add _mm_loadu_si64 (authored by abadouh).

Changed prior to commit:
  http://reviews.llvm.org/D21504?vs=61903&id=61912#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21504

Files:
  cfe/trunk/lib/Headers/emmintrin.h
  cfe/trunk/test/CodeGen/sse2-builtins.c

Index: cfe/trunk/test/CodeGen/sse2-builtins.c
===
--- cfe/trunk/test/CodeGen/sse2-builtins.c
+++ cfe/trunk/test/CodeGen/sse2-builtins.c
@@ -1532,3 +1532,12 @@
   // CHECK: xor <2 x i64> %{{.*}}, %{{.*}}
   return _mm_xor_si128(A, B);
 }
+
+__m128i test_mm_loadu_si64(void const* A) {
+  // CHECK-LABEL: test_mm_loadu_si64
+  // CHECK: load i64, i64* %{{.*}}, align 1{{$}}
+  // CHECK: insertelement <2 x i64> undef, i64 %{{.*}}, i32 0
+  // CHECK: insertelement <2 x i64> %{{.*}}, i64 0, i32 1
+  return _mm_loadu_si64(A);
+}
+
Index: cfe/trunk/lib/Headers/emmintrin.h
===
--- cfe/trunk/lib/Headers/emmintrin.h
+++ cfe/trunk/lib/Headers/emmintrin.h
@@ -505,6 +505,16 @@
   return ((struct __loadu_pd*)__dp)->__v;
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_loadu_si64(void const *__a)
+{
+  struct __loadu_si64 {
+long long __v;
+  } __attribute__((__packed__, __may_alias__));
+  long long __u = ((struct __loadu_si64*)__a)->__v;
+  return (__m128i){__u, 0L};
+}
+
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_load_sd(double const *__dp)
 {


Index: cfe/trunk/test/CodeGen/sse2-builtins.c
===
--- cfe/trunk/test/CodeGen/sse2-builtins.c
+++ cfe/trunk/test/CodeGen/sse2-builtins.c
@@ -1532,3 +1532,12 @@
   // CHECK: xor <2 x i64> %{{.*}}, %{{.*}}
   return _mm_xor_si128(A, B);
 }
+
+__m128i test_mm_loadu_si64(void const* A) {
+  // CHECK-LABEL: test_mm_loadu_si64
+  // CHECK: load i64, i64* %{{.*}}, align 1{{$}}
+  // CHECK: insertelement <2 x i64> undef, i64 %{{.*}}, i32 0
+  // CHECK: insertelement <2 x i64> %{{.*}}, i64 0, i32 1
+  return _mm_loadu_si64(A);
+}
+
Index: cfe/trunk/lib/Headers/emmintrin.h
===
--- cfe/trunk/lib/Headers/emmintrin.h
+++ cfe/trunk/lib/Headers/emmintrin.h
@@ -505,6 +505,16 @@
   return ((struct __loadu_pd*)__dp)->__v;
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_loadu_si64(void const *__a)
+{
+  struct __loadu_si64 {
+long long __v;
+  } __attribute__((__packed__, __may_alias__));
+  long long __u = ((struct __loadu_si64*)__a)->__v;
+  return (__m128i){__u, 0L};
+}
+
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_load_sd(double const *__dp)
 {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r273812 - [X86] add _mm_loadu_si64

2016-06-26 Thread Asaf Badouh via cfe-commits
Author: abadouh
Date: Sun Jun 26 08:51:54 2016
New Revision: 273812

URL: http://llvm.org/viewvc/llvm-project?rev=273812&view=rev
Log:
[X86] add _mm_loadu_si64

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

Modified:
cfe/trunk/lib/Headers/emmintrin.h
cfe/trunk/test/CodeGen/sse2-builtins.c

Modified: cfe/trunk/lib/Headers/emmintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/emmintrin.h?rev=273812&r1=273811&r2=273812&view=diff
==
--- cfe/trunk/lib/Headers/emmintrin.h (original)
+++ cfe/trunk/lib/Headers/emmintrin.h Sun Jun 26 08:51:54 2016
@@ -505,6 +505,16 @@ _mm_loadu_pd(double const *__dp)
   return ((struct __loadu_pd*)__dp)->__v;
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_loadu_si64(void const *__a)
+{
+  struct __loadu_si64 {
+long long __v;
+  } __attribute__((__packed__, __may_alias__));
+  long long __u = ((struct __loadu_si64*)__a)->__v;
+  return (__m128i){__u, 0L};
+}
+
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_load_sd(double const *__dp)
 {

Modified: cfe/trunk/test/CodeGen/sse2-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=273812&r1=273811&r2=273812&view=diff
==
--- cfe/trunk/test/CodeGen/sse2-builtins.c (original)
+++ cfe/trunk/test/CodeGen/sse2-builtins.c Sun Jun 26 08:51:54 2016
@@ -1532,3 +1532,12 @@ __m128i test_mm_xor_si128(__m128i A, __m
   // CHECK: xor <2 x i64> %{{.*}}, %{{.*}}
   return _mm_xor_si128(A, B);
 }
+
+__m128i test_mm_loadu_si64(void const* A) {
+  // CHECK-LABEL: test_mm_loadu_si64
+  // CHECK: load i64, i64* %{{.*}}, align 1{{$}}
+  // CHECK: insertelement <2 x i64> undef, i64 %{{.*}}, i32 0
+  // CHECK: insertelement <2 x i64> %{{.*}}, i64 0, i32 1
+  return _mm_loadu_si64(A);
+}
+


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


Re: [PATCH] D21145: [Sema] Fix crash on valid where instantiation of lambda cannot access type of 'this'

2016-06-26 Thread Faisal Vali via cfe-commits
faisalv accepted this revision.
faisalv added a comment.
This revision is now accepted and ready to land.

With the assert, I would feel comfortable committing the patch.  It always 
helps to get Richard's approval too - so feel free to ping him aggressively to 
see if he's interested in stopping it from being committed.

Also, I spoke with Richard & Hubert briefly at the Standards meeting in Oulu 
about dropping CXXThisTypeOverride - they're not sure whether we can entirely 
drop it (because of noexcept operands and trailing return types) without some 
other ugliness - but I'll try and investigate  that at some point (unless 
you're interested in looking into it).

Thanks again Erik!



Comment at: lib/Sema/SemaExprCXX.cpp:971
@@ +970,3 @@
+  if (ThisTy.isNull() && isLambdaCallOperator(CurContext) &&
+  !ActiveTemplateInstantiations.empty()) {
+

I wouldn't mind an assertion here that 'DC' is a CXXRecordDecl if you think 
this branch can only be triggered if that's the case.  Like you, I can't 
readily think of a case where getCurrentThisType would need to be called while 
'transforming' or 'parsing' a lambda and getFunctionLevelDeclContext would not 
return either a CXXMethorDecl or a CXXRecordDecl (assuming ThisTy is null).  


http://reviews.llvm.org/D21145



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


Re: [PATCH] D20349: Fix a clang bug in lambda capture of 'this'

2016-06-26 Thread Faisal Vali via cfe-commits
faisalv resigned from this revision.
faisalv removed a reviewer: faisalv.
faisalv added a comment.

Should be fixed by: http://reviews.llvm.org/D19783.

Thanks again for your feedback and all the time you put into this =)


http://reviews.llvm.org/D20349



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


[PATCH] D21734: [Intrinsics][AVX512][BuiltIn] adding intrinsics for vrangesd instruction set

2016-06-26 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/D21734

Files:
  lib/Headers/avx512dqintrin.h
  test/CodeGen/avx512dq-builtins.c

Index: test/CodeGen/avx512dq-builtins.c
===
--- test/CodeGen/avx512dq-builtins.c
+++ test/CodeGen/avx512dq-builtins.c
@@ -671,6 +671,42 @@
   return _mm_maskz_range_round_ss(__U, __A, __B, 4, 8); 
 }
 
+__m128d test_mm_range_sd(__m128d __A, __m128d __B) {
+  // CHECK-LABEL: @test_mm_range_sd
+  // CHECK: @llvm.x86.avx512.mask.range.sd
+  return _mm_range_sd(__A, __B, 4); 
+}
+
+__m128d test_mm_mask_range_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B) {
+  // CHECK-LABEL: test_mm_mask_range_sd
+  // CHECK: @llvm.x86.avx512.mask.range.sd
+  return _mm_mask_range_sd(__W, __U, __A, __B, 4); 
+}
+
+__m128d test_mm_maskz_range_sd(__mmask8 __U, __m128d __A, __m128d __B) {
+  // CHECK-LABEL: @test_mm_maskz_range_sd
+  // CHECK: @llvm.x86.avx512.mask.range.sd
+  return _mm_maskz_range_sd(__U, __A, __B, 4); 
+}
+
+__m128d test_mm_range_ss(__m128d __A, __m128d __B) {
+  // CHECK-LABEL: @test_mm_range_ss
+  // CHECK: @llvm.x86.avx512.mask.range.ss
+  return _mm_range_ss(__A, __B, 4); 
+}
+
+__m128d test_mm_mask_range_ss(__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) {
+  // CHECK-LABEL: @test_mm_mask_range_ss
+  // CHECK: @llvm.x86.avx512.mask.range.ss
+  return _mm_mask_range_ss(__W, __U, __A, __B, 4); 
+}
+
+__m128 test_mm_maskz_range_ss(__mmask8 __U, __m128 __A, __m128 __B) {
+  // CHECK-LABEL: @test_mm_maskz_range_ss
+  // CHECK: @llvm.x86.avx512.mask.range.ss
+  return _mm_maskz_range_ss(__U, __A, __B, 4); 
+}
+
 __m512 test_mm512_range_ps(__m512 __A, __m512 __B) {
   // CHECK-LABEL: @test_mm512_range_ps
   // CHECK: @llvm.x86.avx512.mask.range.ps.512
Index: lib/Headers/avx512dqintrin.h
===
--- lib/Headers/avx512dqintrin.h
+++ lib/Headers/avx512dqintrin.h
@@ -792,41 +792,53 @@
(__mmask8) -1, (int)(C),\
(int)(R)); })
 
+#define _mm_range_ss(A ,B , C) _mm_range_round_ss(A, B, C ,_MM_FROUND_CUR_DIRECTION)
+
 #define _mm_mask_range_round_ss(W, U, A, B, C, R) __extension__ ({ \
   (__m128)__builtin_ia32_rangess128_round_mask((__v4sf)(__m128)(A), \
(__v4sf)(__m128)(B), \
(__v4sf)(__m128)(W),\
(__mmask8)(U), (int)(C),\
(int)(R)); })
 
+#define _mm_mask_range_ss(W , U, A, B, C) _mm_mask_range_round_ss(W, U, A, B, C , _MM_FROUND_CUR_DIRECTION)
+
 #define _mm_maskz_range_round_ss(U, A, B, C, R) __extension__ ({ \
   (__m128)__builtin_ia32_rangess128_round_mask((__v4sf)(__m128)(A), \
(__v4sf)(__m128)(B), \
(__v4sf)_mm_setzero_ps(), \
(__mmask8)(U), (int)(C),\
(int)(R)); })
 
+#define _mm_maskz_range_ss(U, A ,B , C) _mm_maskz_range_round_ss(U, A, B, C ,_MM_FROUND_CUR_DIRECTION)
+
 #define _mm_range_round_sd(A, B, C, R) __extension__ ({   \
   (__m128d)__builtin_ia32_rangesd128_round_mask((__v2df)(__m128d)(A), \
 (__v2df)(__m128d)(B), \
 (__v2df)_mm_setzero_pd(), \
 (__mmask8) -1, (int)(C),\
 (int)(R)); })
 
+#define _mm_range_sd(A ,B , C) _mm_range_round_sd(A, B, C ,_MM_FROUND_CUR_DIRECTION)
+
 #define _mm_mask_range_round_sd(W, U, A, B, C, R) __extension__ ({ \
   (__m128d)__builtin_ia32_rangesd128_round_mask((__v2df)(__m128d)(A), \
 (__v2df)(__m128d)(B), \
 (__v2df)(__m128d)(W),\
 (__mmask8)(U), (int)(C),\
 (int)(R)); })
 
+#define _mm_mask_range_sd(W, U, A, B, C) _mm_mask_range_round_sd(W, U, A, B, C ,_MM_FROUND_CUR_DIRECTION)
+
 #define _mm_maskz_range_round_sd(U, A, B, C, R) __extension__ ({ \
   (__m128d)__builtin_ia32_rangesd128_round_mask((__v2df)(__m128d)(A), \
 (__v2df)(__m128d)(B), \
 (__v2df)_mm_setzero_pd(), \
 (__mmask8)(U), (int)(C),\
 (int)(R)); })
 
+#define _mm_maskz_range_sd(U, A, B, C) _mm_maskz_range_round_sd(U, A, B, C ,_MM_FROUND_CUR_DIRECTION)
+
 #define _mm512_reduce_pd(A, B) __ext

Re: [PATCH] D21504: [X86] add _mm_loadu_si64

2016-06-26 Thread Simon Pilgrim via cfe-commits
RKSimon accepted this revision.
RKSimon added a reviewer: RKSimon.
RKSimon added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rL LLVM

http://reviews.llvm.org/D21504



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


Re: [PATCH] D21504: [X86] add _mm_loadu_si64

2016-06-26 Thread Asaf Badouh via cfe-commits
AsafBadouh updated this revision to Diff 61903.

Repository:
  rL LLVM

http://reviews.llvm.org/D21504

Files:
  tools/clang/lib/Headers/emmintrin.h
  tools/clang/test/CodeGen/sse2-builtins.c

Index: tools/clang/lib/Headers/emmintrin.h
===
--- tools/clang/lib/Headers/emmintrin.h
+++ tools/clang/lib/Headers/emmintrin.h
@@ -505,6 +505,16 @@
   return ((struct __loadu_pd*)__dp)->__v;
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_loadu_si64(void const *__a)
+{
+  struct __loadu_si64 {
+long long __v;
+  } __attribute__((__packed__, __may_alias__));
+  long long __u = ((struct __loadu_si64*)__a)->__v;
+  return (__m128i){__u, 0L};
+}
+
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_load_sd(double const *__dp)
 {
Index: tools/clang/test/CodeGen/sse2-builtins.c
===
--- tools/clang/test/CodeGen/sse2-builtins.c
+++ tools/clang/test/CodeGen/sse2-builtins.c
@@ -1520,3 +1520,12 @@
   // CHECK: xor <2 x i64> %{{.*}}, %{{.*}}
   return _mm_xor_si128(A, B);
 }
+
+__m128i test_mm_loadu_si64(void const* A) {
+  // CHECK-LABEL: test_mm_loadu_si64
+  // CHECK: load i64, i64* %{{.*}}, align 1{{$}}
+  // CHECK: insertelement <2 x i64> undef, i64 %{{.*}}, i32 0
+  // CHECK: insertelement <2 x i64> %{{.*}}, i64 0, i32 1
+  return _mm_loadu_si64(A);
+}
+


Index: tools/clang/lib/Headers/emmintrin.h
===
--- tools/clang/lib/Headers/emmintrin.h
+++ tools/clang/lib/Headers/emmintrin.h
@@ -505,6 +505,16 @@
   return ((struct __loadu_pd*)__dp)->__v;
 }
 
+static __inline__ __m128i __DEFAULT_FN_ATTRS
+_mm_loadu_si64(void const *__a)
+{
+  struct __loadu_si64 {
+long long __v;
+  } __attribute__((__packed__, __may_alias__));
+  long long __u = ((struct __loadu_si64*)__a)->__v;
+  return (__m128i){__u, 0L};
+}
+
 static __inline__ __m128d __DEFAULT_FN_ATTRS
 _mm_load_sd(double const *__dp)
 {
Index: tools/clang/test/CodeGen/sse2-builtins.c
===
--- tools/clang/test/CodeGen/sse2-builtins.c
+++ tools/clang/test/CodeGen/sse2-builtins.c
@@ -1520,3 +1520,12 @@
   // CHECK: xor <2 x i64> %{{.*}}, %{{.*}}
   return _mm_xor_si128(A, B);
 }
+
+__m128i test_mm_loadu_si64(void const* A) {
+  // CHECK-LABEL: test_mm_loadu_si64
+  // CHECK: load i64, i64* %{{.*}}, align 1{{$}}
+  // CHECK: insertelement <2 x i64> undef, i64 %{{.*}}, i32 0
+  // CHECK: insertelement <2 x i64> %{{.*}}, i64 0, i32 1
+  return _mm_loadu_si64(A);
+}
+
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits