Skip to content

Commit e7c9320

Browse files
committed
[gardening] Move a utility function into the utility section of the file before more re-organization.
1 parent 5b1ec61 commit e7c9320

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/SILOptimizer/Mandatory/MoveKillsCopyableAddressesChecker.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const SmallBitVector &bv) {
180180
}
181181
} // namespace llvm
182182

183+
static SourceLoc getSourceLocFromValue(SILValue value) {
184+
if (auto *defInst = value->getDefiningInstruction())
185+
return defInst->getLoc().getSourceLoc();
186+
if (auto *arg = dyn_cast<SILFunctionArgument>(value))
187+
return arg->getDecl()->getLoc();
188+
llvm_unreachable("Do not know how to get source loc for value?!");
189+
}
190+
183191
//===----------------------------------------------------------------------===//
184192
// Use Gathering
185193
//===----------------------------------------------------------------------===//
@@ -505,14 +513,6 @@ struct MoveKillsCopyableAddressesObjectChecker {
505513

506514
} // namespace
507515

508-
static SourceLoc getSourceLocFromValue(SILValue value) {
509-
if (auto *defInst = value->getDefiningInstruction())
510-
return defInst->getLoc().getSourceLoc();
511-
if (auto *arg = dyn_cast<SILFunctionArgument>(value))
512-
return arg->getDecl()->getLoc();
513-
llvm_unreachable("Do not know how to get source loc for value?!");
514-
}
515-
516516
// Returns true if we emitted a diagnostic and handled the single block
517517
// case. Returns false if we visited all of the uses and seeded the UseState
518518
// struct with the information needed to perform our interprocedural dataflow.

0 commit comments

Comments
 (0)