Debian Codegraph @

clang_delta/ReplaceArrayAccessWithIndex.h

raw symbols SCIP
1 //===----------------------------------------------------------------------===//
2 //
3 // Copyright (c) 2016 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_ARRAY_ACCESS_WITH_INDEX
12 #define REPLACE_ARRAY_ACCESS_WITH_INDEX
13
14 #include "Transformation.h"
15
16 class ReplaceArrayAccessWithIndex : public Transformation {
17 public:
18
19 ReplaceArrayAccessWithIndex(const char *TransName, const char *Desc)
20 : Transformation(TransName, Desc)
21 , Collector(NULL)
22 { }
23
24 ~ReplaceArrayAccessWithIndex(void);
25
26 private:
27 class IndexCollector;
28
29 virtual void Initialize(clang::ASTContext &context);
30
31 virtual void HandleTranslationUnit(clang::ASTContext &Ctx);
32
33 void doRewrite(void);
34
35 IndexCollector *Collector;
36
37 std::vector<clang::ArraySubscriptExpr const*> ASEs;
38
39 // Unimplemented
40 ReplaceArrayAccessWithIndex(void);
41 ReplaceArrayAccessWithIndex(const ReplaceArrayAccessWithIndex &);
42 void operator=(const ReplaceArrayAccessWithIndex &);
43 };
44
45 #endif
46
47 /*
48 Local Variables:
49 mode: c++
50 fill-column: 79
51 End:
52 */