Skip to content

Commit 71936b5

Browse files
Merge pull request #25468 from adrian-prantl/51343998-swift-5.1-branch-06-12-2019
Remove a workaround in the debug info handling of zero-sized types.
2 parents 3c025ff + 7070910 commit 71936b5

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
@@ -2182,11 +2182,6 @@ void IRGenDebugInfoImpl::emitVariableDeclaration(
21822182
if (Indirection)
21832183
Operands.push_back(llvm::dwarf::DW_OP_deref);
21842184

2185-
// There are variables without storage, such as "struct { func foo() {}
2186-
// }". Emit them as constant 0.
2187-
if (isa<llvm::UndefValue>(Piece))
2188-
Piece = llvm::ConstantInt::get(IGM.Int64Ty, 0);
2189-
21902185
if (IsPiece) {
21912186
// Advance the offset and align it for the next piece.
21922187
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)