IslNodeBuilder: Make finalize() virtual
authorTobias Grosser <tobias@grosser.es>
Mon, 25 Jul 2016 09:15:57 +0000 (09:15 +0000)
committerTobias Grosser <tobias@grosser.es>
Mon, 25 Jul 2016 09:15:57 +0000 (09:15 +0000)
This allows the finalization routine of the IslNodeBuilder to be overwritten
by derived classes. Being here, we also drop the unnecessary 'Scop' postfix
and the unnecessary 'Scop' parameter.

llvm-svn: 276622

polly/include/polly/CodeGen/IslNodeBuilder.h
polly/lib/CodeGen/CodeGeneration.cpp
polly/lib/CodeGen/PPCGCodeGeneration.cpp

index e35233a..edc14ee 100644 (file)
@@ -58,10 +58,10 @@ public:
   /// @brief Preload all memory loads that are invariant.
   bool preloadInvariantLoads();
 
-  /// @brief Finalize code generation for the SCoP @p S.
+  /// @brief Finalize code generation.
   ///
   /// @see BlockGenerator::finalizeSCoP(Scop &S)
-  void finalizeSCoP(Scop &S) { BlockGen.finalizeSCoP(S); }
+  virtual void finalize() { BlockGen.finalizeSCoP(S); }
 
   IslExprBuilder &getExprBuilder() { return ExprBuilder; }
 
index 5448557..709f360 100644 (file)
@@ -203,8 +203,7 @@ public:
       Builder.SetInsertPoint(&StartBlock->front());
 
       NodeBuilder.create(AstRoot);
-
-      NodeBuilder.finalizeSCoP(S);
+      NodeBuilder.finalize();
       fixRegionInfo(EnteringBB->getParent(), R->getParent());
     }
 
index a4609bf..9bc6fde 100644 (file)
@@ -1326,7 +1326,7 @@ public:
     NodeBuilder.addParameters(S->getContext());
     Builder.SetInsertPoint(&*StartBlock->begin());
     NodeBuilder.create(Root);
-    NodeBuilder.finalizeSCoP(*S);
+    NodeBuilder.finalize();
   }
 
   bool runOnScop(Scop &CurrentScop) override {