systemc-clang 2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
hNode.h
Go to the documentation of this file.
1#ifndef _HNODE_H_
2#define _HNODE_H_
3
4
5#include "llvm/Support/raw_ostream.h"
6
7#include <stack>
8#include <algorithm>
9#include <unordered_map>
10#include <set>
11#include <unordered_set>
12
13#include <iostream>
14#include "CallExprUtils.h"
15
16using namespace systemc_clang;
17
24namespace hnode {
25
26 class hNode;
27
28 typedef hNode * hNodep;
29
30 class hNode {
31
32#define HNODEen \
33 etype(hNoop), \
34 etype(hModule), \
35 etype(hModinitblock), \
36 etype(hPortbindings), \
37 etype(hPortbinding), \
38 etype(hProcesses), \
39 etype(hProcess), \
40 etype(hMethod), \
41 etype(hThread), \
42 etype(hCStmt), \
43 etype(hPortsigvarlist), \
44 etype(hPortin), \
45 etype(hPortout), \
46 etype(hPortio), \
47 etype(hSenslist), \
48 etype(hSensvar), \
49 etype(hSensedge), \
50 etype(hTypeinfo), \
51 etype(hType), \
52 etype(hTypeField), \
53 etype(hTypedef), \
54 etype(hTypeTemplateParam), \
55 etype(hInt), \
56 etype(hSigdecl), \
57 etype(hVardecl), \
58 etype(hVardeclrn), \
59 etype(hModdecl), \
60 etype(hVarref), \
61 etype(hField), \
62 etype(hFieldaccess), \
63 etype(hVarInit), \
64 etype(hVarInitList), \
65 etype(hSigAssignL), \
66 etype(hSigAssignR), \
67 etype(hVarAssign), \
68 etype(hBinop), \
69 etype(hUnop), \
70 etype(hPostfix), \
71 etype(hPrefix), \
72 etype(hCondop), \
73 etype(hMethodCall), \
74 etype(hIfStmt), \
75 etype(hForStmt), \
76 etype(hSwitchStmt), \
77 etype(hSwitchCase), \
78 etype(hSwitchDefault), \
79 etype(hBreak), \
80 etype(hContinue), \
81 etype(hWhileStmt), \
82 etype(hDoStmt), \
83 etype(hReturnStmt), \
84 etype(hLiteral), \
85 etype(hFunction), \
86 etype(hThreadFunction), \
87 etype(hBuiltinFunction), \
88 etype(hFunctionRetType), \
89 etype(hFunctionParams), \
90 etype(hFunctionParamI), \
91 etype(hFunctionParamIO), \
92 etype(hFunctionParamRef), \
93 etype(hWait), \
94 etype(hUnimpl), \
95 etype(hLast)
96
97
98 public:
99
100#define etype(x) x
101
102 typedef enum { HNODEen } hdlopsEnum;
103
104 //bool is_leaf;
105
106 string h_name;
108 //list<hNodep> child_list;
109 std::vector<hNodep> child_list;
110
111#undef etype
112#define etype(x) #x
113
114 const string hdlop_pn [hLast+1] = { HNODEen };
115
116 //hNode() { is_leaf = true;}
117 hNode(bool lf) {
118 //is_leaf = lf;
120 h_name = "";
121 }
122
124 h_op = h;
125 h_name = "";
126 }
127
128
129 hNode(string s, hdlopsEnum h) {
130 //is_leaf = true;
131 h_op = h;
132 h_name = s;
133 }
134
136 //return;
137 if (!child_list.empty()) {
138 //list<hNodep>::iterator it;
139 vector<hNodep>::iterator it;
140 for (it = child_list.begin(); it != child_list.end(); it++) {
141 /* if (*it) */
142 /* cout << "child list element " << *it << "\n"; */
143 if (*it) delete *it;
144 }
145 }
146 }
147
148 void set(hdlopsEnum h, string s = "") {
149 h_op = h;
150 h_name = s;
151 }
152
153 void set(string s = "") {
154 h_name = s;
155 }
156
157 void append(hNodep hnew) {
158 child_list.push_back(hnew);
159 }
160
161 int size() {
162 return child_list.size();
163 }
164
165 string printopc(hdlopsEnum opc) {
166 return hdlop_pn[static_cast<int>(opc)];
167 }
168
169 string getname() {
170 return h_name;
171 }
172
174 return h_op;
175 }
176
177
178 // for completeness
180 const int n = sizeof (hdlop_pn)/sizeof (hdlop_pn[0]);
181 for (int i = 0; i < n; i++) {
182 if (hdlop_pn[i] == st)
183 return (hdlopsEnum) i;
184 }
185 return hLast;
186 }
187 //void print(llvm::raw_fd_ostream & modelout, unsigned int indnt=2) {
188 void print(llvm::raw_ostream & modelout=llvm::outs(), unsigned int indnt=2) {
189 modelout.indent(indnt);
190 modelout << printopc(h_op) << " ";
191 if (h_name == "")
192 modelout << " NONAME";
193 else modelout << h_name;
194 if (child_list.empty())
195 modelout << " NOLIST\n";
196 else {
197 modelout << " [\n";
198 for (auto child : child_list)
199 if (child)
200 child->print(modelout, indnt+2);
201 else {
202 modelout.indent(indnt+2);
203 modelout << "<null child>\n";
204 }
205 modelout.indent(indnt);
206 modelout << "]\n";
207 }
208 }
209
210 // default arguments don't work in lldb
211 void dumphcode() {
212 print(llvm::outs(), 2);
213 LLVM_DEBUG(print(llvm::dbgs(), 2));
214 }
215
216 };
217
218 // remember type pointers
219
220
225
226 class util {
227 private:
228 std::unordered_set<const Type *> types_seen = {};
229
230 public:
231
232 const static int numstr = 8;
233 const string scbuiltintype [numstr] = {
234 "sc_uint",
235 "sc_int",
236 "sc_bigint",
237 "sc_biguint",
238 "sc_bv",
239 "sc_vector",
240 "sc_logic",
241 "sc_clock"
242 };
244 const set<std::string> sc_built_in_funcs{
245 "concat", "wait", "range", "bit", "or_reduce", "xor_reduce", "nor_reduce","xnor_reduce", "and_reduce", "nand_reduce"};
246
248 for (int i=0; i < numstr; i++)
249 scbtlen[i] = scbuiltintype[i].length();
250 }
251
252 ~util() {}
253
254 static inline void make_ident(string &nm) {
255 // https://stackoverflow.com/questions/14475462/remove-set-of-characters-from-the-string
256 //str.erase(
257 // std::remove_if(str.begin(), str.end(), [](char chr){ return chr == '&' || chr == ' ';}),
258 //str.end());
259 std::replace(nm.begin(), nm.end(), ' ', '_');
260 std::replace(nm.begin(), nm.end(), ':', '_');
261 nm.erase(std::remove_if(nm.begin(), nm.end(),
262 [](char c){ return c!='_' && !isalnum(c) ;}), nm.end());
263
264 }
265
266 // New functions
267 inline bool checkNamespace(const FunctionDecl *fd) {
268 std::vector<llvm::StringRef> sc_dt{"sc_dt", "sc_core"};
269 return isInNamespace(fd, sc_dt);
270 }
271
272 /*
273 * Old functions
274 inline bool isSCByFunctionDecl(const FunctionDecl *fd) {
275 if (!fd) { return false; }
276
277 std::vector<llvm::StringRef> sc_dt{"sc_dt"};
278 return isInNamespace(fd, sc_dt);
279 }
280 */
281
282 /*
283 inline bool isSCByCallExpr(const Expr *expr) {
284 // std::vector<llvm::StringRef> sc_dt{"sc_dt", "sc_core"};
285 // return isInNamespace(expr, sc_dt);
286//
287
288 if (auto mce = dyn_cast<CXXMemberCallExpr>(expr)) {
289 LLVM_DEBUG(llvm::dbgs() << "isSCByType(callexpr) is a membercallexpr\n");
290
291 std::vector<llvm::StringRef> ports_signals_rvd_wait{"sc_port_base", "sc_signal_in_if", "sc_signal_out_if", "sc_signal_inout_if", "sc_prim_channel", "sc_thread_process", "sc_rvd", "sc_rvd_in", "sc_rvd_out", "sc_simcontext"};
292 std::vector<llvm::StringRef> core_dt{"sc_dt"};
293 bool t1 = isCXXMemberCallExprSystemCCall(mce, ports_signals_rvd_wait);
294 bool t2 = isInNamespace(mce->getObjectType().getTypePtr(), core_dt );
295 llvm::dbgs() << "isSCCall:: CXXMemberCallSCCall " << t1 << " inNS " << t2 << "\n";
296 if (t1 || t2) {
297 const Type *typ = mce->getObjectType().getTypePtr();
298 types_seen.insert(typ);
299 LLVM_DEBUG(llvm::dbgs() << "types_seen insert " << typ << " size = " << types_seen.size() << "\n");
300 }
301 return t1 || t2;
302
303 //return sc_ast_matchers::utils::isCXXMemberCallExprSystemCCall((CXXMemberCallExpr *)callexpr);
304 } else {
305 LLVM_DEBUG(llvm::dbgs() << "isSCByType(callexpr) not a membercallexpr\n");
306 expr->dump();
307 // auto callexpr = dyn_cast<CallExpr>(expr);
308
309 std::vector<llvm::StringRef> core_dt{"sc_core", "sc_dt"};
310 llvm::dbgs() << "calling isnamespace\n";
311 bool inns = isInNamespace(expr, core_dt);
312 if (inns) {
313 const Type *typ = expr->getType().getTypePtr();
314 types_seen.insert(typ);
315 LLVM_DEBUG(llvm::dbgs() << "types_seen insert " << typ << " size = " << types_seen.size() << "\n");
316
317 }
318
319 return inns;
320 }
321 }
322 */
323
324
325 /*
326 inline bool isSCByType(const Type *typ) {
327
328 // if (types_seen.count(typ) > 0) {
329 // LLVM_DEBUG(llvm::dbgs() << "isSCByType(typ) found type pointer in set " << typ << "\n");
330 // return true;
331 // }
332 llvm::dbgs() << "@@@@ isSCT\n";
333 static std::vector<llvm::StringRef> sc_dt_ns{"sc_dt"};
334 static std::vector<llvm::StringRef> rvd{"sc_rvd","sc_rvd_in","sc_rvd_out"};
335 static std::vector<llvm::StringRef> ports_signals_wait{"sc_port_base", "sc_signal_in_if",
336 "sc_signal_out_if", "sc_signal_inout_if", "sc_prim_channel", "sc_thread_process", "sc_process_handle"};
337 if (isInNamespace(typ, sc_dt_ns)
338 || isCXXMemberCallExprSystemCCall(typ, ports_signals_wait)
339 || isCXXMemberCallExprSystemCCall(typ, rvd)) {
340 types_seen.insert(typ);
341 LLVM_DEBUG(llvm::dbgs() << "types_seen insert " << typ << " size = " << types_seen.size() << "\n");
342 return true;
343 }
344 return false;
345 }
346
347 inline bool isSCType(const Type *typ) {
348
349 if (types_seen.count(typ) > 0) {
350 LLVM_DEBUG(llvm::dbgs() << "isSCType(typ) found type pointer in set " << typ << "\n");
351 return true;
352 }
353
354 static std::vector<llvm::StringRef> sc_dt_ns{"sc_dt"};
355 static std::vector<llvm::StringRef> rvd{"sc_rvd","sc_rvd_in","sc_rvd_out"};
356
357 static std::vector<llvm::StringRef> ports_signals_wait{"sc_port_base", "sc_signal_in_if", "sc_signal_out_if", "sc_signal_inout_if", "sc_prim_channel", "sc_process_handle", "sc_thread_process"};
358 if (isInNamespace(typ, sc_dt_ns) || isCXXMemberCallExprSystemCCall(typ, ports_signals_wait) || isCXXMemberCallExprSystemCCall(typ, rvd)) {
359 types_seen.insert(typ);
360 return true;
361 }
362 return false;
363 }
364 */
365
366 /*
367 inline bool isSCType(const CallExpr *callexpr) {
368 if (isa<CXXMemberCallExpr>(callexpr)) {
369 LLVM_DEBUG(llvm::dbgs() << "isSCType(callexpr) is a membercallexpr\n");
370
371 std::vector<llvm::StringRef> ports_signals_rvd_wait{"sc_port_base", "sc_signal_in_if", "sc_signal_out_if", "sc_signal_inout_if", "sc_prim_channel", "sc_thread_process", "sc_process_handle", "sc_rvd", "sc_rvd_in", "sc_rvd_out"};
372 std::vector<llvm::StringRef> core_dt{"sc_dt"};
373 // bool t1 = isCXXMemberCallExprSystemCCall(callexpr, ports_signals_rvd_wait);
374 // bool t2 = isInNamespace(callexpr, core_dt );
375 // llvm::dbgs() << "CXXMemberCallSCCall " << t1 << " inNS " << t2 << "\n";
376 // return t1;// || t2;
377
378 return sc_ast_matchers::utils::isCXXMemberCallExprSystemCCall((CXXMemberCallExpr *)callexpr);
379 }
380 else {
381 LLVM_DEBUG(llvm::dbgs() << "isSCType(callexpr) not a membercallexpr\n");
382 std::vector<llvm::StringRef> core_dt{"sc_core", "sc_dt"};
383
384 return isInNamespace(callexpr, core_dt);
385 }
386 }
387 */
388
389 inline bool isSCBuiltinType(const string &tstring, const Type *typ=NULL){
390 // linear search sorry, but at least the length
391 // isn't hard coded in ...
392
393 if ((typ != NULL) && (types_seen.count(typ) > 0)) {
394 //LLVM_DEBUG(llvm::dbgs() << "isSCBuiltinType(typ) found type pointer in set " << tstring << " " << typ << "\n");
395 return true;
396 }
397 bool ret = false;
398 std::vector<llvm::StringRef> scdt{"sc_dt"};
399 bool tmpisnamespace = sc_ast_matchers::utils::isInNamespace(typ, scdt);
400 int found = tstring.find_last_of(" "); // skip qualifiers if any
401 for (int i=0; i < numstr; i++) {
402 if (tstring.substr(found>=0 ? found+1:0, scbtlen[i]) == scbuiltintype[i]) {
403 ret = true;
404 break;
405 }
406 }
407 if ((typ != NULL) && (tmpisnamespace != ret)) {
408 LLVM_DEBUG(llvm::dbgs() << "isSCBuiltinType: '" << tstring << "' (" << tmpisnamespace <<
409 ", " << ret << ")\n");
410 }
411 if (ret && (typ != NULL)) {
412 types_seen.insert(typ);
413 LLVM_DEBUG(llvm::dbgs() << "types_seen insert " << typ << "size = " << types_seen.size() << "\n");
414 }
415 return ret;
416 }
417
418 inline bool isSCFunc(const string &tstring) {
419 return (sc_built_in_funcs.count(tstring)>0);
420 // add more as we get them
421 }
422
423 inline bool isTypename(const string &tstring) {
424 size_t found = tstring.find("typename");
425 if (found == string::npos) return false;
426 else if (found == (size_t) 0) return true;
427 else return false;
428 }
429
430 inline bool isSCMacro(const std::string &str_in) {
431 string sc_macro_strings [] = {"sc_min", "sc_max", "sc_abs"};
432 for (string str : sc_macro_strings) {
433 if (str_in.find(str) != string::npos) return true;
434 }
435 return false;
436 }
437
438 inline bool isSCType(const string &tstring, const clang::Type *typ = NULL) {
439 // linear search and the length is hard coded in ...
440 // used in the method name logic.
441 // can't use set as we are searching for a substring of tstring
442
443 string strings[] = {"sc_in", "sc_rvd", "sc_out", "sc_inout", "sc_buffer",
444 "sc_signal", "sc_subref", "sc_process_handle", "sc_simcontext", "sc_dt"};
445
446 if ((typ != NULL) && (types_seen.count(typ) > 0)) {
447 //LLVM_DEBUG(llvm::dbgs() << "isSCType(str, typ) found type pointer in set " << tstring << " " << typ << "\n");
448 return true;
449 }
450 bool foundsctype = false;
451
452 for (string onestring : strings) {
453 if (tstring.find(onestring)!=string::npos) {
454 foundsctype = true;
455 if (typ != NULL) {
456 types_seen.insert(typ);
457 LLVM_DEBUG(llvm::dbgs() << "types_seen insert " << typ << " size = " << types_seen.size() << "\n");
458 }
459 break;
460 }
461 else foundsctype = false;
462 }
463 if (typ != NULL) {
464 std::vector<llvm::StringRef> scdt{"sc_dt"};
465 bool tmpsctype = sc_ast_matchers::utils::isInNamespace(typ, scdt);
466 if (tmpsctype != foundsctype)
467 LLVM_DEBUG(llvm::dbgs() << "isSCType: '" << tstring << "' (" << tmpsctype <<", " << foundsctype << ")\n");
468 }
469
470 return foundsctype;
471 }
472
473 static inline bool isposint(const std::string &str) {
474 // https://stackoverflow.com/questions/4654636/how-to-determine-if-a-string-is-a-number-with-c
475 // towards the middle
476 return !str.empty() && str.find_first_not_of("0123456789") == string::npos;
477 }
478
479 };
480
481 typedef struct {
482 string oldn;
483 string newn;
486 } names_t;
487
488
489 // map from variable declaration p to new name
490 //typedef std::map<Decl *, names_t> hdecl_name_map_t;
491
492 // map from module instance declaration p to new name
493 // typedef std::map<ModuleInstance *, names_t> hmodinst_name_map_t;
494
495 const static std::string gvar_prefix{"_scclang_global_"};
496 const static std::string lvar_prefix{"_local_"};
497 const static std::string tvar_prefix{"_thread_"};
498
499 inline bool is_sigvar(hNodep hnp) {
500 return (hnp->h_op == hNode::hdlopsEnum::hVardecl) ||
502 }
503
505 private:
506 int cnt;
507 string prefix;
508 public:
509
510 name_serve(string prefx=lvar_prefix) : prefix(prefx), cnt(0){ }
511 string newname() {
512 return (prefix+to_string(cnt++));
513 }
514 void set_prefix(string prfx) { prefix = prfx; }
515 string get_prefix() { return prefix; }
516 };
517
518
528
529
530 template <class T>
532 private:
534 std::map<T, names_t> hdecl_name_map;
535
536 public:
537 //std::map<T, names_t> hdecl_name_map;
538 newname_map_t(string prefix = lvar_prefix) { ns.set_prefix(prefix); }
539 void add_entry(T declp, string old_name, hNodep hnp )
540 {
541 string newn = find_entry_newn(declp, false);
542 hnp->set(newn);
543 if ( newn== "") {
544 // this is a new declaration
545 newn = old_name+ns.newname();
546 hnp->set(newn);
547 names_t names = {old_name, newn, hnp, false};
548 hdecl_name_map[declp] = names;
549 }
550 }
551
552 string find_entry_newn(T declp, bool set_ref = false) {
553 if (hdecl_name_map.find(declp) == hdecl_name_map.end())
554 return "";
555 // only set referenced bit for Signals and Variables
556 if (set_ref && is_sigvar(hdecl_name_map[declp].h_vardeclp)) hdecl_name_map[declp].referenced = true;
557 return hdecl_name_map[declp].newn;
558 }
559
560 bool is_referenced(T declp) {
561 string newn = find_entry_newn(declp, false);
562 if ( newn== "") // doesn't exist
563 return false;
564 return hdecl_name_map[declp].referenced;
565 }
566
568 for (auto &mapentry:hdecl_name_map) {
569 mapentry.second.referenced = false;
570 }
571 }
572
573 void set_prefix(string prefix) { ns.set_prefix(prefix); }
574
575 string get_prefix() { return ns.get_prefix(); }
576
577 bool empty() { return hdecl_name_map.empty(); }
578 size_t size() { return hdecl_name_map.size(); }
579 void clear() {hdecl_name_map.clear(); ns.set_prefix(lvar_prefix);}
580
581 void print(llvm::raw_ostream & modelout=llvm::outs(), unsigned int indnt=2) {
582 for( auto entry:hdecl_name_map) {
583 modelout << entry.first << " " <<entry.second.newn << "\n";
584 }
585 }
586
587 typename std::map<T, names_t>::iterator begin() { return hdecl_name_map.begin();}
588 typename std::map<T, names_t>::iterator end() { return hdecl_name_map.end();}
589
590 // note the pass by value on newmap:
591 // need a copy to preserve the inserted values
592 // or else a clear or destructor on calling param newmap
593 // releases the entries
595 hdecl_name_map.insert(newmap.begin(),
596 newmap.end());
597 }
598
599 };
600
604
605 // map to record type of the method's class to be used as first parameter in the method call
606 typedef std::unordered_map<const CXXMethodDecl *, const Type *> method_object_map_t;
607
610 {
611 public:
615 methodobjtypemap.insert(newmap.methodobjtypemap.begin(), newmap.methodobjtypemap.end());
616 }
617 void print(llvm::raw_ostream & modelout=llvm::outs(), unsigned int indnt=2) {
618 hsimplefunc_name_map_t::print(modelout, indnt);
619 modelout << "Methodobjtypemap follows\n";
620 for( auto entry:methodobjtypemap) {
621 modelout << entry.first << " " <<entry.second << "\n";
622 }
623 modelout << "Methodobjtypemap end\n";
624
625 }
626 };
627
628 typedef std::unordered_map<const CXXMethodDecl *, const CXXMethodDecl *> overridden_method_map_t;
629
630 // thread name, reset var name, false|true, ASYNC|SYNC
631 typedef std::unordered_map<string, hNodep> resetvar_map_t;
632
633
634} // end namespace hnode
635
636#endif
hNode(bool lf)
Definition hNode.h:117
void dumphcode()
Definition hNode.h:211
hdlopsEnum h_op
Definition hNode.h:107
hdlopsEnum getopc()
Definition hNode.h:173
string getname()
Definition hNode.h:169
string h_name
Definition hNode.h:106
string printopc(hdlopsEnum opc)
Definition hNode.h:165
void set(hdlopsEnum h, string s="")
Definition hNode.h:148
std::vector< hNodep > child_list
Definition hNode.h:109
void append(hNodep hnew)
Definition hNode.h:157
int size()
Definition hNode.h:161
hNode(hdlopsEnum h)
Definition hNode.h:123
const string hdlop_pn[hLast+1]
Definition hNode.h:114
hNode(string s, hdlopsEnum h)
Definition hNode.h:129
hdlopsEnum str2hdlopenum(string st)
Definition hNode.h:179
void set(string s="")
Definition hNode.h:153
void print(llvm::raw_ostream &modelout=llvm::outs(), unsigned int indnt=2)
Definition hNode.h:188
void print(llvm::raw_ostream &modelout=llvm::outs(), unsigned int indnt=2)
Definition hNode.h:617
method_object_map_t methodobjtypemap
Definition hNode.h:612
void insertall(hfunc_name_map_t newmap)
Definition hNode.h:613
string newname()
Definition hNode.h:511
string get_prefix()
Definition hNode.h:515
string prefix
Definition hNode.h:507
void set_prefix(string prfx)
Definition hNode.h:514
name_serve(string prefx=lvar_prefix)
Definition hNode.h:510
void reset_referenced()
Definition hNode.h:567
void add_entry(T declp, string old_name, hNodep hnp)
Definition hNode.h:539
bool is_referenced(T declp)
Definition hNode.h:560
void set_prefix(string prefix)
Definition hNode.h:573
name_serve ns
Definition hNode.h:533
string get_prefix()
Definition hNode.h:575
std::map< T, names_t >::iterator end()
Definition hNode.h:588
newname_map_t(string prefix=lvar_prefix)
Definition hNode.h:538
string find_entry_newn(T declp, bool set_ref=false)
Definition hNode.h:552
std::map< T, names_t > hdecl_name_map
Definition hNode.h:534
std::map< T, names_t >::iterator begin()
Definition hNode.h:587
void print(llvm::raw_ostream &modelout=llvm::outs(), unsigned int indnt=2)
Definition hNode.h:581
void insertall(newname_map_t< T > newmap)
Definition hNode.h:594
std::unordered_set< const Type * > types_seen
Definition hNode.h:228
bool isSCFunc(const string &tstring)
Definition hNode.h:418
bool checkNamespace(const FunctionDecl *fd)
Definition hNode.h:267
int scbtlen[numstr]
Definition hNode.h:243
const string scbuiltintype[numstr]
Definition hNode.h:233
bool isSCMacro(const std::string &str_in)
Definition hNode.h:430
bool isTypename(const string &tstring)
Definition hNode.h:423
static const int numstr
Definition hNode.h:232
bool isSCBuiltinType(const string &tstring, const Type *typ=NULL)
Definition hNode.h:389
bool isSCType(const string &tstring, const clang::Type *typ=NULL)
Definition hNode.h:438
static bool isposint(const std::string &str)
Definition hNode.h:473
const set< std::string > sc_built_in_funcs
Definition hNode.h:244
static void make_ident(string &nm)
Definition hNode.h:254
#define HNODEen
Definition hNode.h:32
Definition hNode.h:24
newname_map_t< NamedDecl * > hdecl_name_map_t
Definition hNode.h:601
std::unordered_map< string, hNodep > resetvar_map_t
Definition hNode.h:631
newname_map_t< FunctionDecl * > hsimplefunc_name_map_t
Definition hNode.h:603
std::unordered_map< const CXXMethodDecl *, const Type * > method_object_map_t
Definition hNode.h:606
newname_map_t< ModuleInstance * > hmodinst_name_map_t
Definition hNode.h:602
hNode * hNodep
Definition hNode.h:28
std::unordered_map< const CXXMethodDecl *, const CXXMethodDecl * > overridden_method_map_t
Definition hNode.h:628
bool is_sigvar(hNodep hnp)
Definition hNode.h:499
bool isInNamespace(const clang::ValueDecl *fd, const std::vector< llvm::StringRef > &names)
std::string to_string(T *pointer)
Definition ProcessDecl.h:18
hNodep h_vardeclp
Definition hNode.h:484
bool referenced
Definition hNode.h:485
string oldn
Definition hNode.h:482
string newn
Definition hNode.h:483