aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorStephen Tozer <stephen.tozer@sony.com>2024-03-19 15:09:24 +0000
committerStephen Tozer <stephen.tozer@sony.com>2024-03-19 15:49:10 +0000
commit9a96fb4445f4e9d9a7899189758ee6afbeb6510b (patch)
tree7f1b7bb76fcdb50d343adb726890df46473a8222 /llvm/lib/IR/Constants.cpp
parent25bb7436ca3edbb0f49cef96a27f1e507b973e6c (diff)
downloadllvm-9a96fb4445f4e9d9a7899189758ee6afbeb6510b.zip
llvm-9a96fb4445f4e9d9a7899189758ee6afbeb6510b.tar.gz
llvm-9a96fb4445f4e9d9a7899189758ee6afbeb6510b.tar.bz2
Reapply "[NFC][RemoveDIs] Switch ConstantExpr::getAsInstruction to not insert (#84737)"
Fixes a build error caused by an unupdated getAsInstruction callsite in clang. This reverts commit ab851f7fe946e7eed700ef9d82082eb721860189.
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index e6b92aa..07b5bce 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -3303,7 +3303,7 @@ Value *ConstantExpr::handleOperandChangeImpl(Value *From, Value *ToV) {
NewOps, this, From, To, NumUpdated, OperandNo);
}
-Instruction *ConstantExpr::getAsInstruction(Instruction *InsertBefore) const {
+Instruction *ConstantExpr::getAsInstruction() const {
SmallVector<Value *, 4> ValueOperands(operands());
ArrayRef<Value*> Ops(ValueOperands);
@@ -3322,32 +3322,31 @@ Instruction *ConstantExpr::getAsInstruction(Instruction *InsertBefore) const {
case Instruction::BitCast:
case Instruction::AddrSpaceCast:
return CastInst::Create((Instruction::CastOps)getOpcode(), Ops[0],
- getType(), "", InsertBefore);
+ getType(), "");
case Instruction::InsertElement:
- return InsertElementInst::Create(Ops[0], Ops[1], Ops[2], "", InsertBefore);
+ return InsertElementInst::Create(Ops[0], Ops[1], Ops[2], "");
case Instruction::ExtractElement:
- return ExtractElementInst::Create(Ops[0], Ops[1], "", InsertBefore);
+ return ExtractElementInst::Create(Ops[0], Ops[1], "");
case Instruction::ShuffleVector:
- return new ShuffleVectorInst(Ops[0], Ops[1], getShuffleMask(), "",
- InsertBefore);
+ return new ShuffleVectorInst(Ops[0], Ops[1], getShuffleMask(), "");
case Instruction::GetElementPtr: {
const auto *GO = cast<GEPOperator>(this);
if (GO->isInBounds())
- return GetElementPtrInst::CreateInBounds(
- GO->getSourceElementType(), Ops[0], Ops.slice(1), "", InsertBefore);
+ return GetElementPtrInst::CreateInBounds(GO->getSourceElementType(),
+ Ops[0], Ops.slice(1), "");
return GetElementPtrInst::Create(GO->getSourceElementType(), Ops[0],
- Ops.slice(1), "", InsertBefore);
+ Ops.slice(1), "");
}
case Instruction::ICmp:
case Instruction::FCmp:
return CmpInst::Create((Instruction::OtherOps)getOpcode(),
(CmpInst::Predicate)getPredicate(), Ops[0], Ops[1],
- "", InsertBefore);
+ "");
default:
assert(getNumOperands() == 2 && "Must be binary operator?");
BinaryOperator *BO = BinaryOperator::Create(
- (Instruction::BinaryOps)getOpcode(), Ops[0], Ops[1], "", InsertBefore);
+ (Instruction::BinaryOps)getOpcode(), Ops[0], Ops[1], "");
if (isa<OverflowingBinaryOperator>(BO)) {
BO->setHasNoUnsignedWrap(SubclassOptionalData &
OverflowingBinaryOperator::NoUnsignedWrap);