export pet_expr_new_cast
[pet.git] / scop_plus.h
blob71a72a8a84814124a3a9ba9e3e0252b2558daf8d
1 #ifndef PET_SCOP_PLUS_H
2 #define PET_SCOP_PLUS_H
4 #include <set>
5 #include <vector>
6 #include <clang/AST/Decl.h>
8 #include "scop.h"
10 /* Compare two sequences of ValueDecl pointers based on their names.
12 struct array_desc_less {
13 bool operator()(const std::vector<clang::ValueDecl *> &x,
14 const std::vector<clang::ValueDecl *> &y) {
15 int x_n = x.size();
16 int y_n = y.size();
18 for (int i = 0; i < x_n && i < y_n; ++i) {
19 int cmp = x[i]->getName().compare(y[i]->getName());
20 if (cmp)
21 return cmp < 0;
24 return x_n < y_n;
28 /* A sorted set of sequences of ValueDecl pointers. The actual order
29 * is not important, only that it is consistent across platforms.
31 typedef std::set<std::vector<clang::ValueDecl *>, array_desc_less>
32 array_desc_set;
34 void pet_scop_collect_arrays(struct pet_scop *scop, array_desc_set &arrays);
36 #endif