@@ -43,26 +43,6 @@ DebugLoc DebugLoc::getLineZero() {
43
43
return DebugLoc (DebugLocKind::LineZero);
44
44
}
45
45
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
- }
66
46
#else
67
47
68
48
using namespace llvm ;
@@ -197,6 +177,27 @@ DebugLoc DebugLoc::appendInlinedAt(const DebugLoc &DL, DILocation *InlinedAt,
197
177
return Last;
198
178
}
199
179
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
+
200
201
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
201
202
LLVM_DUMP_METHOD void DebugLoc::dump () const { print (dbgs ()); }
202
203
#endif
0 commit comments