Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit cc0c4e7

Browse files
committed
Add move constructors/assignment to make MSVC happy after r217940
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217941 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d1b4e60 commit cc0c4e7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tools/llvm-cov/SourceCoverageView.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ struct ExpansionView {
3232
ExpansionView(const coverage::CounterMappingRegion &Region,
3333
std::unique_ptr<SourceCoverageView> View)
3434
: Region(Region), View(std::move(View)) {}
35+
ExpansionView(ExpansionView &&RHS)
36+
: Region(std::move(RHS.Region)), View(std::move(RHS.View)) {}
37+
ExpansionView &operator=(ExpansionView &&RHS) {
38+
Region = std::move(RHS.Region);
39+
View = std::move(RHS.View);
40+
return *this;
41+
}
3542

3643
unsigned getLine() const { return Region.LineStart; }
3744
unsigned getStartCol() const { return Region.ColumnStart; }
@@ -51,6 +58,15 @@ struct InstantiationView {
5158
InstantiationView(StringRef FunctionName, unsigned Line,
5259
std::unique_ptr<SourceCoverageView> View)
5360
: FunctionName(FunctionName), Line(Line), View(std::move(View)) {}
61+
InstantiationView(InstantiationView &&RHS)
62+
: FunctionName(std::move(RHS.FunctionName)), Line(std::move(RHS.Line)),
63+
View(std::move(RHS.View)) {}
64+
InstantiationView &operator=(InstantiationView &&RHS) {
65+
FunctionName = std::move(RHS.FunctionName);
66+
Line = std::move(RHS.Line);
67+
View = std::move(RHS.View);
68+
return *this;
69+
}
5470

5571
friend bool operator<(const InstantiationView &LHS,
5672
const InstantiationView &RHS) {

0 commit comments

Comments
 (0)