Debian Codegraph @

clang_delta/SimplifyRecursiveTemplateInstantiation.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 SIMPLIFY_RECURSIVE_TEMPLATE_INSTANTIATION_H
12 #define SIMPLIFY_RECURSIVE_TEMPLATE_INSTANTIATION_H
13
14 #include "llvm/ADT/SmallVector.h"
15 #include "clang/AST/TypeLoc.h"
16 #include "Transformation.h"
17
18 namespace clang {
19 class DeclGroupRef;
20 class ASTContext;
21 class TemplateDecl;
22 }
23
24 class SimplifyRecursiveTemplateInstantiationASTVisitor;
25
26 class SimplifyRecursiveTemplateInstantiation : public Transformation {
27 friend class SimplifyRecursiveTemplateInstantiationASTVisitor;
28
29 public:
30 SimplifyRecursiveTemplateInstantiation(const char *TransName,
31 const char *Desc)
32 : Transformation(TransName, Desc),
33 CollectionVisitor(NULL),
34 TheLocPair(NULL)
35 {}
36
37 ~SimplifyRecursiveTemplateInstantiation();
38
39 void handleInnerTemplateSpecializationTypeLoc(
40 const clang::TemplateSpecializationTypeLoc &ParentTLoc,
41 const clang::TemplateSpecializationTypeLoc &TLoc);
42
43 private:
44
45 typedef llvm::SmallVector<clang::TemplateSpecializationTypeLoc, 2>
46 SpecTypeLocPair;
47
48 typedef llvm::SmallVector<SpecTypeLocPair *, 20>
49 SpecTypeLocPairQueue;
50
51 virtual void Initialize(clang::ASTContext &context);
52
53 virtual void HandleTranslationUnit(clang::ASTContext &Ctx);
54
55 void handleTemplateSpecializationTypeLoc(
56 const clang::TemplateSpecializationTypeLoc &TLoc);
57
58 const clang::TemplateDecl *
59 getTemplateDeclFromSpecLoc(const clang::TemplateSpecializationTypeLoc &TLoc);
60
61 void rewriteTemplateArgument();
62
63 void analyzeLocPairs();
64
65 SpecTypeLocPairQueue LocPairQueue;
66
67 SimplifyRecursiveTemplateInstantiationASTVisitor *CollectionVisitor;
68
69 SpecTypeLocPair *TheLocPair;
70
71 // Unimplemented
72 SimplifyRecursiveTemplateInstantiation();
73
74 SimplifyRecursiveTemplateInstantiation(
75 const SimplifyRecursiveTemplateInstantiation &);
76
77 void operator=(const SimplifyRecursiveTemplateInstantiation &);
78 };
79
80 #endif