From 820cf20a986f06d7fb1f055ae44748529f896d94 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Sun, 21 Feb 2016 20:01:28 +0000 Subject: [PATCH] IslAst: Expose IslAst class in header file [NFC] This allows other passes and transformations to use some of the existing AST building infrastructure. This is not yet used in Polly itself. llvm-svn: 261496 --- polly/include/polly/CodeGen/IslAst.h | 26 ++++++++++++++++++++++++++ polly/lib/CodeGen/IslAst.cpp | 27 --------------------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/polly/include/polly/CodeGen/IslAst.h b/polly/include/polly/CodeGen/IslAst.h index 04fb6e5e1b7b..ea007b747372 100644 --- a/polly/include/polly/CodeGen/IslAst.h +++ b/polly/include/polly/CodeGen/IslAst.h @@ -41,6 +41,32 @@ namespace polly { class Scop; class IslAst; class MemoryAccess; +struct Dependences; + +class IslAst { +public: + static IslAst *create(Scop *Scop, const Dependences &D); + ~IslAst(); + + /// Print a source code representation of the program. + void pprint(llvm::raw_ostream &OS); + + __isl_give isl_ast_node *getAst(); + + /// @brief Get the run-time conditions for the Scop. + __isl_give isl_ast_expr *getRunCondition(); + +private: + Scop *S; + isl_ast_node *Root; + isl_ast_expr *RunCondition; + std::shared_ptr Ctx; + + IslAst(Scop *Scop); + void init(const Dependences &D); + + void buildRunCondition(__isl_keep isl_ast_build *Build); +}; class IslAstInfo : public ScopPass { public: diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index fd3ee74cb56f..2e628ba00c72 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -71,33 +71,6 @@ static cl::opt DetectParallel("polly-ast-detect-parallel", cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); -namespace polly { -class IslAst { -public: - static IslAst *create(Scop *Scop, const Dependences &D); - ~IslAst(); - - /// Print a source code representation of the program. - void pprint(llvm::raw_ostream &OS); - - __isl_give isl_ast_node *getAst(); - - /// @brief Get the run-time conditions for the Scop. - __isl_give isl_ast_expr *getRunCondition(); - -private: - Scop *S; - isl_ast_node *Root; - isl_ast_expr *RunCondition; - std::shared_ptr Ctx; - - IslAst(Scop *Scop); - void init(const Dependences &D); - - void buildRunCondition(__isl_keep isl_ast_build *Build); -}; -} // End namespace polly. - /// @brief Free an IslAstUserPayload object pointed to by @p Ptr static void freeIslAstUserPayload(void *Ptr) { delete ((IslAstInfo::IslAstUserPayload *)Ptr);