This is an archive of the discontinued LLVM Phabricator instance.

[Coroutines] Less IR for noexcept await_resume
ClosedPublic

Authored by modocache on Jun 2 2018, 12:18 AM.

Details

Summary

In his review of https://reviews.llvm.org/D45860, @GorNishanov suggested
avoiding generating additional exception-handling IR in the case that
the resume function was marked as 'noexcept', and exceptions could not
occur. This implements that suggestion.

Test Plan: check-clang

Diff Detail

Repository
rL LLVM

Event Timeline

modocache created this revision.Jun 2 2018, 12:18 AM
GorNishanov accepted this revision.Jun 23 2018, 9:53 AM

LGTM with some suggestions.

lib/CodeGen/CGCoroutine.cpp
224 ↗(On Diff #149604)

This long sequence of if statements seems to be asking to be put into its own predicate function: expressionCanThrow or something like that.

This revision is now accepted and ready to land.Jun 23 2018, 9:53 AM

Great, thanks @GorNishanov! I moved the 'can throw' logic into a function called 'memberCallExpressionCanThrow', to convey that some dyn_cast'ing is going on.

modocache marked an inline comment as done.Jun 23 2018, 11:39 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.