diff options
| author | Felipe de Azevedo Piovezan <fpiovezan@apple.com> | 2022-07-28 14:53:47 -0700 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2022-07-28 14:55:07 -0700 |
| commit | 0ef6809c48515e5ae2c7cb1ad34fa2169a40b0fa (patch) | |
| tree | 9bb52f2199a56e86e0ec5bfcb5676b50cc708515 /llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp | |
| parent | af3ed4a2a760580e9f0e04c7320edafc575d02b8 (diff) | |
[GlobalISel][nfc] Remove unnecessary cast
The getOperand method already returns a Constant when it is called on
a ConstantExpression, as such the cast is not needed. To prevent a type
mismatch between the different return statements of the lambda, the
lambda return type is explicitly provided.
Differential Revision: https://reviews.llvm.org/D130719
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp index 4ecfda15d032..7328ea4eed25 100644 --- a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp +++ b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp @@ -97,10 +97,10 @@ MachineInstrBuilder MachineIRBuilder::buildConstDbgValue(const Constant &C, "Expected inlined-at fields to agree"); auto MIB = buildInstrNoInsert(TargetOpcode::DBG_VALUE); - auto *NumericConstant = [&] { + auto *NumericConstant = [&] () -> const Constant* { if (const auto *CE = dyn_cast<ConstantExpr>(&C)) if (CE->getOpcode() == Instruction::IntToPtr) - return cast<const Constant>(CE->getOperand(0)); + return CE->getOperand(0); return &C; }(); |
