Index: lib/Analysis/MemoryBuiltins.cpp =================================================================== --- lib/Analysis/MemoryBuiltins.cpp +++ lib/Analysis/MemoryBuiltins.cpp @@ -12,6 +12,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Statistic.h" @@ -685,7 +687,7 @@ // check cache CacheMapTy::iterator CacheIt = CacheMap.find(V); if (CacheIt != CacheMap.end()) - return CacheIt->second; + return SizeOffsetEvalType(std::move(CacheIt->second)); // always generate code immediately before the instruction being // processed, so that the generated code dominates the same BBs Index: lib/CodeGen/MachineBasicBlock.cpp =================================================================== --- lib/CodeGen/MachineBasicBlock.cpp +++ lib/CodeGen/MachineBasicBlock.cpp @@ -34,6 +34,7 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetSubtargetInfo.h" #include +#include using namespace llvm; #define DEBUG_TYPE "codegen" @@ -143,7 +144,7 @@ ++I; assert((I == E || !I->isInsideBundle()) && "First non-phi MI cannot be inside a bundle!"); - return I; + return MachineBasicBlock::iterator(std::move(I)); } MachineBasicBlock::iterator @@ -192,7 +193,7 @@ // Return instruction that starts a bundle. if (I->isDebugValue() || I->isInsideBundle()) continue; - return I; + return MachineBasicBlock::iterator(std::move(I)); } // The block is all debug values. return end(); Index: lib/Parse/ParseDeclCXX.cpp =================================================================== --- lib/Parse/ParseDeclCXX.cpp +++ lib/Parse/ParseDeclCXX.cpp @@ -11,6 +11,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "clang/Parse/Parser.h" #include "RAIIObjectsForParser.h" #include "clang/AST/ASTContext.h" @@ -977,7 +979,7 @@ ConsumeToken(); if (Type) - return Type; + return TypeResult(std::move(Type)); return true; } @@ -1032,7 +1034,7 @@ EndLocation = Tok.getAnnotationEndLoc(); ParsedType Type = getTypeAnnotation(Tok); ConsumeToken(); - return Type; + return TypeResult(std::move(Type)); } // We have an identifier; check whether it is actually a type. Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -47,6 +47,7 @@ #include #include #include +#include using namespace clang; using namespace sema; @@ -792,7 +793,7 @@ if (Result.empty() && SS.isEmpty() && getLangOpts().MSVCCompat) { if (ParsedType TypeInBase = recoverFromTypeInKnownDependentBase(*this, *Name, NameLoc)) - return TypeInBase; + return Sema::NameClassification(std::move(TypeInBase)); } // Perform lookup for Objective-C instance variables (including automatically @@ -802,7 +803,7 @@ if (!SS.isSet() && CurMethod && !isResultTypeOrTemplate(Result, NextToken)) { ExprResult E = LookupInObjCMethod(Result, S, Name, true); if (E.get() || E.isInvalid()) - return E; + return Sema::NameClassification(std::move(E)); } bool SecondTry = false; @@ -903,7 +904,7 @@ if (ObjCIvarDecl *Ivar = Result.getAsSingle()) { Result.clear(); ExprResult E(LookupInObjCMethod(Result, S, Ivar->getIdentifier())); - return E; + return Sema::NameClassification(std::move(E)); } goto Corrected; Index: lib/Sema/SemaTemplate.cpp =================================================================== --- lib/Sema/SemaTemplate.cpp +++ lib/Sema/SemaTemplate.cpp @@ -9,6 +9,8 @@ // This file implements semantic analysis for C++ templates. //===----------------------------------------------------------------------===// +#include + #include "TreeTransform.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" @@ -6018,7 +6020,7 @@ Checker.TraverseStmt(E); if (Checker.Match && Checker.MatchLoc.isInvalid()) return E->getSourceRange(); - return Checker.MatchLoc; + return clang::SourceRange(std::move(Checker.MatchLoc)); } static SourceRange findTemplateParameter(unsigned Depth, TypeLoc TL) { @@ -6028,7 +6030,7 @@ Checker.TraverseTypeLoc(TL); if (Checker.Match && Checker.MatchLoc.isInvalid()) return TL.getSourceRange(); - return Checker.MatchLoc; + return clang::SourceRange(std::move(Checker.MatchLoc)); } /// \brief Subroutine of Sema::CheckTemplatePartialSpecializationArgs Index: lib/Sema/SemaType.cpp =================================================================== --- lib/Sema/SemaType.cpp +++ lib/Sema/SemaType.cpp @@ -11,6 +11,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "TypeLocBuilder.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" @@ -1169,7 +1171,7 @@ /*FailOnError=*/false); if (Result == T) - return BaseType; + return TypeResult(std::move(BaseType)); // Create source information for this type. TypeSourceInfo *ResultTInfo = Context.CreateTypeSourceInfo(Result);