int main() { global = 2; changeGlobal(10); if(global == 14) { "reachable"; } else { "unreachable1"; } if(global < 17 && global > 13) { "reachable"; } else { "unreachable2"; } global = 5; changeGlobal(12); if(global == 16) { "reachable"; } else { "unreachable3"; } if(!(global > 16 || global < 14)) { "reachable"; } else { "unreachable4"; } }
bool Variables::runOnModule(Module &module) { errs() << "Running Variables\n"; doInitialization(module); vector<Change*>::iterator it; for(it = changes[GLOBALVAR].begin(); it != changes[GLOBALVAR].end(); it++) { changeGlobal(*it, module); // TODO: return value and metadata } for(it = changes[LOCALVAR].begin(); it != changes[LOCALVAR].end(); it++) { AllocaInst* newTarget = changeLocal(*it); if (newTarget) { errs() << "\tProcessed local variable: " << newTarget->getName() << "\n"; updateMetadata(module, (*it)->getValue(), newTarget, (*it)->getType()[0]); #ifdef DEBUG verifyModule(module, AbortProcessAction); errs() << "**** MODULE VERIFIES after a single change ****\n"; #endif } } return true; }