[PATCH] D23117: [coroutines] Part 4b: Coroutine Devirtualization: Handle unwinding coro.resume and coro.destroy.
Gor Nishanov via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 3 12:43:20 PDT 2016
GorNishanov marked an inline comment as done.
================
Comment at: lib/Transforms/Coroutines/CoroEarly.cpp:72-88
@@ -68,19 +71,19 @@
// This pass has work to do only if we find intrinsics we are going to lower in
// the module.
std::unique_ptr<Lowerer> Lowerer::createIfNeeded(Module &M) {
if (M.getNamedValue(CORO_RESUME_STR) || M.getNamedValue(CORO_DESTROY_STR))
return llvm::make_unique<Lowerer>(M);
return {};
}
//===----------------------------------------------------------------------===//
// Top Level Driver
//===----------------------------------------------------------------------===//
namespace {
struct CoroEarly : public FunctionPass {
static char ID; // Pass identification, replacement for typeid.
CoroEarly() : FunctionPass(ID) {}
----------------
Good idea! Much prettier now.
(I can add getIntrinsicID to CallSite as a separate commit. It will save one line :-) in CoroEarly)
https://reviews.llvm.org/D23117
More information about the llvm-commits
mailing list