00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef __VISITOR_H__
00037 #define __VISITOR_H__
00038
00039 #ifndef NULL
00040 #define NULL 0 // Often defined in stdio.h
00041 #endif
00042
00043 #include "exp.h"
00044
00045
00046 class Statement;
00047 class Assignment;
00048 class Assign;
00049 class ImplicitAssign;
00050 class PhiAssign;
00051 class BoolAssign;
00052 class CaseStatement;
00053 class CallStatement;
00054 class ReturnStatement;
00055 class GotoStatement;
00056 class BranchStatement;
00057 class ImpRefStatement;
00058
00059 class RTL;
00060 class UserProc;
00061 class Cfg;
00062 class Prog;
00063 class BasicBlock;
00064 typedef BasicBlock* PBB;
00065
00066 class LocationSet;
00067
00068
00069
00070
00071
00072 class ExpVisitor {
00073
00074 public:
00075 ExpVisitor() { }
00076 virtual ~ExpVisitor() { }
00077
00078
00079
00080 virtual bool visit(Unary *e, bool& override) {override = false; return true;}
00081 virtual bool visit(Binary *e, bool& override) {override = false; return true;}
00082 virtual bool visit(Ternary *e, bool& override) {override = false; return true;}
00083 virtual bool visit(TypedExp *e, bool& override) {override = false; return true;}
00084 virtual bool visit(FlagDef *e, bool& override) {override = false; return true;}
00085 virtual bool visit(RefExp *e, bool& override) {override = false; return true;}
00086 virtual bool visit(Location *e, bool& override) {override = false; return true;}
00087
00088 virtual bool visit(Const *e ) {return true;}
00089 virtual bool visit(Terminal *e) {return true;}
00090 virtual bool visit(TypeVal *e ) {return true;}
00091 };
00092
00093
00094 class FixProcVisitor : public ExpVisitor {
00095
00096 UserProc* proc;
00097
00098 public:
00099 void setProc(UserProc* p) { proc = p; }
00100 virtual bool visit(Location *e, bool& override);
00101
00102 };
00103
00104
00105 class GetProcVisitor : public ExpVisitor {
00106 UserProc* proc;
00107
00108 public:
00109 GetProcVisitor() {proc = NULL;}
00110 UserProc* getProc() {return proc;}
00111 virtual bool visit(Location *e, bool& override);
00112
00113 };
00114
00115
00116 class SetConscripts : public ExpVisitor {
00117 int curConscript;
00118 bool bInLocalGlobal;
00119 bool bClear;
00120 public:
00121 SetConscripts(int n, bool bClear) : bInLocalGlobal(false), bClear(bClear) {curConscript = n;}
00122 int getLast() {return curConscript;}
00123 virtual bool visit(Const* e);
00124 virtual bool visit(Location* e, bool& override);
00125 virtual bool visit(Binary* b, bool& override);
00126
00127 };
00128
00129
00130
00131
00132
00133
00134 class ExpModifier {
00135 protected:
00136 bool mod;
00137 public:
00138 ExpModifier() {mod = false;}
00139 virtual ~ExpModifier() { }
00140 bool isMod() {return mod;}
00141 void clearMod() {mod = false;}
00142
00143
00144
00145
00146 virtual Exp* preVisit(Unary *e, bool& recur) {recur = true; return e;}
00147 virtual Exp* preVisit(Binary *e, bool& recur) {recur = true; return e;}
00148 virtual Exp* preVisit(Ternary *e, bool& recur) {recur = true; return e;}
00149 virtual Exp* preVisit(TypedExp *e, bool& recur) {recur = true; return e;}
00150 virtual Exp* preVisit(FlagDef *e, bool& recur) {recur = true; return e;}
00151 virtual Exp* preVisit(RefExp *e, bool& recur) {recur = true; return e;}
00152 virtual Exp* preVisit(Location *e, bool& recur) {recur = true; return e;}
00153 virtual Exp* preVisit(Const *e ) { return e;}
00154 virtual Exp* preVisit(Terminal *e ) { return e;}
00155 virtual Exp* preVisit(TypeVal *e ) { return e;}
00156
00157
00158 virtual Exp* postVisit(Unary *e) {return e;}
00159 virtual Exp* postVisit(Binary *e) {return e;}
00160 virtual Exp* postVisit(Ternary *e) {return e;}
00161 virtual Exp* postVisit(TypedExp *e) {return e;}
00162 virtual Exp* postVisit(FlagDef *e) {return e;}
00163 virtual Exp* postVisit(RefExp *e) {return e;}
00164 virtual Exp* postVisit(Location *e) {return e;}
00165 virtual Exp* postVisit(Const *e) {return e;}
00166 virtual Exp* postVisit(Terminal *e) {return e;}
00167 virtual Exp* postVisit(TypeVal *e) {return e;}
00168 };
00169
00170
00171
00172
00173
00174
00175 class StmtVisitor {
00176 public:
00177 StmtVisitor() { }
00178 virtual ~StmtVisitor() { }
00179
00180
00181
00182 virtual bool visit(RTL *rtl);
00183 virtual bool visit(Assign *stmt) { return true;}
00184 virtual bool visit(PhiAssign *stmt) { return true;}
00185 virtual bool visit(ImplicitAssign *stmt) { return true;}
00186 virtual bool visit(BoolAssign *stmt) { return true;}
00187 virtual bool visit(GotoStatement *stmt) { return true;}
00188 virtual bool visit(BranchStatement *stmt) { return true;}
00189 virtual bool visit(CaseStatement *stmt) { return true;}
00190 virtual bool visit(CallStatement *stmt) { return true;}
00191 virtual bool visit(ReturnStatement *stmt) { return true;}
00192 virtual bool visit(ImpRefStatement *stmt) { return true;}
00193 };
00194
00195 class StmtConscriptSetter : public StmtVisitor {
00196 int curConscript;
00197 bool bClear;
00198 public:
00199 StmtConscriptSetter(int n, bool bClear) : curConscript(n), bClear(bClear) {}
00200 int getLast() {return curConscript;}
00201
00202 virtual bool visit(Assign *stmt);
00203 virtual bool visit(PhiAssign *stmt);
00204 virtual bool visit(ImplicitAssign *stmt);
00205 virtual bool visit(BoolAssign *stmt);
00206 virtual bool visit(CaseStatement *stmt);
00207 virtual bool visit(CallStatement *stmt);
00208 virtual bool visit(ReturnStatement *stmt);
00209 virtual bool visit(BranchStatement *stmt);
00210 virtual bool visit(ImpRefStatement *stmt);
00211 };
00212
00213
00214
00215 class StmtExpVisitor {
00216 bool ignoreCol;
00217 public:
00218 ExpVisitor* ev;
00219 StmtExpVisitor(ExpVisitor* v, bool ignoreCol = true) : ignoreCol(ignoreCol), ev(v) {}
00220 virtual ~StmtExpVisitor() {}
00221 virtual bool visit( Assign *stmt, bool& override) {override = false; return true;}
00222 virtual bool visit( PhiAssign *stmt, bool& override) {override = false; return true;}
00223 virtual bool visit( ImplicitAssign *stmt, bool& override) {override = false; return true;}
00224 virtual bool visit( BoolAssign *stmt, bool& override) {override = false; return true;}
00225 virtual bool visit( GotoStatement *stmt, bool& override) {override = false; return true;}
00226 virtual bool visit(BranchStatement *stmt, bool& override) {override = false; return true;}
00227 virtual bool visit( CaseStatement *stmt, bool& override) {override = false; return true;}
00228 virtual bool visit( CallStatement *stmt, bool& override) {override = false; return true;}
00229 virtual bool visit(ReturnStatement *stmt, bool& override) {override = false; return true;}
00230 virtual bool visit(ImpRefStatement *stmt, bool& override) {override = false; return true;}
00231
00232 bool isIgnoreCol() {return ignoreCol;}
00233 };
00234
00235
00236
00237
00238
00239
00240
00241
00242 class StmtModifier {
00243 protected:
00244 bool ignoreCol;
00245 public:
00246 ExpModifier* mod;
00247 StmtModifier(ExpModifier* em, bool ic = false) : ignoreCol(ic), mod(em) {}
00248 virtual ~StmtModifier() {}
00249 bool ignoreCollector() {return ignoreCol;}
00250
00251 virtual void visit(Assign *s, bool& recur) {recur = true;}
00252 virtual void visit(PhiAssign *s, bool& recur) {recur = true;}
00253 virtual void visit(ImplicitAssign *s, bool& recur) {recur = true;}
00254 virtual void visit(BoolAssign *s, bool& recur) {recur = true;}
00255 virtual void visit(GotoStatement *s, bool& recur) {recur = true;}
00256 virtual void visit(BranchStatement *s, bool& recur) {recur = true;}
00257 virtual void visit(CaseStatement *s, bool& recur) {recur = true;}
00258 virtual void visit(CallStatement *s, bool& recur) {recur = true;}
00259 virtual void visit(ReturnStatement *s, bool& recur) {recur = true;}
00260 virtual void visit(ImpRefStatement *s, bool& recur) {recur = true;}
00261 };
00262
00263
00264
00265
00266 class StmtPartModifier {
00267 bool ignoreCol;
00268 public:
00269 ExpModifier* mod;
00270 StmtPartModifier(ExpModifier* em, bool ic = false) : ignoreCol(ic), mod(em) {}
00271 virtual ~StmtPartModifier() {}
00272 bool ignoreCollector() {return ignoreCol;}
00273
00274 virtual void visit(Assign *s, bool& recur) {recur = true;}
00275 virtual void visit(PhiAssign *s, bool& recur) {recur = true;}
00276 virtual void visit(ImplicitAssign *s, bool& recur) {recur = true;}
00277 virtual void visit(BoolAssign *s, bool& recur) {recur = true;}
00278 virtual void visit(GotoStatement *s, bool& recur) {recur = true;}
00279 virtual void visit(BranchStatement *s, bool& recur) {recur = true;}
00280 virtual void visit(CaseStatement *s, bool& recur) {recur = true;}
00281 virtual void visit(CallStatement *s, bool& recur) {recur = true;}
00282 virtual void visit(ReturnStatement *s, bool& recur) {recur = true;}
00283 virtual void visit(ImpRefStatement *s, bool& recur) {recur = true;}
00284 };
00285
00286 class PhiStripper : public StmtModifier {
00287 bool del;
00288 public:
00289 PhiStripper(ExpModifier* em) : StmtModifier(em) {del = false;}
00290 virtual void visit(PhiAssign* stmt, bool& recur);
00291 bool getDelete() {return del;}
00292 };
00293
00294
00295 class SimpExpModifier : public ExpModifier {
00296 protected:
00297
00298
00299
00300
00301 unsigned mask;
00302 unsigned unchanged;
00303 public:
00304 SimpExpModifier() { mask = 1; unchanged = (unsigned)-1;}
00305 unsigned getUnchanged() { return unchanged;}
00306 bool isTopChanged() { return !(unchanged & mask);}
00307 virtual Exp* preVisit(Unary *e, bool& recur) { recur = true; mask <<= 1; return e;}
00308 virtual Exp* preVisit(Binary *e, bool& recur) { recur = true; mask <<= 1; return e;}
00309 virtual Exp* preVisit(Ternary *e, bool& recur) { recur = true; mask <<= 1; return e;}
00310 virtual Exp* preVisit(TypedExp *e, bool& recur) { recur = true; mask <<= 1; return e;}
00311 virtual Exp* preVisit(FlagDef *e, bool& recur) { recur = true; mask <<= 1; return e;}
00312 virtual Exp* preVisit(RefExp *e, bool& recur) { recur = true; mask <<= 1; return e;}
00313 virtual Exp* preVisit(Location *e, bool& recur) { recur = true; mask <<= 1; return e;}
00314 virtual Exp* preVisit(Const *e) { mask <<= 1; return e;}
00315 virtual Exp* preVisit(Terminal *e) { mask <<= 1; return e;}
00316 virtual Exp* preVisit(TypeVal *e) { mask <<= 1; return e;}
00317
00318 virtual Exp* postVisit(Unary *e);
00319 virtual Exp* postVisit(Binary *e);
00320 virtual Exp* postVisit(Ternary *e);
00321 virtual Exp* postVisit(TypedExp *e);
00322 virtual Exp* postVisit(FlagDef *e);
00323 virtual Exp* postVisit(RefExp *e);
00324 virtual Exp* postVisit(Location *e);
00325 virtual Exp* postVisit(Const *e);
00326 virtual Exp* postVisit(Terminal *e);
00327 virtual Exp* postVisit(TypeVal *e);
00328 };
00329
00330
00331
00332
00333
00334
00335 class CallBypasser : public SimpExpModifier {
00336 Statement* enclosingStmt;
00337 public:
00338 CallBypasser(Statement* enclosing) : enclosingStmt(enclosing) {}
00339 virtual Exp* postVisit(RefExp *e);
00340 virtual Exp* postVisit(Location *e);
00341 };
00342
00343 class UsedLocsFinder : public ExpVisitor {
00344 LocationSet* used;
00345 bool memOnly;
00346 public:
00347 UsedLocsFinder(LocationSet& used, bool memOnly) : used(&used), memOnly(memOnly) {}
00348 ~UsedLocsFinder() {}
00349
00350 LocationSet* getLocSet() {return used;}
00351 void setMemOnly(bool b) {memOnly = b;}
00352 bool isMemOnly() {return memOnly;}
00353
00354 virtual bool visit(RefExp *e, bool& override);
00355 virtual bool visit(Location *e, bool& override);
00356 virtual bool visit(Terminal* e);
00357 };
00358
00359
00360
00361
00362
00363 class UsedLocalFinder : public ExpVisitor {
00364 LocationSet* used;
00365 UserProc* proc;
00366 bool all;
00367 public:
00368 UsedLocalFinder(LocationSet& used, UserProc* proc) : used(&used), proc(proc), all(false) {}
00369 ~UsedLocalFinder() {}
00370
00371 LocationSet* getLocSet() {return used;}
00372 bool wasAllFound() {return all;}
00373
00374 virtual bool visit(Location *e, bool& override);
00375 virtual bool visit(TypedExp *e, bool& override);
00376 virtual bool visit(Terminal* e);
00377 };
00378
00379 class UsedLocsVisitor : public StmtExpVisitor {
00380 bool countCol;
00381 public:
00382 UsedLocsVisitor(ExpVisitor* v, bool cc) : StmtExpVisitor(v), countCol(cc) {}
00383 virtual ~UsedLocsVisitor() {}
00384
00385
00386 virtual bool visit( Assign *stmt, bool& override);
00387 virtual bool visit( PhiAssign *stmt, bool& override);
00388 virtual bool visit(ImplicitAssign *stmt, bool& override);
00389
00390
00391 virtual bool visit(BoolAssign *stmt, bool& override);
00392
00393
00394 virtual bool visit(CallStatement *stmt, bool& override);
00395
00396 virtual bool visit(ReturnStatement *stmt, bool& override);
00397 };
00398
00399 class ExpSubscripter : public ExpModifier {
00400 Exp* search;
00401 Statement* def;
00402 public:
00403 ExpSubscripter(Exp* s, Statement* d) : search(s), def(d) { }
00404 virtual Exp* preVisit(Location *e, bool& recur);
00405 virtual Exp* preVisit(Binary *e, bool& recur);
00406 virtual Exp* preVisit(Terminal *e);
00407 virtual Exp* preVisit(RefExp *e, bool& recur);
00408 };
00409
00410 class StmtSubscripter : public StmtModifier {
00411 public:
00412 StmtSubscripter(ExpSubscripter* es) : StmtModifier(es) {}
00413 virtual ~StmtSubscripter() {}
00414
00415 virtual void visit( Assign *s, bool& recur);
00416 virtual void visit( PhiAssign *s, bool& recur);
00417 virtual void visit(ImplicitAssign *s, bool& recur);
00418 virtual void visit( BoolAssign *s, bool& recur);
00419 virtual void visit( CallStatement *s, bool& recur);
00420 };
00421
00422 class SizeStripper : public ExpModifier {
00423 public:
00424 SizeStripper() {}
00425 virtual ~SizeStripper() {}
00426
00427 virtual Exp* preVisit(Binary *b, bool& recur);
00428 };
00429
00430 class ExpConstCaster: public ExpModifier {
00431 int num;
00432 Type* ty;
00433 bool changed;
00434 public:
00435 ExpConstCaster(int num, Type* ty) : num(num), ty(ty), changed(false) {}
00436 virtual ~ExpConstCaster() {}
00437 bool isChanged() {return changed;}
00438
00439 virtual Exp* preVisit(Const *c);
00440 };
00441
00442 class ConstFinder : public ExpVisitor {
00443 std::list<Const*>& lc;
00444 public:
00445 ConstFinder(std::list<Const*>& lc) : lc(lc) {}
00446 virtual ~ConstFinder() {}
00447
00448 virtual bool visit(Const *e);
00449 virtual bool visit(Location *e, bool& override);
00450 };
00451
00452 class StmtConstFinder : public StmtExpVisitor {
00453 public:
00454 StmtConstFinder(ConstFinder* v) : StmtExpVisitor(v) {}
00455 };
00456
00457
00458
00459
00460 class DfaLocalMapper : public ExpModifier {
00461 UserProc* proc;
00462 Prog* prog;
00463 Signature* sig;
00464 bool processExp(Exp* e);
00465 public:
00466 bool change;
00467
00468 DfaLocalMapper(UserProc* proc);
00469
00470 Exp* preVisit(Location* e, bool& recur);
00471
00472 Exp* preVisit(Binary* e, bool& recur);
00473 Exp* preVisit(TypedExp* e, bool& recur);
00474 };
00475
00476 #if 0 // FIXME: deleteme
00477 class StmtDfaLocalMapper : public StmtModifier {
00478 public:
00479 StmtDfaLocalMapper(ExpModifier* em, bool ic = false) : StmtModifier(em, ic) {}
00480
00481 virtual void visit( Assign *s, bool& recur);
00482 virtual void visit( PhiAssign *s, bool& recur);
00483 virtual void visit( ImplicitAssign *s, bool& recur);
00484 virtual void visit( BoolAssign *s, bool& recur);
00485 virtual void visit( CallStatement *s, bool& recur);
00486 virtual void visit(BranchStatement *s, bool& recur);
00487 virtual void visit(ReturnStatement *s, bool& recur);
00488 virtual void visit(ImpRefStatement *s, bool& recur);
00489 virtual void visit( CaseStatement *s, bool& recur);
00490 };
00491 #endif
00492
00493
00494
00495
00496 class ImplicitConverter : public ExpModifier {
00497 Cfg* cfg;
00498 public:
00499 ImplicitConverter(Cfg* cfg) : cfg(cfg) { }
00500 Exp* postVisit(RefExp* e);
00501 };
00502
00503 class StmtImplicitConverter : public StmtModifier {
00504 Cfg* cfg;
00505 public:
00506 StmtImplicitConverter(ImplicitConverter* ic, Cfg* cfg)
00507 : StmtModifier(ic, false),
00508 cfg(cfg) { }
00509 virtual void visit( PhiAssign *s, bool& recur);
00510 };
00511
00512 class Localiser : public SimpExpModifier {
00513 CallStatement* call;
00514 public:
00515 Localiser(CallStatement* call) : call(call) { }
00516 Exp* preVisit(RefExp* e, bool& recur);
00517 Exp* preVisit(Location* e, bool& recur);
00518 Exp* postVisit(Location* e);
00519 Exp* postVisit(Terminal* e);
00520 };
00521
00522
00523 class ComplexityFinder : public ExpVisitor {
00524 int count;
00525 UserProc* proc;
00526 public:
00527 ComplexityFinder(UserProc* p) : count(0), proc(p) {}
00528 int getDepth() {return count;}
00529
00530 virtual bool visit(Unary *e, bool& override);
00531 virtual bool visit(Binary *e, bool& override);
00532 virtual bool visit(Ternary *e, bool& override);
00533 virtual bool visit(Location *e, bool& override);
00534
00535 };
00536
00537
00538 class MemDepthFinder : public ExpVisitor {
00539 int depth;
00540 public:
00541 MemDepthFinder() : depth(0) {}
00542 virtual bool visit(Location *e, bool& override);
00543 int getDepth() {return depth;}
00544 };
00545
00546
00547
00548
00549 class ExpPropagator : public SimpExpModifier {
00550 bool change;
00551 public:
00552 ExpPropagator() : change(false) { }
00553 bool isChanged() {return change;}
00554 void clearChanged() {change = false;}
00555 Exp* postVisit(RefExp* e);
00556 };
00557
00558
00559
00560 class PrimitiveTester : public ExpVisitor {
00561 bool result;
00562 public:
00563 PrimitiveTester() : result(true) {}
00564 bool getResult() {return result;}
00565 bool visit(Location *e, bool& override);
00566 bool visit(RefExp *e, bool& override);
00567 };
00568
00569
00570
00571 class ExpHasMemofTester : public ExpVisitor {
00572 bool result;
00573 UserProc* proc;
00574 public:
00575 ExpHasMemofTester(UserProc* proc) : result(false), proc(proc) {}
00576 bool getResult() {return result;}
00577 bool visit(Location *e, bool& override);
00578 };
00579
00580 class TempToLocalMapper : public ExpVisitor {
00581 UserProc* proc;
00582 public:
00583 TempToLocalMapper(UserProc* p) : proc(p) {}
00584 bool visit(Location *e, bool& override);
00585 };
00586
00587
00588 class ExpRegMapper : public ExpVisitor {
00589 UserProc* proc;
00590 Prog* prog;
00591 public:
00592 ExpRegMapper(UserProc* proc);
00593 bool visit(RefExp *e, bool& override);
00594 };
00595
00596 class StmtRegMapper : public StmtExpVisitor {
00597 public:
00598 StmtRegMapper(ExpRegMapper* erm) : StmtExpVisitor(erm) {}
00599 virtual bool common( Assignment *stmt, bool& override);
00600 virtual bool visit( Assign *stmt, bool& override);
00601 virtual bool visit( PhiAssign *stmt, bool& override);
00602 virtual bool visit( ImplicitAssign *stmt, bool& override);
00603 virtual bool visit( BoolAssign *stmt, bool& override);
00604 };
00605
00606 class ConstGlobalConverter : public ExpModifier {
00607 Prog* prog;
00608 public:
00609 ConstGlobalConverter(Prog* pg) : prog(pg) {}
00610 virtual Exp* preVisit(RefExp *e, bool& recur);
00611 };
00612
00613
00614
00615 class ExpDestCounter : public ExpVisitor {
00616 std::map<Exp*, int, lessExpStar>& destCounts;
00617 public:
00618 ExpDestCounter(std::map<Exp*, int, lessExpStar>& dc) : destCounts(dc) {}
00619 bool visit(RefExp *e, bool& override);
00620 };
00621
00622
00623
00624 class StmtDestCounter : public StmtExpVisitor {
00625 public:
00626 StmtDestCounter(ExpDestCounter* edc) : StmtExpVisitor(edc) {}
00627 bool visit( PhiAssign *stmt, bool& override);
00628 };
00629
00630
00631 class FlagsFinder : public ExpVisitor {
00632 bool found;
00633 public:
00634 FlagsFinder() : found(false) {}
00635 bool isFound() {return found;}
00636 private:
00637 virtual bool visit(Binary *e, bool& override);
00638
00639 };
00640
00641
00642 class BadMemofFinder : public ExpVisitor {
00643 bool found;
00644 UserProc* proc;
00645 public:
00646 BadMemofFinder(UserProc* proc) : found(false), proc(proc) {}
00647 bool isFound() {return found;}
00648 private:
00649 virtual bool visit(Location *e, bool& override);
00650 virtual bool visit(RefExp *e, bool& override);
00651 };
00652
00653 class ExpCastInserter : public ExpModifier {
00654 UserProc* proc;
00655 public:
00656 ExpCastInserter(UserProc* proc) : proc(proc) {}
00657 static void checkMemofType(Exp* memof, Type* memofType);
00658 virtual Exp* postVisit(RefExp *e);
00659 virtual Exp* postVisit(Binary *e);
00660 virtual Exp* postVisit(Const *e);
00661 virtual Exp* preVisit(TypedExp *e, bool& recur) {recur = false; return e;}
00662 };
00663
00664 class StmtCastInserter : public StmtVisitor {
00665 ExpCastInserter* ema;
00666 public:
00667 StmtCastInserter() {}
00668 bool common( Assignment *s);
00669 virtual bool visit( Assign *s);
00670 virtual bool visit( PhiAssign *s);
00671 virtual bool visit(ImplicitAssign *s);
00672 virtual bool visit( BoolAssign *s);
00673 };
00674
00675
00676
00677
00678 class ExpSsaXformer : public ExpModifier {
00679 UserProc* proc;
00680 public:
00681 ExpSsaXformer(UserProc* proc) : proc(proc) { }
00682 UserProc* getProc() {return proc;}
00683
00684 virtual Exp* postVisit(RefExp *e);
00685 };
00686
00687 class StmtSsaXformer : public StmtModifier {
00688 UserProc* proc;
00689 public:
00690 StmtSsaXformer(ExpSsaXformer* esx, UserProc* proc) : StmtModifier(esx), proc(proc) {}
00691
00692 void commonLhs(Assignment* s);
00693
00694 virtual void visit( Assign *s, bool& recur);
00695 virtual void visit( PhiAssign *s, bool& recur);
00696 virtual void visit(ImplicitAssign *s, bool& recur);
00697 virtual void visit( BoolAssign *s, bool& recur);
00698 virtual void visit( CallStatement *s, bool& recur);
00699 };
00700
00701 #endif // #ifndef __VISITOR_H__