@@ -900,24 +900,18 @@ void DtoVarDeclaration(VarDeclaration *vd) {
900900 LLType *lltype = DtoType (type); // void for noreturn
901901 if (lltype->isVoidTy ()) {
902902 irLocal->value = getNullPtr ();
903- return ;
904- }
905-
906- llvm::AllocaInst *allocainst;
907-
908- if (type != vd->type ) {
909- allocainst = DtoAlloca (type, vd->toChars ());
910903 } else {
911- allocainst = DtoAlloca (vd, vd->toChars ());
912- }
913-
914- irLocal->value = allocainst;
904+ auto allocainst = type != vd->type ? DtoAlloca (type, vd->toChars ())
905+ : DtoAlloca (vd, vd->toChars ());
915906
916- gIR ->DBuilder .EmitLocalVariable (allocainst, vd);
907+ irLocal->value = allocainst;
908+ gIR ->DBuilder .EmitLocalVariable (allocainst, vd);
917909
918- // The lifetime of a stack variable starts from the point it is declared
919- gIR ->funcGen ().localVariableLifetimeAnnotator .addLocalVariable (
920- allocainst, DtoConstUlong (size (type)));
910+ // The lifetime of a stack variable starts from the
911+ // point it is declared
912+ gIR ->funcGen ().localVariableLifetimeAnnotator .addLocalVariable (
913+ allocainst, DtoConstUlong (size (type)));
914+ }
921915 }
922916
923917 IF_LOG Logger::cout () << " llvm value for decl: " << *getIrLocal (vd)->value
0 commit comments