| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
#ifndef SIMPLIFY_CALL_EXPR_H |
| 12 |
#define SIMPLIFY_CALL_EXPR_H |
| 13 |
|
| 14 |
#include <string> |
| 15 |
#include "Transformation.h" |
| 16 |
|
| 17 |
namespace clang { |
| 18 |
class DeclGroupRef; |
| 19 |
class ASTContext; |
| 20 |
class FunctionDecl; |
| 21 |
class CallExpr; |
| 22 |
class Expr; |
| 23 |
} |
| 24 |
|
| 25 |
class SimplifyCallExprVisitor; |
| 26 |
|
| 27 |
class SimplifyCallExpr : public Transformation { |
| 28 |
friend class SimplifyCallExprVisitor; |
| 29 |
|
| 30 |
public: |
| 31 |
|
| 32 |
SimplifyCallExpr(const char *TransName, const char *Desc) |
| 33 |
: Transformation(TransName, Desc), |
| 34 |
CollectionVisitor(NULL), |
| 35 |
NameQueryWrap(NULL), |
| 36 |
TheCallExpr(NULL), |
| 37 |
CurrentFD(NULL), |
| 38 |
NamePostfix(0) |
| 39 |
{ } |
| 40 |
|
| 41 |
~SimplifyCallExpr(void); |
| 42 |
|
| 43 |
private: |
| 44 |
|
| 45 |
virtual void Initialize(clang::ASTContext &context); |
| 46 |
|
| 47 |
virtual void HandleTranslationUnit(clang::ASTContext &Ctx); |
| 48 |
|
| 49 |
void handleOneArgStr(const clang::Expr *Arg, std::string &Str); |
| 50 |
|
| 51 |
void replaceCallExpr(void); |
| 52 |
|
| 53 |
SimplifyCallExprVisitor *CollectionVisitor; |
| 54 |
|
| 55 |
TransNameQueryWrap *NameQueryWrap; |
| 56 |
|
| 57 |
const clang::CallExpr *TheCallExpr; |
| 58 |
|
| 59 |
const clang::FunctionDecl *CurrentFD; |
| 60 |
|
| 61 |
unsigned int NamePostfix; |
| 62 |
|
| 63 |
|
| 64 |
SimplifyCallExpr(void); |
| 65 |
|
| 66 |
SimplifyCallExpr(const SimplifyCallExpr &); |
| 67 |
|
| 68 |
void operator=(const SimplifyCallExpr &); |
| 69 |
}; |
| 70 |
#endif |