1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Use std::vector<DFCalculateWorkObject> instead of

std::vector<DFCalculateWorkObject *> to reduce malloc/free traffic.

llvm-svn: 35368
This commit is contained in:
Devang Patel 2007-03-26 23:17:19 +00:00
parent ce2097be73
commit 3062ae001d

View File

@ -455,13 +455,12 @@ DominanceFrontier::calculate(const DominatorTree &DT,
BasicBlock *BB = Node->getBlock();
DomSetType *Result = NULL;
std::vector<DFCalculateWorkObject *> workList;
std::vector<DFCalculateWorkObject> workList;
std::set<BasicBlock *> visited;
DFCalculateWorkObject *W = new DFCalculateWorkObject(BB, NULL, Node, NULL);
workList.push_back(W);
workList.push_back(DFCalculateWorkObject(BB, NULL, Node, NULL));
do {
DFCalculateWorkObject *currentW = workList.back();
DFCalculateWorkObject *currentW = &workList.back();
assert (currentW && "Missing work object.");
BasicBlock *currentBB = currentW->currentBB;
@ -494,9 +493,7 @@ DominanceFrontier::calculate(const DominatorTree &DT,
DominatorTree::Node *IDominee = *NI;
BasicBlock *childBB = IDominee->getBlock();
if (visited.count(childBB) == 0) {
DFCalculateWorkObject *newW =
new DFCalculateWorkObject(childBB, currentBB, IDominee, currentNode);
workList.push_back(newW);
workList.push_back(DFCalculateWorkObject(childBB, currentBB, IDominee, currentNode));
visitChild = true;
}
}