This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by dpaoliello on Jan 11 2021, 2:47 PM.

Details

Summary

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.

Diff Detail

Event Timeline

dpaoliello created this revision.Jan 11 2021, 2:47 PM
dpaoliello requested review of this revision.Jan 11 2021, 2:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2021, 2:47 PM
lxfind accepted this revision.Jan 11 2021, 2:57 PM
This revision is now accepted and ready to land.Jan 11 2021, 2:57 PM

@lxfind Can you please merge this in?

AlexeySachkov added inline comments.
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
1538

I wonder, why do we need the second (void)CS if we already had one on line 1542 right within the same if?

lxfind added inline comments.Jan 25 2021, 8:23 AM
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
1538

hah looks like this was fixed in https://github.com/llvm/llvm-project/commit/fb98a1be43645c87fff089c4cc9555ca2400268c a day before this commit