[llvm-branch-commits] [llvm] ff5e896 - Fix unused variable in CoroFrame.cpp when building Release with GCC 10

Xun Li via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 13 22:57:51 PST 2021


Author: Daniel Paoliello
Date: 2021-01-13T22:53:25-08:00
New Revision: ff5e896425577f445ed080d88b582aab0896fba0

URL: https://github.com/llvm/llvm-project/commit/ff5e896425577f445ed080d88b582aab0896fba0
DIFF: https://github.com/llvm/llvm-project/commit/ff5e896425577f445ed080d88b582aab0896fba0.diff

LOG: Fix unused variable in CoroFrame.cpp when building Release with GCC 10

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

Added: 
    

Modified: 
    llvm/lib/Transforms/Coroutines/CoroFrame.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
index 84b78fce3f44..16e7e2c2ceaf 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<CatchSwitchInst>(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);


        


More information about the llvm-branch-commits mailing list