diff --git a/clang/examples/analyzer-plugin/MainCallChecker.cpp b/clang/examples/analyzer-plugin/MainCallChecker.cpp index 66e105f11958..2ad8c8416a5e 100644 --- a/clang/examples/analyzer-plugin/MainCallChecker.cpp +++ b/clang/examples/analyzer-plugin/MainCallChecker.cpp @@ -8,7 +8,7 @@ using namespace ento; namespace { class MainCallChecker : public Checker < check::PreStmt > { - mutable OwningPtr BT; + mutable std::unique_ptr BT; public: void checkPreStmt(const CallExpr *CE, CheckerContext &C) const; diff --git a/clang/examples/clang-interpreter/main.cpp b/clang/examples/clang-interpreter/main.cpp index e00583d1a1ab..46c614bd3f09 100644 --- a/clang/examples/clang-interpreter/main.cpp +++ b/clang/examples/clang-interpreter/main.cpp @@ -46,8 +46,8 @@ static int Execute(llvm::Module *Mod, char * const *envp) { llvm::InitializeNativeTarget(); std::string Error; - OwningPtr EE( - llvm::ExecutionEngine::createJIT(Mod, &Error)); + std::unique_ptr EE( + llvm::ExecutionEngine::createJIT(Mod, &Error)); if (!EE) { llvm::errs() << "unable to make execution engine: " << Error << "\n"; return 255; @@ -83,7 +83,7 @@ int main(int argc, const char **argv, char * const *envp) { // (basically, exactly one input, and the operation mode is hard wired). SmallVector Args(argv, argv + argc); Args.push_back("-fsyntax-only"); - OwningPtr C(TheDriver.BuildCompilation(Args)); + std::unique_ptr C(TheDriver.BuildCompilation(Args)); if (!C) return 0; @@ -108,7 +108,7 @@ int main(int argc, const char **argv, char * const *envp) { // Initialize a compiler invocation object from the clang (-cc1) arguments. const driver::ArgStringList &CCArgs = Cmd->getArguments(); - OwningPtr CI(new CompilerInvocation); + std::unique_ptr CI(new CompilerInvocation); CompilerInvocation::CreateFromArgs(*CI, const_cast(CCArgs.data()), const_cast(CCArgs.data()) + @@ -140,7 +140,7 @@ int main(int argc, const char **argv, char * const *envp) { CompilerInvocation::GetResourcesPath(argv[0], MainAddr); // Create and execute the frontend to generate an LLVM bitcode module. - OwningPtr Act(new EmitLLVMOnlyAction()); + std::unique_ptr Act(new EmitLLVMOnlyAction()); if (!Clang.ExecuteAction(*Act)) return 1; diff --git a/clang/include/clang/ARCMigrate/FileRemapper.h b/clang/include/clang/ARCMigrate/FileRemapper.h index c69892b69c6b..fb2fdd319a7b 100644 --- a/clang/include/clang/ARCMigrate/FileRemapper.h +++ b/clang/include/clang/ARCMigrate/FileRemapper.h @@ -12,9 +12,9 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/StringRef.h" +#include namespace llvm { class MemoryBuffer; diff --git a/clang/include/clang/AST/VTableBuilder.h b/clang/include/clang/AST/VTableBuilder.h index 8acee2eca215..b7e72f70692d 100644 --- a/clang/include/clang/AST/VTableBuilder.h +++ b/clang/include/clang/AST/VTableBuilder.h @@ -209,11 +209,11 @@ public: typedef llvm::DenseMap AddressPointsMapTy; private: uint64_t NumVTableComponents; - llvm::OwningArrayPtr VTableComponents; + std::unique_ptr VTableComponents; /// \brief Contains thunks needed by vtables, sorted by indices. uint64_t NumVTableThunks; - llvm::OwningArrayPtr VTableThunks; + std::unique_ptr VTableThunks; /// \brief Address points for all vtables. AddressPointsMapTy AddressPoints; diff --git a/clang/include/clang/Basic/LLVM.h b/clang/include/clang/Basic/LLVM.h index 306c75e57a9f..01898f4aebb4 100644 --- a/clang/include/clang/Basic/LLVM.h +++ b/clang/include/clang/Basic/LLVM.h @@ -29,7 +29,6 @@ namespace llvm { class StringRef; class Twine; template class ArrayRef; - template class OwningPtr; template class SmallString; template class SmallVector; template class SmallVectorImpl; @@ -63,7 +62,6 @@ namespace clang { using llvm::StringRef; using llvm::Twine; using llvm::ArrayRef; - using llvm::OwningPtr; using llvm::SmallString; using llvm::SmallVector; using llvm::SmallVectorImpl; diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h index 3cb2d21e8141..286692d3136f 100644 --- a/clang/include/clang/Frontend/CompilerInstance.h +++ b/clang/include/clang/Frontend/CompilerInstance.h @@ -106,7 +106,7 @@ class CompilerInstance : public ModuleLoader { IntrusiveRefCntPtr ModuleManager; /// \brief The dependency file generator. - OwningPtr TheDependencyFileGenerator; + std::unique_ptr TheDependencyFileGenerator; /// \brief The set of top-level modules that has already been loaded, /// along with the module map diff --git a/clang/include/clang/Frontend/MultiplexConsumer.h b/clang/include/clang/Frontend/MultiplexConsumer.h index b0080ec32cb8..282cd70a7f9f 100644 --- a/clang/include/clang/Frontend/MultiplexConsumer.h +++ b/clang/include/clang/Frontend/MultiplexConsumer.h @@ -17,7 +17,7 @@ #include "clang/Basic/LLVM.h" #include "clang/Sema/SemaConsumer.h" -#include "llvm/ADT/OwningPtr.h" +#include #include namespace clang { diff --git a/clang/include/clang/Rewrite/Core/TokenRewriter.h b/clang/include/clang/Rewrite/Core/TokenRewriter.h index 78fbd24db8c9..c313b453d984 100644 --- a/clang/include/clang/Rewrite/Core/TokenRewriter.h +++ b/clang/include/clang/Rewrite/Core/TokenRewriter.h @@ -17,9 +17,9 @@ #include "clang/Basic/SourceLocation.h" #include "clang/Lex/Token.h" -#include "llvm/ADT/OwningPtr.h" #include #include +#include namespace clang { class LangOptions; diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h index 4ab9999d7bf9..4fa62f7f6679 100644 --- a/clang/include/clang/Serialization/ASTReader.h +++ b/clang/include/clang/Serialization/ASTReader.h @@ -188,8 +188,9 @@ public: /// \brief Simple wrapper class for chaining listeners. class ChainedASTReaderListener : public ASTReaderListener { - OwningPtr First; - OwningPtr Second; + std::unique_ptr First; + std::unique_ptr Second; + public: /// Takes ownership of \p First and \p Second. ChainedASTReaderListener(ASTReaderListener *First, ASTReaderListener *Second) diff --git a/clang/include/clang/Tooling/FileMatchTrie.h b/clang/include/clang/Tooling/FileMatchTrie.h index 8e72dc9b24c7..be37baff2ffc 100644 --- a/clang/include/clang/Tooling/FileMatchTrie.h +++ b/clang/include/clang/Tooling/FileMatchTrie.h @@ -16,8 +16,8 @@ #define LLVM_CLANG_TOOLING_FILE_MATCH_TRIE_H #include "clang/Basic/LLVM.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/StringRef.h" +#include #include #include diff --git a/clang/lib/ARCMigrate/ARCMT.cpp b/clang/lib/ARCMigrate/ARCMT.cpp index 5cbd799572e1..7a21a14784d7 100644 --- a/clang/lib/ARCMigrate/ARCMT.cpp +++ b/clang/lib/ARCMigrate/ARCMT.cpp @@ -537,7 +537,7 @@ bool MigrationProcess::applyTransform(TransformFn trans, std::unique_ptr ASTAction; ASTAction.reset(new ARCMTMacroTrackerAction(ARCMTMacroLocs)); - OwningPtr Unit(ASTUnit::LoadFromCompilerInvocationAction( + std::unique_ptr Unit(ASTUnit::LoadFromCompilerInvocationAction( CInvok.release(), Diags, ASTAction.get())); if (!Unit) { errRec.FinishCapture(); diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 3dc37a9f5ade..e19432aea97e 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -1631,9 +1631,7 @@ void Sema::WarnExactTypedMethods(ObjCMethodDecl *ImpMethodDecl, /// memory cost and it would be handy for lookups. typedef llvm::DenseSet ProtocolNameSet; -typedef llvm::OwningPtr LazyProtocolNameSet; - - +typedef std::unique_ptr LazyProtocolNameSet; static void findProtocolsWithExplicitImpls(const ObjCProtocolDecl *PDecl, ProtocolNameSet &PNS) { @@ -1691,7 +1689,7 @@ static void CheckProtocolMethodDefs(Sema &S, // change is restricted to 'objc_protocol_requires_explicit_implementation' // protocols for now for controlled evaluation. if (PDecl->hasAttr()) { - if (!ProtocolsExplictImpl.isValid()) { + if (!ProtocolsExplictImpl) { ProtocolsExplictImpl.reset(new ProtocolNameSet); findProtocolsWithExplicitImpls(Super, *ProtocolsExplictImpl); } diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 6e1bca4eecee..cbb2ff71eb8e 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -11685,7 +11685,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Obj, // Build the full argument list for the method call (the implicit object // parameter is placed at the beginning of the list). - llvm::OwningArrayPtr MethodArgs(new Expr*[Args.size() + 1]); + std::unique_ptr MethodArgs(new Expr *[Args.size() + 1]); MethodArgs[0] = Object.get(); std::copy(Args.begin(), Args.end(), &MethodArgs[1]);