| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 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 |
|
| 40 |
ReplaceArrayAccessWithIndex(void); |
| 41 |
ReplaceArrayAccessWithIndex(const ReplaceArrayAccessWithIndex &); |
| 42 |
void operator=(const ReplaceArrayAccessWithIndex &); |
| 43 |
}; |
| 44 |
|
| 45 |
#endif |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|