[llvm] 72bbd15 - [IR] Remove getWithOperandReplaced (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 27 08:43:17 PDT 2021
Author: Kazu Hirata
Date: 2021-08-27T08:42:57-07:00
New Revision: 72bbd1559e75b1e32c7669c4ef7cfa85efc47aef
URL: https://github.com/llvm/llvm-project/commit/72bbd1559e75b1e32c7669c4ef7cfa85efc47aef
DIFF: https://github.com/llvm/llvm-project/commit/72bbd1559e75b1e32c7669c4ef7cfa85efc47aef.diff
LOG: [IR] Remove getWithOperandReplaced (NFC)
The function hasn't been used for at least 10 years.
Added:
Modified:
llvm/include/llvm/IR/Constants.h
llvm/lib/IR/Constants.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h
index 1f716a45b70f..f2d83644876d 100644
--- a/llvm/include/llvm/IR/Constants.h
+++ b/llvm/include/llvm/IR/Constants.h
@@ -1287,10 +1287,6 @@ class ConstantExpr : public Constant {
/// Return a string representation for an opcode.
const char *getOpcodeName() const;
- /// Return a constant expression identical to this one, but with the specified
- /// operand set to the specified value.
- Constant *getWithOperandReplaced(unsigned OpNo, Constant *Op) const;
-
/// This returns the current constant expression with the operands replaced
/// with the specified values. The specified array must have the same number
/// of operands as our current one.
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index b39aa6b026ff..28395a6219c1 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -1508,20 +1508,6 @@ Constant *ConstantExpr::getShuffleMaskForBitcode() const {
return cast<ShuffleVectorConstantExpr>(this)->ShuffleMaskForBitcode;
}
-Constant *
-ConstantExpr::getWithOperandReplaced(unsigned OpNo, Constant *Op) const {
- assert(Op->getType() == getOperand(OpNo)->getType() &&
- "Replacing operand with value of
diff erent type!");
- if (getOperand(OpNo) == Op)
- return const_cast<ConstantExpr*>(this);
-
- SmallVector<Constant*, 8> NewOps;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- NewOps.push_back(i == OpNo ? Op : getOperand(i));
-
- return getWithOperands(NewOps);
-}
-
Constant *ConstantExpr::getWithOperands(ArrayRef<Constant *> Ops, Type *Ty,
bool OnlyIfReduced, Type *SrcTy) const {
assert(Ops.size() == getNumOperands() && "Operand count mismatch!");
More information about the llvm-commits
mailing list