Skip to content

Commit 827a562

Browse files
author
Kyle Krueger
committed
move ExpansionView ctors and operator defs to .cpp
1 parent c813d7d commit 827a562

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

llvm/tools/llvm-cov/SourceCoverageView.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@
2121

2222
using namespace llvm;
2323

24+
ExpansionView::ExpansionView(const CounterMappingRegion &Region,
25+
std::unique_ptr<SourceCoverageView> View)
26+
: Region(Region), View(std::move(View)) {}
27+
28+
ExpansionView::ExpansionView(ExpansionView &&RHS)
29+
: Region(std::move(RHS.Region)), View(std::move(RHS.View)) {}
30+
31+
ExpansionView& ExpansionView::operator=(ExpansionView &&RHS) {
32+
Region = std::move(RHS.Region);
33+
View = std::move(RHS.View);
34+
return *this;
35+
}
36+
2437
void CoveragePrinter::StreamDestructor::operator()(raw_ostream *OS) const {
2538
if (OS == &outs())
2639
return;

llvm/tools/llvm-cov/SourceCoverageView.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,9 @@ struct ExpansionView {
3232
std::unique_ptr<SourceCoverageView> View;
3333

3434
ExpansionView(const CounterMappingRegion &Region,
35-
std::unique_ptr<SourceCoverageView> View)
36-
: Region(Region), View(std::move(View)) {}
37-
ExpansionView(ExpansionView &&RHS)
38-
: Region(std::move(RHS.Region)), View(std::move(RHS.View)) {}
39-
ExpansionView &operator=(ExpansionView &&RHS) {
40-
Region = std::move(RHS.Region);
41-
View = std::move(RHS.View);
42-
return *this;
43-
}
35+
std::unique_ptr<SourceCoverageView> View);
36+
ExpansionView(ExpansionView &&RHS);
37+
ExpansionView &operator=(ExpansionView &&RHS);
4438

4539
unsigned getLine() const { return Region.LineStart; }
4640
unsigned getStartCol() const { return Region.ColumnStart; }

0 commit comments

Comments
 (0)