Skip to content

Commit caabba5

Browse files
Merge pull request #25435 from adrian-prantl/51343998
Remove a workaround in the debug info handling of zero-sized types.
2 parents d2e85fa + a0463a8 commit caabba5

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,11 +2169,6 @@ void IRGenDebugInfoImpl::emitVariableDeclaration(
21692169
if (Indirection)
21702170
Operands.push_back(llvm::dwarf::DW_OP_deref);
21712171

2172-
// There are variables without storage, such as "struct { func foo() {}
2173-
// }". Emit them as constant 0.
2174-
if (isa<llvm::UndefValue>(Piece))
2175-
Piece = llvm::ConstantInt::get(IGM.Int64Ty, 0);
2176-
21772172
if (IsPiece) {
21782173
// Advance the offset and align it for the next piece.
21792174
OffsetInBits += llvm::alignTo(SizeInBits, AlignInBits);

test/DebugInfo/nostorage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ struct AStruct {}
2525

2626
// CHECK2: define{{.*}}app
2727
public func app() {
28-
// No members? No storage! Emitted as a constant 0, because.
29-
// CHECK2: call void @llvm.dbg.value(metadata i{{.*}} 0,
28+
// No members? No storage!
29+
// CHECK2: call void @llvm.dbg.value(metadata {{.*}}* undef,
3030
// CHECK2-SAME: metadata ![[AT:.*]], metadata
3131
// CHECK2: ![[AT]] = !DILocalVariable(name: "at",{{.*}}line: [[@LINE+1]]
3232
var at = AStruct()

0 commit comments

Comments
 (0)