Chisel
Transformation.h
Go to the documentation of this file.
1 #ifndef TRANSFORMATION_H
2 #define TRANSFORMATION_H
3 
4 #include "clang/AST/ASTConsumer.h"
5 #include "clang/AST/ASTContext.h"
6 #include "clang/AST/Expr.h"
7 #include "clang/Rewrite/Core/Rewriter.h"
8 
10 class Transformation : public clang::ASTConsumer {
11 public:
14 
15 protected:
16  virtual void Initialize(clang::ASTContext &Ctx);
17 
18  std::vector<clang::Stmt *> getAllChildren(clang::Stmt *S);
23  char Symbol);
25  char Symbol);
27  int getOffsetUntil(const char *Buf, char Symbol);
28  llvm::StringRef getSourceText(const clang::SourceLocation &B,
29  const clang::SourceLocation &E);
30 
32  const clang::SourceLocation &E);
33 
34  clang::ASTContext *Context;
35  clang::Rewriter TheRewriter;
36 };
37 
38 #endif // TRANSFORMATION_H
clang::SourceRange SourceRange
Definition: LocalReduction.cpp:23
clang::Expr Expr
Definition: LocalReduction.cpp:31
int getOffsetUntil(const char *Buf, char Symbol)
Definition: Transformation.cpp:74
clang::SourceLocation SourceLocation
Definition: LocalReduction.cpp:24
~Transformation()
Definition: Transformation.h:13
Transformation()
Definition: Transformation.h:12
clang::SourceLocation getEndLocation(clang::SourceLocation Loc)
Definition: Transformation.cpp:86
virtual void Initialize(clang::ASTContext &Ctx)
Definition: Transformation.cpp:7
clang::Stmt Stmt
Definition: LocalReduction.cpp:25
clang::SourceLocation getEndLocationFromBegin(clang::SourceRange Range)
Definition: Transformation.cpp:150
llvm::StringRef getSourceText(const clang::SourceLocation &B, const clang::SourceLocation &E)
Definition: Transformation.cpp:141
Represesnts a transformation action on an AST.
Definition: Transformation.h:10
clang::ASTContext * Context
Definition: Transformation.h:34
clang::SourceLocation getEndLocationUntil(clang::SourceRange Range, char Symbol)
Definition: Transformation.cpp:116
std::vector< clang::Stmt * > getAllChildren(clang::Stmt *S)
Definition: Transformation.cpp:12
clang::Rewriter TheRewriter
Definition: Transformation.h:35
clang::SourceLocation getEndLocationAfter(clang::SourceRange Range, char Symbol)
Definition: Transformation.cpp:105
clang::SourceLocation getEndOfCond(clang::Expr *E)
Definition: Transformation.cpp:28
void removeSourceText(const clang::SourceLocation &B, const clang::SourceLocation &E)
Definition: Transformation.cpp:126
clang::SourceLocation getEndOfStmt(clang::Stmt *S)
Definition: Transformation.cpp:36