Skip to content

Commit 7f18cdc

Browse files
Merge pull request #20815 from adrian-prantl/45462765-master
Remove DebugTypeInfo::isImplicitlyIndirect().
2 parents 806cf57 + 936fead commit 7f18cdc

File tree

5 files changed

+4
-17
lines changed

5 files changed

+4
-17
lines changed

lib/IRGen/DebugTypeInfo.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,6 @@ class DebugTypeInfo {
8888
return Type->getWithoutSpecifierType()->is<ArchetypeType>();
8989
}
9090

91-
/// LValues, inout args, and Archetypes are implicitly indirect by
92-
/// virtue of their DWARF type.
93-
//
94-
// FIXME: There exists an inverse workaround in LLDB. Both should be removed.
95-
bool isImplicitlyIndirect() const {
96-
return isArchetype();
97-
}
98-
9991
bool isNull() const { return Type == nullptr; }
10092
bool operator==(DebugTypeInfo T) const;
10193
bool operator!=(DebugTypeInfo T) const;

lib/IRGen/IRGenSIL.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3727,8 +3727,7 @@ void IRGenSILFunction::visitDebugValueAddrInst(DebugValueAddrInst *i) {
37273727
emitShadowCopyIfNeeded(Addr, i->getDebugScope(), Name, VarInfo->ArgNo,
37283728
IsAnonymous),
37293729
DbgTy, SILType(), i->getDebugScope(), Decl, Name, VarInfo->ArgNo,
3730-
(IsLoadablyByAddress || DbgTy.isImplicitlyIndirect()) ? DirectValue
3731-
: IndirectValue);
3730+
(IsLoadablyByAddress) ? DirectValue : IndirectValue);
37323731
}
37333732

37343733
void IRGenSILFunction::visitFixLifetimeInst(swift::FixLifetimeInst *i) {
@@ -3996,10 +3995,6 @@ void IRGenSILFunction::emitDebugInfoForAllocStack(AllocStackInst *i,
39963995
CurSILFn->getDeclContext(), CurSILFn->getGenericEnvironment(), Decl,
39973996
RealType, type);
39983997

3999-
// FIXME: This is working around the inverse special case in LLDB.
4000-
if (DbgTy.isImplicitlyIndirect())
4001-
Indirection = DirectValue;
4002-
40033998
bindArchetypes(DbgTy.getType());
40043999
if (IGM.DebugInfo)
40054000
emitDebugVariableDeclaration(addr, DbgTy, SILTy, DS, Decl, Name,

test/DebugInfo/generic_arg.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ func foo<T>(_ x: T) -> () {
77
// CHECK-SAME: metadata ![[T1:.*]], metadata !DIExpression())
88
// CHECK: %[[X:.*]] = alloca %swift.opaque*
99
// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %[[X]],
10-
// CHECK-SAME: metadata ![[X1:.*]], metadata !DIExpression())
10+
// CHECK-SAME: metadata ![[X1:.*]], metadata !DIExpression(DW_OP_deref))
1111
// CHECK: store %swift.type* %T, %swift.type** %[[T]],
1212
// CHECK: store %swift.opaque* %0, %swift.opaque** %[[X]],
1313
// CHECK: ![[T1]] = !DILocalVariable(name: "$\CF\84_0_0",

test/DebugInfo/generic_arg2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
22

33
// CHECK: define hidden swiftcc void @"$s12generic_arg25ClassC3foo{{.*}}, %swift.type* %U
4-
// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %y.debug, metadata ![[U:.*]], metadata !DIExpression())
4+
// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %y.debug, metadata ![[U:.*]], metadata !DIExpression(DW_OP_deref))
55
// Make sure there is no conflicting dbg.value for this variable.x
66
// CHECK-NOT: dbg.value{{.*}}metadata ![[U]]
77
class Class <T> {

test/DebugInfo/generic_arg3.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public func f<Type>(_ value : Type)
66
{
77
// CHECK: define {{.*}}$s12generic_arg31fyyxlFxxXEfU_
88
// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %[[ALLOCA:[^,]+]],
9-
// CHECK-SAME: metadata ![[ARG:.*]], metadata !DIExpression())
9+
// CHECK-SAME: metadata ![[ARG:.*]], metadata !DIExpression(DW_OP_deref))
1010
// CHECK: store %swift.opaque* %1, %swift.opaque** %[[ALLOCA]], align
1111
// No deref here.
1212
// CHECK: ![[TY:.*]] = !DICompositeType({{.*}}identifier: "$sxD"

0 commit comments

Comments
 (0)