aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation/ProfilingUtils.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-18 08:47:13 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-18 08:47:13 +0000
commit8a903db4990d57aadea5cdad601ff26e92899103 (patch)
treee0d11dd482aa821ec2e4eeed634ce22ad527dbbb /lib/Transforms/Instrumentation/ProfilingUtils.cpp
parentd97321ceb313f06fd9a824cf26b9dc5b80b3eb9d (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/ProfilingUtils.cpp')
-rw-r--r--lib/Transforms/Instrumentation/ProfilingUtils.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/lib/Transforms/Instrumentation/ProfilingUtils.cpp
index 274275a689..4adf09e099 100644
--- a/lib/Transforms/Instrumentation/ProfilingUtils.cpp
+++ b/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);