Skip to content

Commit 8bd783f

Browse files
committed
[DebugInfo] Remove option to pass None into setCurrentLoc, NFC
Passing in some SILLocation to IRGenDebugInfo setCurrentLoc() will now be mandatory.
1 parent 5f6d8e8 commit 8bd783f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
125125
void finalize();
126126

127127
void setCurrentLoc(IRBuilder &Builder, const SILDebugScope *DS,
128-
Optional<SILLocation> Loc);
128+
SILLocation Loc);
129129
void clearLoc(IRBuilder &Builder);
130130
void pushLoc();
131131
void popLoc();
@@ -1555,7 +1555,7 @@ void IRGenDebugInfoImpl::finalize() {
15551555

15561556
void IRGenDebugInfoImpl::setCurrentLoc(IRBuilder &Builder,
15571557
const SILDebugScope *DS,
1558-
Optional<SILLocation> Loc) {
1558+
SILLocation Loc) {
15591559
assert(DS && "empty scope");
15601560
auto *Scope = getOrCreateScope(DS);
15611561
if (!Scope)
@@ -1565,7 +1565,7 @@ void IRGenDebugInfoImpl::setCurrentLoc(IRBuilder &Builder,
15651565
SILFunction *Fn = DS->getInlinedFunction();
15661566
if (Fn && Fn->isThunk()) {
15671567
L = SILLocation::getCompilerGeneratedDebugLoc();
1568-
} else if (DS == LastScope && Loc && Loc->isAutoGenerated()) {
1568+
} else if (DS == LastScope && Loc.isAutoGenerated()) {
15691569
// Reuse the last source location if we are still in the same
15701570
// scope to get a more contiguous line table.
15711571
L = LastDebugLoc;
@@ -1574,7 +1574,7 @@ void IRGenDebugInfoImpl::setCurrentLoc(IRBuilder &Builder,
15741574
L = getDebugLocation(Loc);
15751575
// Otherwise use a line 0 artificial location, but the file from the
15761576
// location.
1577-
if (Loc && Loc->isAutoGenerated()) {
1577+
if (Loc.isAutoGenerated()) {
15781578
L.Line = 0;
15791579
L.Column = 0;
15801580
}
@@ -2056,7 +2056,7 @@ void IRGenDebugInfo::finalize() {
20562056
}
20572057

20582058
void IRGenDebugInfo::setCurrentLoc(IRBuilder &Builder, const SILDebugScope *DS,
2059-
Optional<SILLocation> Loc) {
2059+
SILLocation Loc) {
20602060
static_cast<IRGenDebugInfoImpl *>(this)->setCurrentLoc(Builder, DS, Loc);
20612061
}
20622062

lib/IRGen/IRGenDebugInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class IRGenDebugInfo {
5757
/// Update the IRBuilder's current debug location to the location
5858
/// Loc and the lexical scope DS.
5959
void setCurrentLoc(IRBuilder &Builder, const SILDebugScope *DS,
60-
Optional<SILLocation> Loc);
60+
SILLocation Loc);
6161

6262
void clearLoc(IRBuilder &Builder);
6363

0 commit comments

Comments
 (0)