Go to file
Tobias Grosser 75aa1a9a49 Use isl C++ foreach implementation
This commit switches Polly over to the isl::obj::foreach_* implementation, which
is part of the new isl bindings and follows the foreach pattern established in
Polly by Michael Kruse.

The original isl C function:

  isl_stat isl_union_set_foreach_set(__isl_keep isl_union_set *uset,
      isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user);

which required the user to define a static callback function to which all
interesting parameters are passed via a 'void *' user-pointer, is on the
C++ side available as a function that takes a std::function<>, which can
carry any additional arguments without the need for a user pointer:

  stat UnionSet::foreach_set(const std::function<stat(set)> &fn) const;

The following code illustrates the use of the new C++ interface:

  auto Lambda = [=, &Result](isl::set Set) -> isl::stat {
    auto Shifted = shiftDimension(Set, Pos, Amount);
    Result = Result.add(Shifted);
    return isl::stat::ok;
  }

  UnionSet.foreach_set(Lambda);

Polly had some specialized foreach functions which did not require the lambdas
to return a status flag. We remove these functions in this commit to move Polly
completely over to the new isl interface. We may in the future discuss if
functors without return values can be supported easily.

Another extension proposed by Michael Kruse is the use of C++ iterators to allow
the use of normal for loops to iterate over these sets. Such an extension would
allow us to further simplify the code.

Reviewed-by: Michael Kruse <llvm@meinersbur.de>

Differential Revision: https://reviews.llvm.org/D30620

llvm-svn: 300323
2017-04-14 13:39:40 +00:00
clang PR32280: Do not crash on nested initializers. 2017-04-14 08:48:08 +00:00
clang-tools-extra [clang-tidy] Fixes to misc-forwarding-reference-overload check. 2017-04-14 12:31:36 +00:00
compiler-rt [Profile] PE binary coverage bug fix 2017-04-13 23:37:15 +00:00
debuginfo-tests Add a test for __block variables + asan. 2017-04-13 18:06:59 +00:00
libclc math: Implement sinh function 2017-02-25 02:46:53 +00:00
libcxx [libcxx] Direct support for Fuchsia 2017-04-13 21:29:21 +00:00
libcxxabi [CMake][libcxxabi] Use -nodefaultlibs for CMake checks 2017-04-07 20:10:41 +00:00
libunwind Reland "[CMake][libunwind] Use -nodefaultlibs for CMake checks" 2017-04-12 02:28:07 +00:00
lld [ELF] - Linkerscript: make section with no content to be SHT_PROGBITS by default. 2017-04-14 09:37:00 +00:00
lldb Don't use uuid_clear(), non-darwin platforms include 2017-04-13 02:12:32 +00:00
llgo benchcomp: Add a mode for analyzing file sizes. 2017-04-03 19:13:12 +00:00
llvm Fix missing virtual destructor to silence build warning. 2017-04-14 13:34:33 +00:00
openmp KMP_HW_SUBSET extended with NUMA support when HWLOC enabled 2017-04-13 17:15:07 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly Use isl C++ foreach implementation 2017-04-14 13:39:40 +00:00