cloud9_root/src/cloud9/lib/Module/ProgramDependenceGraph.cpp
// Create a memcpy from-->to. This will dereference both of the passed values
Create a memcpy from-->to. This will dereference both of the passed values
Create a memcpy from -- > to . This will dereference both of the passed values
std::string PDG::createMemCpy(Value *to, Value *from) {
	assert(to && "NULL Passed");
	assert(from && "NULL Passed");
	assert(from->getType() && "from value with NULL type");
	assert(from->getType()->isPointerTy() && "from value that is not a pointer");
	assert(from->getType()->isPointerTy() && "from value that is not a pointer");
	std::string toStr = IDMap.saveAndGetID(to);
	std::string fromStr = IDMap.saveAndGetID(from);
	std::string derefFrom = ValToStrDB::rmStar(fromStr);
	std::string derefTo = ValToStrDB::rmStar(toStr);
	std::string ret = createAssign(derefTo, toStr);
	ret += "\n";
	ret += createAssign(derefFrom, fromStr);
	ret += "\n";
	ret += createAssign(derefTo, derefFrom);
	return ret;
}
std :: string PDG :: createMemCpy ( Value * to , Value * from ) { assert ( to && " " ) ; assert ( from && " " ) ; assert ( from -> getType ( ) && " " ) ; assert ( from -> getType ( ) -> isPointerTy ( ) && " " ) ; assert ( from -> getType ( ) -> isPointerTy ( ) && " " ) ; std :: string toStr = IDMap . saveAndGetID ( to ) ; std :: string fromStr = IDMap . saveAndGetID ( from ) ; std :: string derefFrom = ValToStrDB :: rmStar ( fromStr ) ; std :: string derefTo = ValToStrDB :: rmStar ( toStr ) ; std :: string ret = createAssign ( derefTo , toStr ) ; ret += " \n " ; ret += createAssign ( derefFrom , fromStr ) ; ret += " \n " ; ret += createAssign ( derefTo , derefFrom ) ; return ret ; }
Create a memcpy from-->to.
Create a memcpy from -- > to .
// Get the ID of the dereferenced form of the from pointer // When we dereference a pointer we create a new (and unique) node in the // program dependence graph. We need to connect it with its parent (e.g., // the store, which is a dereferenced pointer assignment, should have the // same control dependencies as its parent).