summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopInfo.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2018-05-28 07:45:25 +0000
committerTobias Grosser <tobias@grosser.es>2018-05-28 07:45:25 +0000
commit9b9c7010202263e47f37f92c51a7696d4e2b8fbc (patch)
treef2dbdfe39b586e67105a6b8c466b1547504e33f7 /polly/lib/Analysis/ScopInfo.cpp
parent26bc84860ad3a12fa76898c10da5ad8da31202a6 (diff)
downloadbcm5719-llvm-9b9c7010202263e47f37f92c51a7696d4e2b8fbc.tar.gz
bcm5719-llvm-9b9c7010202263e47f37f92c51a7696d4e2b8fbc.zip
[ScopInfo] Update Scop::addUserContext() to C++ interface
Summary: This patch updates `Scop::addUserContext()` function to the new C++ interface and replaces the `auto` keyword with explicit type wherever used in this function. Reviewers: grosser, bollu, philip.pfaffe, chelini, Meinersbur Reviewed By: grosser Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47438 llvm-svn: 333366
Diffstat (limited to 'polly/lib/Analysis/ScopInfo.cpp')
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp31
1 files changed, 10 insertions, 21 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 471ade2991e..de4f3eae851 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -2112,29 +2112,23 @@ void Scop::addUserContext() {
if (UserContextStr.empty())
return;
- isl_set *UserContext =
- isl_set_read_from_str(getIslCtx().get(), UserContextStr.c_str());
- isl_space *Space = getParamSpace().release();
- if (isl_space_dim(Space, isl_dim_param) !=
- isl_set_dim(UserContext, isl_dim_param)) {
- auto SpaceStr = isl_space_to_str(Space);
+ isl::set UserContext = isl::set(getIslCtx(), UserContextStr.c_str());
+ isl::space Space = getParamSpace();
+ if (Space.dim(isl::dim::param) != UserContext.dim(isl::dim::param)) {
+ std::string SpaceStr = Space.to_str();
errs() << "Error: the context provided in -polly-context has not the same "
<< "number of dimensions than the computed context. Due to this "
<< "mismatch, the -polly-context option is ignored. Please provide "
<< "the context in the parameter space: " << SpaceStr << ".\n";
- free(SpaceStr);
- isl_set_free(UserContext);
- isl_space_free(Space);
return;
}
- for (unsigned i = 0; i < isl_space_dim(Space, isl_dim_param); i++) {
+ for (unsigned i = 0; i < Space.dim(isl::dim::param); i++) {
std::string NameContext = Context.get_dim_name(isl::dim::param, i);
- std::string NameUserContext =
- isl_set_get_dim_name(UserContext, isl_dim_param, i);
+ std::string NameUserContext = UserContext.get_dim_name(isl::dim::param, i);
if (NameContext != NameUserContext) {
- auto SpaceStr = isl_space_to_str(Space);
+ std::string SpaceStr = Space.to_str();
errs() << "Error: the name of dimension " << i
<< " provided in -polly-context "
<< "is '" << NameUserContext << "', but the name in the computed "
@@ -2142,19 +2136,14 @@ void Scop::addUserContext() {
<< "'. Due to this name mismatch, "
<< "the -polly-context option is ignored. Please provide "
<< "the context in the parameter space: " << SpaceStr << ".\n";
- free(SpaceStr);
- isl_set_free(UserContext);
- isl_space_free(Space);
return;
}
- UserContext =
- isl_set_set_dim_id(UserContext, isl_dim_param, i,
- isl_space_get_dim_id(Space, isl_dim_param, i));
+ UserContext = UserContext.set_dim_id(isl::dim::param, i,
+ Space.get_dim_id(isl::dim::param, i));
}
- Context = Context.intersect(isl::manage(UserContext));
- isl_space_free(Space);
+ Context = Context.intersect(UserContext);
}
void Scop::buildInvariantEquivalenceClasses() {
OpenPOWER on IntegriCloud