[llvm-commits] CVS: poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Feb 21 22:20:43 PST 2004
Changes in directory poolalloc/lib/PoolAllocate:
TransformFunctionBody.cpp updated: 1.18 -> 1.19
---
Log message:
Efficiency improvements, add warning for potential problem case.
---
Diffs of the changes: (+10 -8)
Index: poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp
diff -u poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.18 poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.19
--- poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.18 Thu Feb 19 16:46:18 2004
+++ poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Sat Feb 21 22:09:50 2004
@@ -405,11 +405,12 @@
#if 1
// Map the nodes that are pointed to by globals.
// For all globals map getDSNodeForGlobal(g)->CG.getDSNodeForGlobal(g)
- for (DSGraph::ScalarMapTy::iterator SMI = G.getScalarMap().begin(),
- SME = G.getScalarMap().end(); SMI != SME; ++SMI)
- if (GlobalValue *GV = dyn_cast<GlobalValue>(SMI->first))
- DSGraph::computeNodeMapping(CalleeGraph->getNodeForValue(GV),
- SMI->second, NodeMapping, false);
+ for (DSScalarMap::global_iterator SMI = G.getScalarMap().global_begin(),
+ SME = G.getScalarMap().global_end(); SMI != SME; ++SMI) {
+ DSGraph::computeNodeMapping(CalleeGraph->getNodeForValue(*SMI),
+ G.getNodeForValue(*SMI),
+ NodeMapping, false);
+ }
#endif
@@ -417,13 +418,14 @@
// pool descriptors to pass in...
std::vector<Value*> Args;
for (unsigned i = 0, e = ArgNodes.size(); i != e; ++i) {
- Value *ArgVal = 0;
+ Value *ArgVal = Constant::getNullValue(PoolAllocate::PoolDescPtrTy);
if (NodeMapping.count(ArgNodes[i]))
if (DSNode *LocalNode = NodeMapping[ArgNodes[i]].getNode())
if (FI.PoolDescriptors.count(LocalNode))
ArgVal = FI.PoolDescriptors.find(LocalNode)->second;
- Args.push_back(ArgVal ? ArgVal :
- Constant::getNullValue(PoolAllocate::PoolDescPtrTy));
+ if (isa<Constant>(ArgVal) && cast<Constant>(ArgVal)->isNullValue())
+ std::cerr << "WARNING: NULL POOL ARGUMENTS ARE PASSED IN!\n";
+ Args.push_back(ArgVal);
}
// Add the rest of the arguments...
More information about the llvm-commits
mailing list