From ff5e896425577f445ed080d88b582aab0896fba0 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 13 Jan 2021 22:52:40 -0800 Subject: [PATCH] Fix unused variable in CoroFrame.cpp when building Release with GCC 10 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When building with GCC 10, the following warning is reported: ``` /llvm-project/llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1527:28: warning: unused variable ‘CS’ [-Wunused-variable] 1527 | if (CatchSwitchInst *CS = ``` This change adds a cast to `void` to avoid the warning. Reviewed By: lxfind Differential Revision: https://reviews.llvm.org/D94456 --- llvm/lib/Transforms/Coroutines/CoroFrame.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp index 84b78fc..16e7e2c 100644 --- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp @@ -1535,6 +1535,7 @@ static void rewritePHIs(BasicBlock &BB) { for (BasicBlock *Pred : Preds) { if (CatchSwitchInst *CS = dyn_cast(Pred->getTerminator())) { + (void)CS; // CleanupPad with a CatchSwitch predecessor: therefore this is an // unwind destination that needs to be handle specially. assert(CS->getUnwindDest() == &BB); -- 2.7.4