Debian Codegraph @

clang_delta/ReplaceDependentTypedef.h

raw symbols SCIP
1 //===----------------------------------------------------------------------===//
2 //
3 // Copyright (c) 2012, 2013 The University of Utah
4 // All rights reserved.
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See the file COPYING for details.
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 // Unimplemented
67 ReplaceDependentTypedef();
68
69 ReplaceDependentTypedef(const ReplaceDependentTypedef &);
70
71 void operator=(const ReplaceDependentTypedef &);
72 };
73
74 #endif
75