! * initialize the map */
| 101 | * initialize the map |
| 102 | */ |
| 103 | void ThreadAPI::init() |
| 104 | { |
| 105 | set<TD_TYPE> t_seen; |
| 106 | TD_TYPE prev_t= TD_DUMMY; |
| 107 | t_seen.insert(TD_DUMMY); |
| 108 | for(const ei_pair *p= ei_pairs; p->n; ++p) |
| 109 | { |
| 110 | if(p->t != prev_t) |
| 111 | { |
| 112 | //This will detect if you move an entry to another block |
| 113 | // but forget to change the type. |
| 114 | if(t_seen.count(p->t)) |
| 115 | { |
| 116 | fputs(p->n, stderr); |
| 117 | putc('\n', stderr); |
| 118 | assert(!"ei_pairs not grouped by type"); |
| 119 | } |
| 120 | t_seen.insert(p->t); |
| 121 | prev_t= p->t; |
| 122 | } |
| 123 | if(tdAPIMap.count(p->n)) |
| 124 | { |
| 125 | fputs(p->n, stderr); |
| 126 | putc('\n', stderr); |
| 127 | assert(!"duplicate name in ei_pairs"); |
| 128 | } |
| 129 | tdAPIMap[p->n]= p->t; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | /// Get the function type if it is a threadAPI function |
| 134 | ThreadAPI::TD_TYPE ThreadAPI::getType(const FunObjVar* F) const |