Skip to content

Commit c8dddc0

Browse files
committed
[clang][wip] Reduce initialization logic in EmitAutoVarAlloca
1 parent 053c1f5 commit c8dddc0

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

clang/lib/CodeGen/CGDecl.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,17 +1597,11 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) {
15971597
} else {
15981598
assert(!emission.useLifetimeMarkers());
15991599
}
1600-
if (allocaTy->isIntegerTy()) {
1601-
if (HaveInsertPoint()) {
1602-
auto Freeze = Builder.CreateFreeze(llvm::PoisonValue::get(allocaTy),
1603-
"freeze.poison");
1604-
Builder.CreateStore(Freeze, address);
1605-
} else {
1606-
auto Freeze = new llvm::FreezeInst(llvm::PoisonValue::get(allocaTy),
1607-
"freeze.poison", AllocaInsertPt);
1608-
new llvm::StoreInst(Freeze, AllocaAddr.getPointer(), AllocaInsertPt);
1609-
}
1610-
address.setIsNondeterministicInit(allocaTy->isIntegerTy());
1600+
if (allocaTy->isIntegerTy() && HaveInsertPoint()) {
1601+
auto Freeze = Builder.CreateFreeze(llvm::PoisonValue::get(allocaTy),
1602+
"freeze.poison");
1603+
Builder.CreateStore(Freeze, address);
1604+
address.setIsNondeterministicInit(true);
16111605
}
16121606
}
16131607
} else {

0 commit comments

Comments
 (0)