[llvm-commits] CVS: poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Nov 11 00:12:02 PST 2003
Changes in directory poolalloc/lib/PoolAllocate:
TransformFunctionBody.cpp updated: 1.7 -> 1.8
---
Log message:
Minor cleanups
---
Diffs of the changes: (+6 -8)
Index: poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp
diff -u poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.7 poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.8
--- poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.7 Mon Nov 10 13:00:32 2003
+++ poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Tue Nov 11 00:11:35 2003
@@ -473,9 +473,9 @@
// 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 (isa<GlobalValue>(SMI->first)) {
+ if (GlobalValue *GV = dyn_cast<GlobalValue>(SMI->first)) {
CalcNodeMapping(SMI->second,
- CG.getScalarMap()[SMI->first], NodeMapping);
+ CG.getScalarMap()[GV], NodeMapping);
}
unsigned idx = CFI->PoolArgFirst;
@@ -484,16 +484,15 @@
// CFI.
for (unsigned i = 0, e = CFI->ArgNodes.size(); i != e; ++i, ++idx) {
if (NodeMapping.count(CFI->ArgNodes[i])) {
- assert(NodeMapping.count(CFI->ArgNodes[i]) && "Node not in mapping!");
DSNode *LocalNode = NodeMapping.find(CFI->ArgNodes[i])->second;
if (LocalNode) {
assert(FI.PoolDescriptors.count(LocalNode) &&
"Node not pool allocated?");
PoolArgs[idx] = FI.PoolDescriptors.find(LocalNode)->second;
- }
- else
+ } else {
// LocalNode is null when a constant is passed in as a parameter
PoolArgs[idx] = Constant::getNullValue(PoolAllocate::PoolDescPtrTy);
+ }
} else {
PoolArgs[idx] = Constant::getNullValue(PoolAllocate::PoolDescPtrTy);
}
@@ -591,9 +590,8 @@
// 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 (isa<GlobalValue>(SMI->first))
- CalcNodeMapping(SMI->second,
- CG.getScalarMap()[SMI->first], NodeMapping);
+ if (GlobalValue *GV = dyn_cast<GlobalValue>(SMI->first))
+ CalcNodeMapping(SMI->second, CG.getScalarMap()[GV], NodeMapping);
// Okay, now that we have established our mapping, we can figure out which
// pool descriptors to pass in...
More information about the llvm-commits
mailing list