Skip to content

Commit f61843f

Browse files
committed
Move DebugLoc::getMergedLocation(s) out of #ifdef
1 parent 39df02f commit f61843f

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

llvm/lib/IR/DebugLoc.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,6 @@ DebugLoc DebugLoc::getLineZero() {
4343
return DebugLoc(DebugLocKind::LineZero);
4444
}
4545

46-
DebugLoc DebugLoc::getMergedLocations(ArrayRef<DebugLoc> Locs) {
47-
if (Locs.empty())
48-
return DebugLoc();
49-
if (Locs.size() == 1)
50-
return Locs[0];
51-
DebugLoc Merged = Locs[0];
52-
for (const DebugLoc &DL : llvm::drop_begin(Locs)) {
53-
Merged = getMergedLocation(Merged, DL);
54-
if (!Merged)
55-
break;
56-
}
57-
return Merged;
58-
}
59-
DebugLoc DebugLoc::getMergedLocation(DebugLoc LocA, DebugLoc LocB) {
60-
if (!LocA)
61-
return LocA.getCopied();
62-
if (!LocB)
63-
return LocB.getCopied();
64-
return DILocation::getMergedLocation(LocA, LocB);
65-
}
6646
#else
6747

6848
using namespace llvm;
@@ -197,6 +177,27 @@ DebugLoc DebugLoc::appendInlinedAt(const DebugLoc &DL, DILocation *InlinedAt,
197177
return Last;
198178
}
199179

180+
DebugLoc DebugLoc::getMergedLocations(ArrayRef<DebugLoc> Locs) {
181+
if (Locs.empty())
182+
return DebugLoc();
183+
if (Locs.size() == 1)
184+
return Locs[0];
185+
DebugLoc Merged = Locs[0];
186+
for (const DebugLoc &DL : llvm::drop_begin(Locs)) {
187+
Merged = getMergedLocation(Merged, DL);
188+
if (!Merged)
189+
break;
190+
}
191+
return Merged;
192+
}
193+
DebugLoc DebugLoc::getMergedLocation(DebugLoc LocA, DebugLoc LocB) {
194+
if (!LocA)
195+
return LocA.getCopied();
196+
if (!LocB)
197+
return LocB.getCopied();
198+
return DILocation::getMergedLocation(LocA, LocB);
199+
}
200+
200201
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
201202
LLVM_DUMP_METHOD void DebugLoc::dump() const { print(dbgs()); }
202203
#endif

0 commit comments

Comments
 (0)