[PATCH] D26718: [llvm] Iterate SmallPtrSet in reverse order to uncover non-determinism in codegen

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 17:59:26 PST 2016


mehdi_amini added inline comments.


================
Comment at: include/llvm/ADT/SmallPtrSet.h:31
+template <class T = void> struct ReverseIterate { static bool value; };
+template <class T> bool ReverseIterate<T>::value = false;
+}
----------------
Wasn't it the goal of this to have it enabled by default in assert builds?


================
Comment at: lib/Support/CommandLine.cpp:55
+template <class T = void> struct ReverseIterate { static bool value; };
+template <class T> bool ReverseIterate<T>::value = false;
+static cl::opt<bool, true> ReverseIteration("reverse-iterate",
----------------
You don't need the redefinition here I think (unless libSupport never imports SmallPtrSet?)



================
Comment at: unittests/ADT/CMakeLists.txt:67
+if(DEFINED LLVM_ENABLE_ABI_BREAKING_CHECKS)
+  add_definitions(-DLLVM_ENABLE_ABI_BREAKING_CHECKS)
+  list(APPEND ADTSources ReverseIterationTest.cpp)
----------------
mgrang wrote:
> Without explicitly passing LLVM_ENABLE_ABI_BREAKING_CHECKS to the compilation line of ReverseIteration.cpp, it always complains about undefined variable "ReverseIterate".
That's not great, but I don't see a better way right now, can you at least document it in file here?


https://reviews.llvm.org/D26718





More information about the llvm-commits mailing list