| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
#ifndef SIMPLIFY_NESTED_CLASS_H |
| 12 |
#define SIMPLIFY_NESTED_CLASS_H |
| 13 |
|
| 14 |
#include "Transformation.h" |
| 15 |
|
| 16 |
namespace clang { |
| 17 |
class DeclGroupRef; |
| 18 |
class ASTContext; |
| 19 |
class CXXRecordDecl; |
| 20 |
class Decl; |
| 21 |
} |
| 22 |
|
| 23 |
class SimplifyNestedClassVisitor; |
| 24 |
class SimplifyNestedClassRewriteVisitor; |
| 25 |
|
| 26 |
class SimplifyNestedClass : public Transformation { |
| 27 |
friend class SimplifyNestedClassVisitor; |
| 28 |
friend class SimplifyNestedClassRewriteVisitor; |
| 29 |
|
| 30 |
public: |
| 31 |
SimplifyNestedClass(const char *TransName, const char *Desc) |
| 32 |
: Transformation(TransName, Desc), |
| 33 |
CollectionVisitor(NULL), |
| 34 |
RewriteVisitor(NULL), |
| 35 |
TheBaseCXXRD(NULL) |
| 36 |
{ } |
| 37 |
|
| 38 |
~SimplifyNestedClass(void); |
| 39 |
|
| 40 |
private: |
| 41 |
virtual void Initialize(clang::ASTContext &context); |
| 42 |
|
| 43 |
virtual void HandleTranslationUnit(clang::ASTContext &Ctx); |
| 44 |
|
| 45 |
void handleOneCXXRecordDecl(const clang::CXXRecordDecl *CXXRD); |
| 46 |
|
| 47 |
void removeOuterClass(); |
| 48 |
|
| 49 |
SimplifyNestedClassVisitor *CollectionVisitor; |
| 50 |
|
| 51 |
SimplifyNestedClassRewriteVisitor *RewriteVisitor; |
| 52 |
|
| 53 |
const clang::CXXRecordDecl *TheBaseCXXRD; |
| 54 |
|
| 55 |
const clang::Decl *TheInnerDecl; |
| 56 |
|
| 57 |
|
| 58 |
SimplifyNestedClass(void); |
| 59 |
|
| 60 |
SimplifyNestedClass(const SimplifyNestedClass &); |
| 61 |
|
| 62 |
void operator=(const SimplifyNestedClass &); |
| 63 |
}; |
| 64 |
|
| 65 |
#endif |
| 66 |
|