aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index e3fdf54..600312e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1318,10 +1318,16 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
Stmt *Body = FD->getBody();
- // Initialize helper which will detect jumps which can cause invalid lifetime
- // markers.
- if (Body && ShouldEmitLifetimeMarkers)
- Bypasses.Init(Body);
+ if (Body) {
+ // Coroutines always emit lifetime markers.
+ if (isa<CoroutineBodyStmt>(Body))
+ ShouldEmitLifetimeMarkers = true;
+
+ // Initialize helper which will detect jumps which can cause invalid
+ // lifetime markers.
+ if (ShouldEmitLifetimeMarkers)
+ Bypasses.Init(Body);
+ }
// Emit the standard function prologue.
StartFunction(GD, ResTy, Fn, FnInfo, Args, Loc, BodyRange.getBegin());