ReverseIteration.h 529 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. #ifndef LLVM_SUPPORT_REVERSEITERATION_H
  7. #define LLVM_SUPPORT_REVERSEITERATION_H
  8. #include "llvm/Config/abi-breaking.h"
  9. #include "llvm/Support/PointerLikeTypeTraits.h"
  10. namespace llvm {
  11. template<class T = void *>
  12. bool shouldReverseIterate() {
  13. #if LLVM_ENABLE_REVERSE_ITERATION
  14. return detail::IsPointerLike<T>::value;
  15. #else
  16. return false;
  17. #endif
  18. }
  19. }
  20. #endif
  21. #ifdef __GNUC__
  22. #pragma GCC diagnostic pop
  23. #endif