Skip to content

Commit 5ccec0e

Browse files
committed
[NFC] SIL: Shortened member name.
Renamed "getUsesMoveableValueDebugInfo" to "usesMoveableValueDebugInfo". Clarifies the predicate from "does the receiver have the usesMoveableValueDebugInfo field set?" to "does the receiver use moveable value debug info?".
1 parent cf619e2 commit 5ccec0e

File tree

7 files changed

+24
-23
lines changed

7 files changed

+24
-23
lines changed

Diff for: include/swift/SIL/DebugUtils.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,11 @@ struct DebugVarCarryingInst : VarDeclCarryingInst {
488488
case Kind::Invalid:
489489
llvm_unreachable("Invalid?!");
490490
case Kind::DebugValue:
491-
return cast<DebugValueInst>(**this)->getUsesMoveableValueDebugInfo();
491+
return cast<DebugValueInst>(**this)->usesMoveableValueDebugInfo();
492492
case Kind::AllocStack:
493-
return cast<AllocStackInst>(**this)->getUsesMoveableValueDebugInfo();
493+
return cast<AllocStackInst>(**this)->usesMoveableValueDebugInfo();
494494
case Kind::AllocBox:
495-
return cast<AllocBoxInst>(**this)->getUsesMoveableValueDebugInfo();
495+
return cast<AllocBoxInst>(**this)->usesMoveableValueDebugInfo();
496496
}
497497
}
498498

Diff for: include/swift/SIL/SILCloner.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,10 @@ SILCloner<ImplClass>::visitAllocStackInst(AllocStackInst *Inst) {
878878
auto *NewInst = getBuilder().createAllocStack(
879879
Loc, getOpType(Inst->getElementType()), VarInfo,
880880
Inst->hasDynamicLifetime(), Inst->isLexical(),
881-
Inst->getUsesMoveableValueDebugInfo()
881+
Inst->usesMoveableValueDebugInfo()
882882
#ifndef NDEBUG
883-
, true
883+
,
884+
true
884885
#endif
885886
);
886887
remapDebugVarInfo(DebugVarCarryingInst(NewInst));
@@ -1410,8 +1411,7 @@ SILCloner<ImplClass>::visitDebugValueInst(DebugValueInst *Inst) {
14101411
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
14111412
auto *NewInst = getBuilder().createDebugValue(
14121413
Inst->getLoc(), getOpValue(Inst->getOperand()), VarInfo,
1413-
Inst->poisonRefs(), Inst->getUsesMoveableValueDebugInfo(),
1414-
Inst->hasTrace());
1414+
Inst->poisonRefs(), Inst->usesMoveableValueDebugInfo(), Inst->hasTrace());
14151415
remapDebugVarInfo(DebugVarCarryingInst(NewInst));
14161416
recordClonedInstruction(Inst, NewInst);
14171417
}

Diff for: include/swift/SIL/SILInstruction.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,7 @@ class AllocStackInst final
20112011

20122012
/// Set to true if this alloc_stack's memory location was passed to _move at
20132013
/// any point of the program.
2014-
bool getUsesMoveableValueDebugInfo() const {
2014+
bool usesMoveableValueDebugInfo() const {
20152015
return sharedUInt8().AllocStackInst.usesMoveableValueDebugInfo;
20162016
}
20172017

@@ -2465,7 +2465,7 @@ class AllocBoxInst final
24652465
sharedUInt8().AllocBoxInst.usesMoveableValueDebugInfo = true;
24662466
}
24672467

2468-
bool getUsesMoveableValueDebugInfo() const {
2468+
bool usesMoveableValueDebugInfo() const {
24692469
return sharedUInt8().AllocBoxInst.usesMoveableValueDebugInfo;
24702470
}
24712471
};
@@ -5269,7 +5269,7 @@ class DebugValueInst final
52695269
///
52705270
/// IRGen uses this information to determine if we should use llvm.dbg.addr or
52715271
/// llvm.dbg.declare.
5272-
bool getUsesMoveableValueDebugInfo() const {
5272+
bool usesMoveableValueDebugInfo() const {
52735273
return sharedUInt8().DebugValueInst.usesMoveableValueDebugInfo;
52745274
}
52755275

Diff for: lib/IRGen/AllocStackHoisting.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class Partition {
117117
/// change.
118118
bool hasMovedElt() const {
119119
return llvm::any_of(Elts, [](AllocStackInst *asi) {
120-
return asi->getUsesMoveableValueDebugInfo();
120+
return asi->usesMoveableValueDebugInfo();
121121
});
122122
}
123123
};

Diff for: lib/IRGen/IRGenSIL.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -5472,7 +5472,7 @@ void IRGenSILFunction::visitDebugValueInst(DebugValueInst *i) {
54725472

54735473
// If we were not moved return early. If this SILUndef was moved, then we
54745474
// need to let it through so we can ensure the debug info invalidated.
5475-
if (!i->getUsesMoveableValueDebugInfo())
5475+
if (!i->usesMoveableValueDebugInfo())
54765476
return;
54775477
}
54785478
bool IsInCoro = InCoroContext(*CurSILFn, *i);
@@ -5530,11 +5530,12 @@ void IRGenSILFunction::visitDebugValueInst(DebugValueInst *i) {
55305530
if (IsAddrVal) {
55315531
auto &ti = getTypeInfo(SILVal->getType());
55325532
Copy.emplace_back(emitShadowCopyIfNeeded(
5533-
getLoweredAddress(SILVal).getAddress(), ti.getStorageType(), i->getDebugScope(), *VarInfo,
5534-
IsAnonymous, i->getUsesMoveableValueDebugInfo()));
5533+
getLoweredAddress(SILVal).getAddress(), ti.getStorageType(),
5534+
i->getDebugScope(), *VarInfo, IsAnonymous,
5535+
i->usesMoveableValueDebugInfo()));
55355536
} else {
55365537
emitShadowCopyIfNeeded(SILVal, i->getDebugScope(), *VarInfo, IsAnonymous,
5537-
i->getUsesMoveableValueDebugInfo(), Copy);
5538+
i->usesMoveableValueDebugInfo(), Copy);
55385539
}
55395540

55405541
bindArchetypes(DbgTy.getType());
@@ -5543,7 +5544,7 @@ void IRGenSILFunction::visitDebugValueInst(DebugValueInst *i) {
55435544

55445545
emitDebugVariableDeclaration(
55455546
Copy, DbgTy, SILTy, i->getDebugScope(), i->getLoc(), *VarInfo,
5546-
Indirection, AddrDbgInstrKind(i->getUsesMoveableValueDebugInfo()));
5547+
Indirection, AddrDbgInstrKind(i->usesMoveableValueDebugInfo()));
55475548
}
55485549

55495550
void IRGenSILFunction::visitDebugStepInst(DebugStepInst *i) {
@@ -5889,7 +5890,7 @@ void IRGenSILFunction::emitDebugInfoForAllocStack(AllocStackInst *i,
58895890
if (!Alloca->isStaticAlloca()) {
58905891
// Store the address of the dynamic alloca on the stack.
58915892
addr = emitShadowCopy(addr, DS, *VarInfo, IGM.getPointerAlignment(),
5892-
/*init*/ true, i->getUsesMoveableValueDebugInfo())
5893+
/*init*/ true, i->usesMoveableValueDebugInfo())
58935894
.getAddress();
58945895
Indirection =
58955896
InCoroContext(*CurSILFn, *i) ? CoroIndirectValue : IndirectValue;
@@ -5930,7 +5931,7 @@ void IRGenSILFunction::emitDebugInfoForAllocStack(AllocStackInst *i,
59305931
if (IGM.DebugInfo) {
59315932
emitDebugVariableDeclaration(
59325933
addr, DbgTy, SILTy, DS, i->getLoc(), *VarInfo, Indirection,
5933-
AddrDbgInstrKind(i->getUsesMoveableValueDebugInfo()));
5934+
AddrDbgInstrKind(i->usesMoveableValueDebugInfo()));
59345935
}
59355936
}
59365937

Diff for: lib/SIL/IR/SILPrinter.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
14401440
*this << "[dynamic_lifetime] ";
14411441
if (AVI->isLexical())
14421442
*this << "[lexical] ";
1443-
if (AVI->getUsesMoveableValueDebugInfo() && !AVI->getType().isMoveOnly())
1443+
if (AVI->usesMoveableValueDebugInfo() && !AVI->getType().isMoveOnly())
14441444
*this << "[moveable_value_debuginfo] ";
14451445
*this << AVI->getElementType();
14461446
printDebugVar(AVI->getVarInfo(),
@@ -1494,7 +1494,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
14941494
*this << "[pointer_escape] ";
14951495
}
14961496

1497-
if (ABI->getUsesMoveableValueDebugInfo() &&
1497+
if (ABI->usesMoveableValueDebugInfo() &&
14981498
!ABI->getAddressType().isMoveOnly()) {
14991499
*this << "[moveable_value_debuginfo] ";
15001500
}
@@ -1892,7 +1892,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
18921892
void visitDebugValueInst(DebugValueInst *DVI) {
18931893
if (DVI->poisonRefs())
18941894
*this << "[poison] ";
1895-
if (DVI->getUsesMoveableValueDebugInfo() &&
1895+
if (DVI->usesMoveableValueDebugInfo() &&
18961896
!DVI->getOperand()->getType().isMoveOnly())
18971897
*this << "[moveable_value_debuginfo] ";
18981898
if (DVI->hasTrace())

Diff for: lib/Serialization/SerializeSIL.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
10631063
unsigned flags = 0;
10641064
flags |= unsigned(ABI->hasDynamicLifetime());
10651065
flags |= unsigned(ABI->emitReflectionMetadata()) << 1;
1066-
flags |= unsigned(ABI->getUsesMoveableValueDebugInfo()) << 2;
1066+
flags |= unsigned(ABI->usesMoveableValueDebugInfo()) << 2;
10671067
flags |= unsigned(ABI->hasPointerEscape()) << 3;
10681068
writeOneTypeLayout(ABI->getKind(),
10691069
flags,
@@ -1109,7 +1109,7 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
11091109
unsigned attr = 0;
11101110
attr |= unsigned(ASI->hasDynamicLifetime());
11111111
attr |= unsigned(ASI->isLexical()) << 1;
1112-
attr |= unsigned(ASI->getUsesMoveableValueDebugInfo()) << 2;
1112+
attr |= unsigned(ASI->usesMoveableValueDebugInfo()) << 2;
11131113
writeOneTypeLayout(ASI->getKind(), attr, ASI->getElementType());
11141114
break;
11151115
}

0 commit comments

Comments
 (0)