From cc0c4e7cace9bd5db12633cfdb749ef43d8c738d Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 17 Sep 2014 06:32:48 +0000 Subject: [PATCH] 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 --- tools/llvm-cov/SourceCoverageView.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/llvm-cov/SourceCoverageView.h b/tools/llvm-cov/SourceCoverageView.h index af44085cffc..80669d37f76 100644 --- a/tools/llvm-cov/SourceCoverageView.h +++ b/tools/llvm-cov/SourceCoverageView.h @@ -32,6 +32,13 @@ struct ExpansionView { ExpansionView(const coverage::CounterMappingRegion &Region, std::unique_ptr View) : Region(Region), View(std::move(View)) {} + ExpansionView(ExpansionView &&RHS) + : Region(std::move(RHS.Region)), View(std::move(RHS.View)) {} + ExpansionView &operator=(ExpansionView &&RHS) { + Region = std::move(RHS.Region); + View = std::move(RHS.View); + return *this; + } unsigned getLine() const { return Region.LineStart; } unsigned getStartCol() const { return Region.ColumnStart; } @@ -51,6 +58,15 @@ struct InstantiationView { InstantiationView(StringRef FunctionName, unsigned Line, std::unique_ptr View) : FunctionName(FunctionName), Line(Line), View(std::move(View)) {} + InstantiationView(InstantiationView &&RHS) + : FunctionName(std::move(RHS.FunctionName)), Line(std::move(RHS.Line)), + View(std::move(RHS.View)) {} + InstantiationView &operator=(InstantiationView &&RHS) { + FunctionName = std::move(RHS.FunctionName); + Line = std::move(RHS.Line); + View = std::move(RHS.View); + return *this; + } friend bool operator<(const InstantiationView &LHS, const InstantiationView &RHS) { -- 2.34.1