[clang-tools-extra] r203382 - [C++11] Replace OwningPtr with std::unique_ptr.

Ahmed Charles ahmedcharles at gmail.com
Sun Mar 9 01:24:41 PST 2014


Author: ace2001ac
Date: Sun Mar  9 04:24:40 2014
New Revision: 203382

URL: http://llvm.org/viewvc/llvm-project?rev=203382&view=rev
Log:
[C++11] Replace OwningPtr with std::unique_ptr.

This removes all references to OwningPtr, which should be fairly
undisruptive to out-of-tree projects since they are unlikely to use
clang-tools-extra as a library instead of a set of tools.

Modified:
    clang-tools-extra/trunk/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
    clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
    clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp
    clang-tools-extra/trunk/clang-modernize/Core/Transform.h
    clang-tools-extra/trunk/clang-modernize/Core/Transforms.cpp
    clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h
    clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopConvert.h
    clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValue.h
    clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp
    clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp
    clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
    clang-tools-extra/trunk/clang-tidy/ClangTidy.h
    clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h
    clang-tools-extra/trunk/modularize/Modularize.cpp
    clang-tools-extra/trunk/modularize/ModuleAssistant.cpp
    clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp
    clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.h
    clang-tools-extra/trunk/pp-trace/PPTrace.cpp
    clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp
    clang-tools-extra/trunk/tool-template/ToolTemplate.cpp
    clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp
    clang-tools-extra/trunk/unittests/clang-query/QueryEngineTest.cpp
    clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h
    clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h

Modified: clang-tools-extra/trunk/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp (original)
+++ clang-tools-extra/trunk/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp Sun Mar  9 04:24:40 2014
@@ -59,7 +59,7 @@ collectReplacementsFromDirectory(const l
 
     TURFiles.push_back(I->path());
 
-    OwningPtr<MemoryBuffer> Out;
+    std::unique_ptr<MemoryBuffer> Out;
     error_code BufferError = MemoryBuffer::getFile(I->path(), Out);
     if (BufferError) {
       errs() << "Error reading " << I->path() << ": " << BufferError.message()

Modified: clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp (original)
+++ clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp Sun Mar  9 04:24:40 2014
@@ -233,7 +233,7 @@ int main(int argc, char **argv) {
 
   // Remove the TUReplacementFiles (triggered by "remove-change-desc-files"
   // command line option) when exiting main().
-  OwningPtr<ScopedFileRemover> Remover;
+  std::unique_ptr<ScopedFileRemover> Remover;
   if (RemoveTUReplacementFiles)
     Remover.reset(new ScopedFileRemover(TURFiles, Diagnostics));
 

Modified: clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp (original)
+++ clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp Sun Mar  9 04:24:40 2014
@@ -14,7 +14,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "IncludeExcludeInfo.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/MemoryBuffer.h"
@@ -122,7 +121,7 @@ error_code IncludeExcludeInfo::readListF
 error_code IncludeExcludeInfo::readListFromFile(StringRef IncludeListFile,
                                                 StringRef ExcludeListFile) {
   if (!IncludeListFile.empty()) {
-    OwningPtr<MemoryBuffer> FileBuf;
+    std::unique_ptr<MemoryBuffer> FileBuf;
     if (error_code Err = MemoryBuffer::getFile(IncludeListFile, FileBuf)) {
       errs() << "Unable to read from include file.\n";
       return Err;
@@ -132,7 +131,7 @@ error_code IncludeExcludeInfo::readListF
       return Err;
   }
   if (!ExcludeListFile.empty()) {
-    OwningPtr<MemoryBuffer> FileBuf;
+    std::unique_ptr<MemoryBuffer> FileBuf;
     if (error_code Err = MemoryBuffer::getFile(ExcludeListFile, FileBuf)) {
       errs() << "Unable to read from exclude file.\n";
       return Err;

Modified: clang-tools-extra/trunk/clang-modernize/Core/Transform.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/Core/Transform.h?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/Core/Transform.h (original)
+++ clang-tools-extra/trunk/clang-modernize/Core/Transform.h Sun Mar  9 04:24:40 2014
@@ -18,7 +18,6 @@
 
 #include "Core/IncludeExcludeInfo.h"
 #include "Core/Refactoring.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Registry.h"
 #include "llvm/Support/Timer.h"

Modified: clang-tools-extra/trunk/clang-modernize/Core/Transforms.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/Core/Transforms.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/Core/Transforms.cpp (original)
+++ clang-tools-extra/trunk/clang-modernize/Core/Transforms.cpp Sun Mar  9 04:24:40 2014
@@ -61,7 +61,7 @@ Transforms::createSelectedTransforms(con
     if (!OptionEnabled)
       continue;
 
-    llvm::OwningPtr<TransformFactory> Factory(I->instantiate());
+    std::unique_ptr<TransformFactory> Factory(I->instantiate());
     if (Factory->supportsCompilers(RequiredVersions))
       ChosenTransforms.push_back(Factory->createTransform(GlobalOptions));
     else if (ExplicitlyEnabled)

Modified: clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h (original)
+++ clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopActions.h Sun Mar  9 04:24:40 2014
@@ -53,7 +53,7 @@ struct TUTrackingInfo {
   /// \}
 
 private:
-  llvm::OwningPtr<StmtAncestorASTVisitor> ParentFinder;
+  std::unique_ptr<StmtAncestorASTVisitor> ParentFinder;
   StmtGeneratedVarNameMap GeneratedDecls;
   ReplacedVarsMap ReplacedVars;
 };

Modified: clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopConvert.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopConvert.h?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopConvert.h (original)
+++ clang-tools-extra/trunk/clang-modernize/LoopConvert/LoopConvert.h Sun Mar  9 04:24:40 2014
@@ -37,7 +37,7 @@ public:
   virtual bool handleBeginSource(clang::CompilerInstance &CI,
                                  llvm::StringRef Filename) override;
 private:
-  llvm::OwningPtr<TUTrackingInfo> TUInfo;
+  std::unique_ptr<TUTrackingInfo> TUInfo;
 };
 
 #endif // CLANG_MODERNIZE_LOOP_CONVERT_H

Modified: clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValue.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValue.h?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValue.h (original)
+++ clang-tools-extra/trunk/clang-modernize/PassByValue/PassByValue.h Sun Mar  9 04:24:40 2014
@@ -66,7 +66,7 @@ private:
   virtual bool handleBeginSource(clang::CompilerInstance &CI,
                                  llvm::StringRef Filename) override;
 
-  llvm::OwningPtr<IncludeDirectives> IncludeManager;
+  std::unique_ptr<IncludeDirectives> IncludeManager;
   ConstructorParamReplacer *Replacer;
 };
 

Modified: clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp (original)
+++ clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp Sun Mar  9 04:24:40 2014
@@ -323,7 +323,7 @@ int main(int argc, const char **argv) {
   cl::SetVersionPrinter(&printVersion);
 
   // Parse options and generate compilations.
-  OwningPtr<CompilationDatabase> Compilations(
+  std::unique_ptr<CompilationDatabase> Compilations(
       FixedCompilationDatabase::loadFromCommandLine(argc, argv));
   cl::ParseCommandLineOptions(argc, argv);
 

Modified: clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp (original)
+++ clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp Sun Mar  9 04:24:40 2014
@@ -32,7 +32,6 @@
 #include "clang/Frontend/ASTUnit.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "clang/Tooling/Tooling.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/LineEditor/LineEditor.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/MemoryBuffer.h"
@@ -70,8 +69,8 @@ int main(int argc, const char **argv) {
     return 1;
   }
 
-  llvm::OwningPtr<CompilationDatabase> Compilations(
-        FixedCompilationDatabase::loadFromCommandLine(argc, argv));
+  std::unique_ptr<CompilationDatabase> Compilations(
+      FixedCompilationDatabase::loadFromCommandLine(argc, argv));
   if (!Compilations) {  // Couldn't find a compilation DB from the command line
     std::string ErrorMessage;
     Compilations.reset(

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp Sun Mar  9 04:24:40 2014
@@ -100,7 +100,7 @@ ClangTidyASTConsumerFactory::ClangTidyAS
   for (ClangTidyModuleRegistry::iterator I = ClangTidyModuleRegistry::begin(),
                                          E = ClangTidyModuleRegistry::end();
        I != E; ++I) {
-    OwningPtr<ClangTidyModule> Module(I->instantiate());
+    std::unique_ptr<ClangTidyModule> Module(I->instantiate());
     Module->addCheckFactories(*CheckFactories);
   }
 

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidy.h?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidy.h (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidy.h Sun Mar  9 04:24:40 2014
@@ -124,7 +124,7 @@ private:
   SmallVector<ClangTidyCheck *, 8> Checks;
   ClangTidyContext &Context;
   ast_matchers::MatchFinder Finder;
-  OwningPtr<ClangTidyCheckFactories> CheckFactories;
+  std::unique_ptr<ClangTidyCheckFactories> CheckFactories;
 };
 
 /// \brief Fills the list of check names that are enabled when the provided

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.h Sun Mar  9 04:24:40 2014
@@ -128,7 +128,7 @@ private:
   void finalizeLastError();
 
   ClangTidyContext &Context;
-  OwningPtr<DiagnosticsEngine> Diags;
+  std::unique_ptr<DiagnosticsEngine> Diags;
   SmallVector<ClangTidyError, 8> Errors;
   bool LastErrorRelatesToUserCode;
 };

Modified: clang-tools-extra/trunk/modularize/Modularize.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/Modularize.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/modularize/Modularize.cpp (original)
+++ clang-tools-extra/trunk/modularize/Modularize.cpp Sun Mar  9 04:24:40 2014
@@ -154,7 +154,6 @@
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "clang/Tooling/Tooling.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/Config/config.h"
 #include "llvm/Option/Arg.h"
 #include "llvm/Option/ArgList.h"
@@ -231,7 +230,7 @@ error_code getHeaderFileNames(SmallVecto
     HeaderDirectory = HeaderPrefix;
 
   // Read the header list file into a buffer.
-  OwningPtr<MemoryBuffer> listBuffer;
+  std::unique_ptr<MemoryBuffer> listBuffer;
   if (error_code ec = MemoryBuffer::getFile(ListFileName, listBuffer)) {
     return ec;
   }
@@ -290,7 +289,7 @@ error_code getHeaderFileNames(SmallVecto
 
 // Helper function for finding the input file in an arguments list.
 std::string findInputFile(const CommandLineArguments &CLArgs) {
-  OwningPtr<OptTable> Opts(createDriverOptTable());
+  std::unique_ptr<OptTable> Opts(createDriverOptTable());
   const unsigned IncludedFlagsBitmask = options::CC1Option;
   unsigned MissingArgIndex, MissingArgCount;
   SmallVector<const char *, 256> Argv;
@@ -298,7 +297,7 @@ std::string findInputFile(const CommandL
                                             E = CLArgs.end();
        I != E; ++I)
     Argv.push_back(I->c_str());
-  OwningPtr<InputArgList> Args(
+  std::unique_ptr<InputArgList> Args(
       Opts->ParseArgs(Argv.data(), Argv.data() + Argv.size(), MissingArgIndex,
                       MissingArgCount, IncludedFlagsBitmask));
   std::vector<std::string> Inputs = Args->getAllArgValues(OPT_INPUT);
@@ -725,12 +724,12 @@ int main(int Argc, const char **Argv) {
   // Create the compilation database.
   SmallString<256> PathBuf;
   sys::fs::current_path(PathBuf);
-  OwningPtr<CompilationDatabase> Compilations;
+  std::unique_ptr<CompilationDatabase> Compilations;
   Compilations.reset(
       new FixedCompilationDatabase(Twine(PathBuf), CC1Arguments));
 
   // Create preprocessor tracker, to watch for macro and conditional problems.
-  OwningPtr<PreprocessorTracker> PPTracker(PreprocessorTracker::create());
+  std::unique_ptr<PreprocessorTracker> PPTracker(PreprocessorTracker::create());
 
   // Parse all of the headers, detecting duplicates.
   EntityMap Entities;

Modified: clang-tools-extra/trunk/modularize/ModuleAssistant.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/ModuleAssistant.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/modularize/ModuleAssistant.cpp (original)
+++ clang-tools-extra/trunk/modularize/ModuleAssistant.cpp Sun Mar  9 04:24:40 2014
@@ -30,7 +30,6 @@
 //===---------------------------------------------------------------------===//
 
 #include "Modularize.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
@@ -281,7 +280,7 @@ bool createModuleMap(llvm::StringRef Mod
                      DependencyMap &Dependencies, llvm::StringRef HeaderPrefix,
                      llvm::StringRef RootModuleName) {
   // Load internal representation of modules.
-  llvm::OwningPtr<Module> RootModule(loadModuleDescriptions(
+  std::unique_ptr<Module> RootModule(loadModuleDescriptions(
       RootModuleName, HeaderFileNames, Dependencies, HeaderPrefix));
   if (!RootModule.get())
     return false;

Modified: clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp (original)
+++ clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.cpp Sun Mar  9 04:24:40 2014
@@ -126,8 +126,9 @@ int main(int Argc, const char **Argv) {
   cl::ParseCommandLineOptions(Argc, Argv, "module-map-checker.\n");
 
   // Create checker object.
-  OwningPtr<ModuleMapChecker> Checker(ModuleMapChecker::createModuleMapChecker(
-      ModuleMapPath, IncludePaths, DumpModuleMap, CC1Arguments));
+  std::unique_ptr<ModuleMapChecker> Checker(
+      ModuleMapChecker::createModuleMapChecker(ModuleMapPath, IncludePaths,
+                                               DumpModuleMap, CC1Arguments));
 
   // Do the checks.  The return value is the program return code,
   // 0 for okay, 1 for module map warnings produced, 2 for any other error.
@@ -394,7 +395,7 @@ ModuleMapChecker::collectUmbrellaHeaderH
     sys::fs::current_path(PathBuf);
 
   // Create the compilation database.
-  OwningPtr<CompilationDatabase> Compilations;
+  std::unique_ptr<CompilationDatabase> Compilations;
   Compilations.reset(new FixedCompilationDatabase(Twine(PathBuf), CommandLine));
 
   std::vector<std::string> HeaderPath;

Modified: clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.h?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.h (original)
+++ clang-tools-extra/trunk/module-map-checker/ModuleMapChecker.h Sun Mar  9 04:24:40 2014
@@ -25,7 +25,6 @@
 #include "clang/Lex/HeaderSearchOptions.h"
 #include "clang/Lex/ModuleMap.h"
 #include "clang/Lex/Preprocessor.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Support/Host.h"
 #include <string>
@@ -82,9 +81,9 @@ class ModuleMapChecker {
   /// Options controlling the \#include directive.
   llvm::IntrusiveRefCntPtr<clang::HeaderSearchOptions> HeaderSearchOpts;
   /// Header search manager.
-  llvm::OwningPtr<clang::HeaderSearch> HeaderInfo;
+  std::unique_ptr<clang::HeaderSearch> HeaderInfo;
   /// The module map.
-  llvm::OwningPtr<clang::ModuleMap> ModMap;
+  std::unique_ptr<clang::ModuleMap> ModMap;
 
   // Internal data.
 

Modified: clang-tools-extra/trunk/pp-trace/PPTrace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/pp-trace/PPTrace.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/pp-trace/PPTrace.cpp (original)
+++ clang-tools-extra/trunk/pp-trace/PPTrace.cpp Sun Mar  9 04:24:40 2014
@@ -57,7 +57,6 @@
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "clang/Tooling/Tooling.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/Config/config.h"
 #include "llvm/Option/Arg.h"
 #include "llvm/Option/ArgList.h"
@@ -192,7 +191,7 @@ int main(int Argc, const char **Argv) {
   // Create the compilation database.
   SmallString<256> PathBuf;
   sys::fs::current_path(PathBuf);
-  OwningPtr<CompilationDatabase> Compilations;
+  std::unique_ptr<CompilationDatabase> Compilations;
   Compilations.reset(
       new FixedCompilationDatabase(Twine(PathBuf), CC1Arguments));
 

Modified: clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp (original)
+++ clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp Sun Mar  9 04:24:40 2014
@@ -42,7 +42,6 @@
 #include "clang/Tooling/CompilationDatabase.h"
 #include "clang/Tooling/Refactoring.h"
 #include "clang/Tooling/Tooling.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/MemoryBuffer.h"
@@ -179,8 +178,8 @@ cl::list<std::string> SourcePaths(
 
 int main(int argc, const char **argv) {
   llvm::sys::PrintStackTraceOnErrorSignal();
-  llvm::OwningPtr<CompilationDatabase> Compilations(
-    tooling::FixedCompilationDatabase::loadFromCommandLine(argc, argv));
+  std::unique_ptr<CompilationDatabase> Compilations(
+      tooling::FixedCompilationDatabase::loadFromCommandLine(argc, argv));
   cl::ParseCommandLineOptions(argc, argv);
   if (!Compilations) {
     std::string ErrorMessage;

Modified: clang-tools-extra/trunk/tool-template/ToolTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/tool-template/ToolTemplate.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/tool-template/ToolTemplate.cpp (original)
+++ clang-tools-extra/trunk/tool-template/ToolTemplate.cpp Sun Mar  9 04:24:40 2014
@@ -42,7 +42,6 @@
 #include "clang/Tooling/CompilationDatabase.h"
 #include "clang/Tooling/Refactoring.h"
 #include "clang/Tooling/Tooling.h"
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/Signals.h"
@@ -81,8 +80,8 @@ cl::list<std::string> SourcePaths(
 
 int main(int argc, const char **argv) {
   llvm::sys::PrintStackTraceOnErrorSignal();
-  llvm::OwningPtr<CompilationDatabase> Compilations(
-        FixedCompilationDatabase::loadFromCommandLine(argc, argv));
+  std::unique_ptr<CompilationDatabase> Compilations(
+      FixedCompilationDatabase::loadFromCommandLine(argc, argv));
   cl::ParseCommandLineOptions(argc, argv);
   if (!Compilations) {  // Couldn't find a compilation DB from the command line
     std::string ErrorMessage;

Modified: clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-modernize/IncludeDirectivesTest.cpp Sun Mar  9 04:24:40 2014
@@ -105,7 +105,7 @@ private:
   StringRef Include;
   VirtualFileHelper VFHelper;
   tooling::Replacements &Replaces;
-  OwningPtr<IncludeDirectives> FileIncludes;
+  std::unique_ptr<IncludeDirectives> FileIncludes;
   std::string FileToModify;
   // if non-null, add the include directives in this file instead of the main
   // file.

Modified: clang-tools-extra/trunk/unittests/clang-query/QueryEngineTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-query/QueryEngineTest.cpp?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-query/QueryEngineTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-query/QueryEngineTest.cpp Sun Mar  9 04:24:40 2014
@@ -25,10 +25,10 @@ using namespace clang::query;
 using namespace clang::tooling;
 
 TEST(Query, Basic) {
-  OwningPtr<ASTUnit> FooAST(
+  std::unique_ptr<ASTUnit> FooAST(
       buildASTFromCode("void foo1(void) {}\nvoid foo2(void) {}", "foo.cc"));
   ASSERT_TRUE(FooAST.get());
-  OwningPtr<ASTUnit> BarAST(
+  std::unique_ptr<ASTUnit> BarAST(
       buildASTFromCode("void bar1(void) {}\nvoid bar2(void) {}", "bar.cc"));
   ASSERT_TRUE(BarAST.get());
 

Modified: clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyTest.h Sun Mar  9 04:24:40 2014
@@ -50,7 +50,7 @@ template <typename T> std::string runChe
     return "";
   ast_matchers::MatchFinder Finder;
   Check.registerMatchers(&Finder);
-  OwningPtr<tooling::FrontendActionFactory> Factory(
+  std::unique_ptr<tooling::FrontendActionFactory> Factory(
       tooling::newFrontendActionFactory(&Finder));
   if (!tooling::runToolOnCode(Factory->create(), Code))
     return "";

Modified: clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h?rev=203382&r1=203381&r2=203382&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h (original)
+++ clang-tools-extra/trunk/unittests/include/common/VirtualFileHelper.h Sun Mar  9 04:24:40 2014
@@ -73,7 +73,7 @@ private:
   FileManager Files;
   // most tests don't need more than one file
   llvm::SmallVector<VirtualFile, 1> VirtualFiles;
-  llvm::OwningPtr<SourceManager> Sources;
+  std::unique_ptr<SourceManager> Sources;
 };
 
 } // end namespace clang





More information about the cfe-commits mailing list