Debian Codegraph @

clang_delta/SimplifyStruct.h

raw symbols SCIP
1 //===----------------------------------------------------------------------===//
2 //
3 // Copyright (c) 2012 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_STRUCT_H
12 #define SIMPLIFY_STRUCT_H
13
14 #include "llvm/ADT/SmallPtrSet.h"
15 #include "Transformation.h"
16
17 namespace clang {
18 class DeclGroupRef;
19 class ASTContext;
20 class RecordDecl;
21 class FieldDecl;
22 }
23
24 class SimplifyStructCollectionVisitor;
25 class SimplifyStructRewriteVisitor;
26
27 class SimplifyStruct : public Transformation {
28
29 friend class SimplifyStructCollectionVisitor;
30 friend class SimplifyStructRewriteVisitor;
31
32 public:
33
34 SimplifyStruct(const char *TransName, const char *Desc)
35 : Transformation(TransName, Desc),
36 CollectionVisitor(NULL),
37 RewriteVisitor(NULL),
38 TheRecordDecl(NULL),
39 ReplacingRecordDecl(NULL),
40 VolatileField(false),
41 ConstField(false)
42 { }
43
44 ~SimplifyStruct(void);
45
46 private:
47
48 typedef llvm::SmallPtrSet<void *, 10> LocPtrSet;
49
50 virtual void Initialize(clang::ASTContext &context);
51
52 virtual void HandleTranslationUnit(clang::ASTContext &Ctx);
53
54 void setQualifierFlags(const clang::FieldDecl *FD);
55
56 LocPtrSet VisitedLocs;
57
58 LocPtrSet VisitedVarDeclLocs;
59
60 SimplifyStructCollectionVisitor *CollectionVisitor;
61
62 SimplifyStructRewriteVisitor *RewriteVisitor;
63
64 const clang::RecordDecl *TheRecordDecl;
65
66 const clang::RecordDecl *ReplacingRecordDecl;
67
68 bool VolatileField;
69
70 bool ConstField;
71
72 // Unimplemented
73 SimplifyStruct(void);
74
75 SimplifyStruct(const SimplifyStruct &);
76
77 void operator=(const SimplifyStruct &);
78 };
79 #endif