diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-18 08:47:13 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-18 08:47:13 +0000 |
| commit | 668d90f2892ed5700faa78951c5686923f2a9d6e (patch) | |
| tree | 31a8d79358950aa31145c73963241655e17ee1f1 /llvm/lib/Transforms/Instrumentation | |
| parent | 4800c38a7546a8fc2435722b9e05470edb15d03e (diff) | |
| download | bcm5719-llvm-668d90f2892ed5700faa78951c5686923f2a9d6e.tar.gz bcm5719-llvm-668d90f2892ed5700faa78951c5686923f2a9d6e.zip | |
Convert the last uses of CastInst::createInferredCast to a normal cast
creation. These changes are still temporary but at least this pushes
knowledge of signedness out closer to where it can be determined properly
and allows signedness to be removed from VMCore.
llvm-svn: 32654
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp index 274275a689b..4adf09e0999 100644 --- a/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp +++ b/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp @@ -62,8 +62,10 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName, case 2: AI = MainFn->arg_begin(); ++AI; if (AI->getType() != ArgVTy) { + Instruction::CastOps opcode = CastInst::getCastOpcode(AI, + AI->getType()->isSigned(), ArgVTy, ArgVTy->isSigned()); InitCall->setOperand(2, - CastInst::createInferredCast(AI, ArgVTy, "argv.cast", InitCall)); + CastInst::create(opcode, AI, ArgVTy, "argv.cast", InitCall)); } else { InitCall->setOperand(2, AI); } @@ -74,11 +76,18 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName, // If the program looked at argc, have it look at the return value of the // init call instead. if (AI->getType() != Type::IntTy) { - if (!AI->use_empty()) + Instruction::CastOps opcode; + if (!AI->use_empty()) { + opcode = CastInst::getCastOpcode(InitCall, + InitCall->getType()->isSigned(), AI->getType(), + AI->getType()->isSigned()); AI->replaceAllUsesWith( - CastInst::createInferredCast(InitCall, AI->getType(), "", InsertPos)); + CastInst::create(opcode, InitCall, AI->getType(), "", InsertPos)); + } + opcode = CastInst::getCastOpcode(AI, AI->getType()->isSigned(), + Type::IntTy, true); InitCall->setOperand(1, - CastInst::createInferredCast(AI, Type::IntTy, "argc.cast", InitCall)); + CastInst::create(opcode, AI, Type::IntTy, "argc.cast", InitCall)); } else { AI->replaceAllUsesWith(InitCall); InitCall->setOperand(1, AI); |

