aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/IntrinsicInst.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-06-19 16:24:46 -0700
committerGitHub <noreply@github.com>2025-06-19 16:24:46 -0700
commitdad64877c811dcce7e2c7ebc216161ecf0733fcf (patch)
tree8f2631589d20be80aab98db8b22642fa94f84c9a /llvm/lib/IR/IntrinsicInst.cpp
parentd8e6d74c6905b3032a3dc9b686bd80bb3feb9857 (diff)
downloadllvm-dad64877c811dcce7e2c7ebc216161ecf0733fcf.zip
llvm-dad64877c811dcce7e2c7ebc216161ecf0733fcf.tar.gz
llvm-dad64877c811dcce7e2c7ebc216161ecf0733fcf.tar.bz2
[llvm] Remove an extraneous cast (NFC) (#144955)
llvm::CallBase::getArgOperand returns Value *, so we do not need const_cast<Value *>.
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r--llvm/lib/IR/IntrinsicInst.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index 256bce1..b1d3339c 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -239,13 +239,13 @@ void DbgAssignIntrinsic::setValue(Value *V) {
ConstantInt *InstrProfCntrInstBase::getNumCounters() const {
if (InstrProfValueProfileInst::classof(this))
llvm_unreachable("InstrProfValueProfileInst does not have counters!");
- return cast<ConstantInt>(const_cast<Value *>(getArgOperand(2)));
+ return cast<ConstantInt>(getArgOperand(2));
}
ConstantInt *InstrProfCntrInstBase::getIndex() const {
if (InstrProfValueProfileInst::classof(this))
llvm_unreachable("Please use InstrProfValueProfileInst::getIndex()");
- return cast<ConstantInt>(const_cast<Value *>(getArgOperand(3)));
+ return cast<ConstantInt>(getArgOperand(3));
}
void InstrProfCntrInstBase::setIndex(uint32_t Idx) {
@@ -255,7 +255,7 @@ void InstrProfCntrInstBase::setIndex(uint32_t Idx) {
Value *InstrProfIncrementInst::getStep() const {
if (InstrProfIncrementInstStep::classof(this)) {
- return const_cast<Value *>(getArgOperand(4));
+ return getArgOperand(4);
}
const Module *M = getModule();
LLVMContext &Context = M->getContext();