Make StripPointerCast a common function (should we mak it method of Value instead?)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50775 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov
2008-05-06 22:52:30 +00:00
parent f092b64a49
commit b04adddd50
9 changed files with 42 additions and 43 deletions

View File

@ -325,8 +325,7 @@ void ShadowStackCollector::CollectRoots(Function &F) {
if (Function *F = CI->getCalledFunction())
if (F->getIntrinsicID() == Intrinsic::gcroot) {
std::pair<CallInst*,AllocaInst*> Pair = std::make_pair(
CI, cast<AllocaInst>(
IntrinsicInst::StripPointerCasts(CI->getOperand(1))));
CI, cast<AllocaInst>(StripPointerCasts(CI->getOperand(1))));
if (IsNullValue(CI->getOperand(2)))
Roots.push_back(Pair);
else