From: Felipe de Azevedo Piovezan Date: Mon, 17 Apr 2023 21:17:04 +0000 (-0400) Subject: [coro][nfc] Use Load/Store instruction APIs X-Git-Tag: upstream/17.0.6~11192 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=877280088a5465aa7c1db23708894737091106b5;p=platform%2Fupstream%2Fllvm.git [coro][nfc] Use Load/Store instruction APIs Instead of hard-coding operand indices, it is cleaner to use the APIs provided by the Load/Store Inst classes. Differential Revision: https://reviews.llvm.org/D148571 --- diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp index 90fe01a..8c130be 100644 --- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp @@ -2832,7 +2832,7 @@ void coro::salvageDebugInfo( while (auto *Inst = dyn_cast_or_null(Storage)) { if (auto *LdInst = dyn_cast(Inst)) { - Storage = LdInst->getOperand(0); + Storage = LdInst->getPointerOperand(); // FIXME: This is a heuristic that works around the fact that // LLVM IR debug intrinsics cannot yet distinguish between // memory and value locations: Because a dbg.declare(alloca) is @@ -2842,7 +2842,7 @@ void coro::salvageDebugInfo( if (!SkipOutermostLoad) Expr = DIExpression::prepend(Expr, DIExpression::DerefBefore); } else if (auto *StInst = dyn_cast(Inst)) { - Storage = StInst->getOperand(0); + Storage = StInst->getValueOperand(); } else { SmallVector Ops; SmallVector AdditionalValues;