comparison gen/passes/GarbageCollect2Stack.cpp @ 1559:06d5cc873350

getTrue/getFalse were moved back to ConstantInt Requires LLVM >= r77685
author Benjamin Kramer <benny.kra@gmail.com>
date Fri, 31 Jul 2009 19:11:07 +0200
parents 3adcb70700cb
children 8d086d552909
comparison
equal deleted inserted replaced
1558:3adcb70700cb 1559:06d5cc873350
224 Constant* hasCustomDelete = dyn_cast<Constant>(MD_GetElement(node, CD_CustomDelete)); 224 Constant* hasCustomDelete = dyn_cast<Constant>(MD_GetElement(node, CD_CustomDelete));
225 if (hasDestructor == NULL || hasCustomDelete == NULL) 225 if (hasDestructor == NULL || hasCustomDelete == NULL)
226 return false; 226 return false;
227 227
228 if (ConstantExpr::getOr(hasDestructor, hasCustomDelete) 228 if (ConstantExpr::getOr(hasDestructor, hasCustomDelete)
229 != A.M.getContext().getFalse()) 229 != ConstantInt::getFalse(A.M.getContext()))
230 return false; 230 return false;
231 231
232 Ty = MD_GetElement(node, CD_BodyType)->getType(); 232 Ty = MD_GetElement(node, CD_BodyType)->getType();
233 return true; 233 return true;
234 } 234 }
305 // work to preserve the control flow. 305 // work to preserve the control flow.
306 306
307 // Create a "conditional" branch that -simplifycfg can clean up, so we 307 // Create a "conditional" branch that -simplifycfg can clean up, so we
308 // can keep using the DominatorTree without updating it. 308 // can keep using the DominatorTree without updating it.
309 BranchInst::Create(Invoke->getNormalDest(), Invoke->getUnwindDest(), 309 BranchInst::Create(Invoke->getNormalDest(), Invoke->getUnwindDest(),
310 A.M.getContext().getTrue(), Invoke->getParent()); 310 ConstantInt::getTrue(A.M.getContext()), Invoke->getParent());
311 } 311 }
312 // Remove the runtime call. 312 // Remove the runtime call.
313 if (A.CGNode) 313 if (A.CGNode)
314 A.CGNode->removeCallEdgeFor(CS); 314 A.CGNode->removeCallEdgeFor(CS);
315 CS.getInstruction()->eraseFromParent(); 315 CS.getInstruction()->eraseFromParent();