diff --git a/CMakeLists.txt b/CMakeLists.txt index ab747f26c7c6..1d15a10b04bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -529,6 +529,7 @@ option(IREE_ENABLE_THIN_ARCHIVES "Enables thin ar archives (elf systems only). D option(IREE_LINK_COMPILER_SHARED_LIBRARY "Links IREE tools using the compiler compiled into a shared library" ON) option(IREE_ENABLE_WERROR_FLAG "Enable `-Werror` flag, treat error as warning" ON) option(IREE_ENABLE_POSITION_INDEPENDENT_CODE "Enable position independent code" TRUE) +option(IREE_REVERSE_ITERATION "Reverse iteration over in unordered LLVM containers" OFF) if(IREE_LINK_COMPILER_SHARED_LIBRARY AND IREE_ENABLE_COMPILER_TRACING) message(SEND_ERROR @@ -570,6 +571,10 @@ if(IREE_ENABLE_RUNTIME_COVERAGE AND NOT _UPPERCASE_CMAKE_BUILD_TYPE STREQUAL "DE message(FATAL_ERROR "IREE_ENABLE_*_COVERAGE requires building in Debug") endif() +if(IREE_REVERSE_ITERATION) + set(LLVM_ENABLE_REVERSE_ITERATION ON CACHE BOOL "" FORCE) +endif() + #------------------------------------------------------------------------------- # IREE assertions # We don't love the way this is done, but we have to line it up with how LLVM