summaryrefslogtreecommitdiffstats
path: root/polly/lib/Exchange/JSONExporter.cpp
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2011-08-20 11:11:25 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2011-08-20 11:11:25 +0000
commitb76f385334405e6517ee60b5dfdf569ff4e94f1f (patch)
treef1bd4056fc00da863dd7ebdbb9967686883329ca /polly/lib/Exchange/JSONExporter.cpp
parent15f5efff8f44ccbb3c1f184bbd858c2b7ff5be4f (diff)
downloadbcm5719-llvm-b76f385334405e6517ee60b5dfdf569ff4e94f1f.tar.gz
bcm5719-llvm-b76f385334405e6517ee60b5dfdf569ff4e94f1f.zip
Free isl_ctx and fix several memory leaks
Because of me not understanding the LLVM pass structure well, I did not find a good way to allocate isl_ctx and to free it later without getting issues with reference counting. I now found this place, such that we can free isl_ctx. This patch also fixes the memory leaks that were ignored beforehand. llvm-svn: 138204
Diffstat (limited to 'polly/lib/Exchange/JSONExporter.cpp')
-rwxr-xr-xpolly/lib/Exchange/JSONExporter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp
index 72ecd3e4336..2653868ec1f 100755
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -272,17 +272,21 @@ bool JSONImporter::runOnScop(Scop &scop) {
if (!isl_map_has_equal_dim(currentAccessMap, newAccessMap)) {
errs() << "JScop file contains access function with incompatible "
<< "dimensions\n";
+ isl_map_free(newAccessMap);
return false;
}
if (isl_map_dim(newAccessMap, isl_dim_out) != 1) {
errs() << "New access map in JScop file should be single dimensional\n";
+ isl_map_free(newAccessMap);
return false;
}
if (!isl_map_is_equal(newAccessMap, currentAccessMap)) {
// Statistics.
++NewAccessMapFound;
- newAccessStrings.push_back(accesses.asCString());
+ newAccessStrings.push_back(accesses.asCString());
(*MI)->setNewAccessFunction(newAccessMap);
+ } else {
+ isl_map_free(newAccessMap);
}
memoryAccessIdx++;
}
OpenPOWER on IntegriCloud