summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-03-18 13:31:00 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-03-18 13:31:00 +0000
commitd2f5bf78153deb5097aea59641868c67383a5dca (patch)
tree42b9fbd2034b6c3f2f460a73741612c0ed8b7736
parent129fa9a048190e4688e0eef237b279a437341df0 (diff)
downloadbcm5719-llvm-d2f5bf78153deb5097aea59641868c67383a5dca.tar.gz
bcm5719-llvm-d2f5bf78153deb5097aea59641868c67383a5dca.zip
Make LookupResult movable again.
We lost copy semantics in r263730, because it only worked for a few very specific cases. Move semantics don't have this issue. Sadly the implementation is a bit messy but I don't know how to clean it up without losing support for msvc 2013 :/ llvm-svn: 263785
-rw-r--r--clang/include/clang/Sema/Lookup.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/clang/include/clang/Sema/Lookup.h b/clang/include/clang/Sema/Lookup.h
index 2cc4418c320..81fc5a5e159 100644
--- a/clang/include/clang/Sema/Lookup.h
+++ b/clang/include/clang/Sema/Lookup.h
@@ -190,6 +190,44 @@ public:
LookupResult(const LookupResult &) = delete;
LookupResult &operator=(const LookupResult &) = delete;
+ LookupResult(LookupResult &&Other)
+ : ResultKind(std::move(Other.ResultKind)),
+ Ambiguity(std::move(Other.Ambiguity)), Decls(std::move(Other.Decls)),
+ Paths(std::move(Other.Paths)),
+ NamingClass(std::move(Other.NamingClass)),
+ BaseObjectType(std::move(Other.BaseObjectType)),
+ SemaPtr(std::move(Other.SemaPtr)), NameInfo(std::move(Other.NameInfo)),
+ NameContextRange(std::move(Other.NameContextRange)),
+ LookupKind(std::move(Other.LookupKind)), IDNS(std::move(Other.IDNS)),
+ Redecl(std::move(Other.Redecl)), HideTags(std::move(Other.HideTags)),
+ Diagnose(std::move(Other.Diagnose)),
+ AllowHidden(std::move(Other.AllowHidden)),
+ Shadowed(std::move(Other.Shadowed)) {
+ Other.Paths = nullptr;
+ Other.Diagnose = false;
+ }
+ LookupResult &operator=(LookupResult &&Other) {
+ ResultKind = std::move(Other.ResultKind);
+ Ambiguity = std::move(Other.Ambiguity);
+ Decls = std::move(Other.Decls);
+ Paths = std::move(Other.Paths);
+ NamingClass = std::move(Other.NamingClass);
+ BaseObjectType = std::move(Other.BaseObjectType);
+ SemaPtr = std::move(Other.SemaPtr);
+ NameInfo = std::move(Other.NameInfo);
+ NameContextRange = std::move(Other.NameContextRange);
+ LookupKind = std::move(Other.LookupKind);
+ IDNS = std::move(Other.IDNS);
+ Redecl = std::move(Other.Redecl);
+ HideTags = std::move(Other.HideTags);
+ Diagnose = std::move(Other.Diagnose);
+ AllowHidden = std::move(Other.AllowHidden);
+ Shadowed = std::move(Other.Shadowed);
+ Other.Paths = nullptr;
+ Other.Diagnose = false;
+ return *this;
+ }
+
~LookupResult() {
if (Diagnose) diagnose();
if (Paths) deletePaths(Paths);
OpenPOWER on IntegriCloud