Debian Codegraph @

clang_delta/ReplaceDependentName.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_NAME_H
12 #define REPLACE_DEPENDENT_NAME_H
13
14 #include <string>
15 #include "clang/Basic/SourceLocation.h"
16 #include "Transformation.h"
17
18 namespace clang {
19 class DeclGroupRef;
20 class ASTContext;
21 class DependentNameTypeLoc;
22 class ElaboratedTypeLoc;
23 }
24
25 class ReplaceDependentNameCollectionVisitor;
26
27 class ReplaceDependentName : public Transformation {
28 friend class ReplaceDependentNameCollectionVisitor;
29
30 public:
31 ReplaceDependentName(const char *TransName, const char *Desc)
32 : Transformation(TransName, Desc),
33 CollectionVisitor(NULL),
34 TheTyName(""),
35 NeedTypenameKeyword(false)
36 {}
37
38 ~ReplaceDependentName();
39
40 private:
41
42 virtual void Initialize(clang::ASTContext &context);
43
44 virtual void HandleTranslationUnit(clang::ASTContext &Ctx);
45
46 void handleOneDependentNameTypeLoc(const clang::DependentNameTypeLoc &TLoc);
47
48 void handleOneElaboratedTypeLoc(const clang::ElaboratedTypeLoc &TLoc);
49
50 void rewriteDependentName();
51
52 clang::SourceLocation getElaboratedTypeLocBegin(
53 const clang::ElaboratedTypeLoc &TLoc);
54
55 ReplaceDependentNameCollectionVisitor *CollectionVisitor;
56
57 std::string TheTyName;
58
59 bool NeedTypenameKeyword;
60
61 clang::SourceLocation TheLocBegin;
62
63 clang::SourceLocation TheNameLocEnd;
64
65 // Unimplemented
66 ReplaceDependentName();
67
68 ReplaceDependentName(const ReplaceDependentName &);
69
70 void operator=(const ReplaceDependentName &);
71 };
72
73 #endif
74