[PATCH] D30776: [coroutines] Fix diagnostics depending on the first coroutine statement.

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 8 23:59:33 PST 2017


EricWF created this revision.
Herald added a subscriber: mehdi_amini.

Some coroutine diagnostics need to point to the location of the first coroutine keyword in the function, like when diagnosing a `return` inside a coroutine. Previously we did this by storing each *valid* coroutine statement in a list and select the first one to use in diagnostics. However if every coroutine statement is invalid we would have no location to point to.

This patch fixes the storage of the first coroutine statement location, ensuring that it gets stored even when the resulting AST node would be invalid. 
This patch also removes the `CoroutineStmts` list in `FunctionScopeInfo` because it was unused.


https://reviews.llvm.org/D30776

Files:
  include/clang/Sema/ScopeInfo.h
  lib/Sema/ScopeInfo.cpp
  lib/Sema/SemaCoroutine.cpp
  lib/Sema/TreeTransform.h
  test/SemaCXX/coroutines.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30776.91138.patch
Type: text/x-patch
Size: 11483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170309/5eea58ac/attachment.bin>


More information about the cfe-commits mailing list