[PATCH] D33908: [cmake] Enable reverse iteration by default through build macro

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 17:36:46 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL304757: [cmake] Enable reverse iteration by default through build macro (authored by mgrang).

Changed prior to commit:
  https://reviews.llvm.org/D33908?vs=101442&id=101489#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D33908

Files:
  llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
  llvm/trunk/include/llvm/ADT/SmallPtrSet.h
  llvm/trunk/include/llvm/Config/abi-breaking.h.cmake


Index: llvm/trunk/include/llvm/ADT/SmallPtrSet.h
===================================================================
--- llvm/trunk/include/llvm/ADT/SmallPtrSet.h
+++ llvm/trunk/include/llvm/ADT/SmallPtrSet.h
@@ -31,8 +31,12 @@
 
 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
 template <class T = void> struct ReverseIterate { static bool value; };
+#if LLVM_ENABLE_REVERSE_ITERATION
+template <class T> bool ReverseIterate<T>::value = true;
+#else
 template <class T> bool ReverseIterate<T>::value = false;
 #endif
+#endif
 
 /// SmallPtrSetImplBase - This is the common code shared among all the
 /// SmallPtrSet<>'s, which is almost everything.  SmallPtrSet has two modes, one
Index: llvm/trunk/include/llvm/Config/abi-breaking.h.cmake
===================================================================
--- llvm/trunk/include/llvm/Config/abi-breaking.h.cmake
+++ llvm/trunk/include/llvm/Config/abi-breaking.h.cmake
@@ -15,6 +15,9 @@
 /* Define to enable checks that alter the LLVM C++ ABI */
 #cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS
 
+/* Define to enable reverse iteration of unordered llvm containers */
+#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION
+
 /* Allow selectively disabling link-time mismatch checking so that header-only
    ADT content from LLVM can be used without linking libSupport. */
 #if !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
Index: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
@@ -101,6 +101,10 @@
   message(FATAL_ERROR "Unknown value for LLVM_ABI_BREAKING_CHECKS: \"${LLVM_ABI_BREAKING_CHECKS}\"!")
 endif()
 
+if( LLVM_REVERSE_ITERATION )
+  set( LLVM_ENABLE_REVERSE_ITERATION 1 )
+endif()
+
 if(WIN32)
   set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
   if(CYGWIN)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33908.101489.patch
Type: text/x-patch
Size: 1867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170606/02360c0c/attachment.bin>


More information about the llvm-commits mailing list