This is an archive of the discontinued LLVM Phabricator instance.

[coroutines] Create allocation and deallocation sub-statements.
AbandonedPublic

Authored by GorNishanov on Oct 4 2016, 3:39 PM.

Details

Reviewers
EricWF
rsmith
Summary
  1. Sema: Add allocation / deallocation substatements.
  2. Sema: Add labels to final-suspend and deallocation substatements.
  3. Sema: Allow co_return in a coroutine all by itself
  4. CG: Emit allocation and deallocation + test

Diff Detail

Event Timeline

GorNishanov updated this revision to Diff 73569.Oct 4 2016, 3:39 PM
GorNishanov retitled this revision from to [coroutines] Create allocation and deallocation sub-statements..
GorNishanov updated this object.
GorNishanov added reviewers: rsmith, EricWF.
GorNishanov added a subscriber: cfe-commits.
majnemer added inline comments.
lib/CodeGen/CGCoroutine.cpp
68–69

I think that's just CGM.getContext().getTargetInfo().getSuitableAlign() / CGM.getContext().getTargetInfo().getCharWidth()

GorNishanov added inline comments.Oct 4 2016, 4:49 PM
lib/CodeGen/CGCoroutine.cpp
68–69

Yay! One less FIXME.

I think I will make it to match STDCPP_DEFAULT_NEW_ALIGNMENT:

Builder.defineMacro("__STDCPP_DEFAULT_NEW_ALIGNMENT__",
                    Twine(TI.getNewAlign() / TI.getCharWidth()) +
                        TI.getTypeConstantSuffix(TI.getSizeType()));
lib/Sema/SemaCoroutine.cpp
570

Remove 'function' from the comment to read:

// Build allocation and deallocation expressions.

Addressed review comments. Anything else, @rsmith?

  1. compute default new align and pass it to coro.id
  2. fix typo in comment
GorNishanov marked 3 inline comments as done.Oct 6 2016, 12:31 PM
GorNishanov abandoned this revision.Oct 20 2016, 1:56 PM

I'll simplify and split it into super tiny microscopic patches to have a better chance of being reviewed.