| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
#ifndef REPLACE_DEPENDENT_TYPEDEF_H |
| 12 |
#define REPLACE_DEPENDENT_TYPEDEF_H |
| 13 |
|
| 14 |
#include <string> |
| 15 |
#include "Transformation.h" |
| 16 |
|
| 17 |
namespace clang { |
| 18 |
class DeclGroupRef; |
| 19 |
class ASTContext; |
| 20 |
class QualType; |
| 21 |
class Type; |
| 22 |
class TypedefDecl; |
| 23 |
class CXXRecordDecl; |
| 24 |
} |
| 25 |
|
| 26 |
namespace llvm { |
| 27 |
class StringRef; |
| 28 |
} |
| 29 |
|
| 30 |
class ReplaceDependentTypedefCollectionVisitor; |
| 31 |
|
| 32 |
class ReplaceDependentTypedef : public Transformation { |
| 33 |
friend class ReplaceDependentTypedefCollectionVisitor; |
| 34 |
|
| 35 |
public: |
| 36 |
ReplaceDependentTypedef(const char *TransName, const char *Desc) |
| 37 |
: Transformation(TransName, Desc), |
| 38 |
CollectionVisitor(NULL), |
| 39 |
TheTyName(""), |
| 40 |
TheTypedefDecl(NULL), |
| 41 |
NeedTypenameKeyword(false) |
| 42 |
{} |
| 43 |
|
| 44 |
~ReplaceDependentTypedef(); |
| 45 |
|
| 46 |
private: |
| 47 |
|
| 48 |
virtual void Initialize(clang::ASTContext &context); |
| 49 |
|
| 50 |
virtual void HandleTranslationUnit(clang::ASTContext &Ctx); |
| 51 |
|
| 52 |
void handleOneTypedefDecl(const clang::TypedefDecl *D); |
| 53 |
|
| 54 |
bool isValidType(const clang::QualType &QT); |
| 55 |
|
| 56 |
void rewriteTypedefDecl(); |
| 57 |
|
| 58 |
ReplaceDependentTypedefCollectionVisitor *CollectionVisitor; |
| 59 |
|
| 60 |
std::string TheTyName; |
| 61 |
|
| 62 |
const clang::TypedefDecl *TheTypedefDecl; |
| 63 |
|
| 64 |
bool NeedTypenameKeyword; |
| 65 |
|
| 66 |
|
| 67 |
ReplaceDependentTypedef(); |
| 68 |
|
| 69 |
ReplaceDependentTypedef(const ReplaceDependentTypedef &); |
| 70 |
|
| 71 |
void operator=(const ReplaceDependentTypedef &); |
| 72 |
}; |
| 73 |
|
| 74 |
#endif |
| 75 |
|