Skip to content

Commit 8f3a3bd

Browse files
committed
Use VarDecl::getName instead of Value::getName
1 parent d2e1a8d commit 8f3a3bd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clang/lib/CodeGen/CGDecl.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,11 +1343,6 @@ llvm::Value *CodeGenFunction::EmitLifetimeStart(llvm::TypeSize Size,
13431343
if (!ShouldEmitLifetimeMarkers)
13441344
return nullptr;
13451345

1346-
// No lifetimes on promise alloca, or middle end passes will assume promise
1347-
// dead after lifetime.end, leading to mis-optimization
1348-
if (Addr->getName() == "__promise")
1349-
return nullptr;
1350-
13511346
assert(Addr->getType()->getPointerAddressSpace() ==
13521347
CGM.getDataLayout().getAllocaAddrSpace() &&
13531348
"Pointer should be in alloca address space");
@@ -1604,9 +1599,14 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) {
16041599
bool IsMSCatchParam =
16051600
D.isExceptionVariable() && getTarget().getCXXABI().isMicrosoft();
16061601

1602+
// No lifetime intrinsics on coroutine promise alloca, or middle end
1603+
// passes will assume promise dead after lifetime.end, leading to
1604+
// mis-optimization
1605+
bool IsCoroPromise = D.getName() == "__promise";
1606+
16071607
// Emit a lifetime intrinsic if meaningful. There's no point in doing this
16081608
// if we don't have a valid insertion point (?).
1609-
if (HaveInsertPoint() && !IsMSCatchParam) {
1609+
if (HaveInsertPoint() && !IsMSCatchParam && !IsCoroPromise) {
16101610
// If there's a jump into the lifetime of this variable, its lifetime
16111611
// gets broken up into several regions in IR, which requires more work
16121612
// to handle correctly. For now, just omit the intrinsics; this is a

0 commit comments

Comments
 (0)