]> granicus.if.org Git - clang/commitdiff
Replace OwningPtr with std::unique_ptr.
authorAhmed Charles <ahmedcharles@gmail.com>
Fri, 7 Mar 2014 20:03:18 +0000 (20:03 +0000)
committerAhmed Charles <ahmedcharles@gmail.com>
Fri, 7 Mar 2014 20:03:18 +0000 (20:03 +0000)
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203279 91177308-0d34-0410-b5e6-96231b3b80d8

154 files changed:
include/clang/ARCMigrate/FileRemapper.h
include/clang/AST/ASTContext.h
include/clang/ASTMatchers/Dynamic/VariantValue.h
include/clang/Analysis/AnalysisContext.h
include/clang/Basic/FileManager.h
include/clang/Basic/FileSystemStatCache.h
include/clang/Basic/SourceManager.h
include/clang/Basic/VirtualFileSystem.h
include/clang/CodeGen/CodeGenAction.h
include/clang/Driver/Job.h
include/clang/Driver/ToolChain.h
include/clang/Frontend/ASTUnit.h
include/clang/Frontend/ChainedDiagnosticConsumer.h
include/clang/Frontend/CompilerInstance.h
include/clang/Frontend/FrontendAction.h
include/clang/Frontend/MultiplexConsumer.h
include/clang/Frontend/TextDiagnosticPrinter.h
include/clang/Frontend/VerifyDiagnosticConsumer.h
include/clang/Lex/HeaderSearch.h
include/clang/Lex/Preprocessor.h
include/clang/Parse/Parser.h
include/clang/Rewrite/Core/TokenRewriter.h
include/clang/Rewrite/Frontend/FrontendActions.h
include/clang/Sema/Sema.h
include/clang/Serialization/ASTReader.h
include/clang/Serialization/GlobalModuleIndex.h
include/clang/Serialization/Module.h
include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
include/clang/Tooling/CommonOptionsParser.h
include/clang/Tooling/CompilationDatabase.h
include/clang/Tooling/FileMatchTrie.h
include/clang/Tooling/JSONCompilationDatabase.h
lib/ARCMigrate/ARCMT.cpp
lib/ARCMigrate/FileRemapper.cpp
lib/ARCMigrate/ObjCMT.cpp
lib/ARCMigrate/TransRetainReleaseDealloc.cpp
lib/ARCMigrate/TransUnbridgedCasts.cpp
lib/AST/Expr.cpp
lib/Analysis/CFG.cpp
lib/Analysis/Consumed.cpp
lib/Basic/FileManager.cpp
lib/Basic/FileSystemStatCache.cpp
lib/Basic/Targets.cpp
lib/Basic/VirtualFileSystem.cpp
lib/CodeGen/BackendUtil.cpp
lib/CodeGen/CGBlocks.cpp
lib/CodeGen/CGCXXABI.h
lib/CodeGen/CGVTables.cpp
lib/CodeGen/CodeGenAction.cpp
lib/CodeGen/CodeGenModule.h
lib/CodeGen/CodeGenPGO.h
lib/CodeGen/ModuleBuilder.cpp
lib/Driver/Driver.cpp
lib/Driver/SanitizerArgs.cpp
lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h
lib/Format/ContinuationIndenter.cpp
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/UnwrappedLineParser.h
lib/Frontend/ASTUnit.cpp
lib/Frontend/ChainedIncludesSource.cpp
lib/Frontend/CompilerInstance.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/CreateInvocationFromCommandLine.cpp
lib/Frontend/FrontendAction.cpp
lib/Frontend/FrontendActions.cpp
lib/Frontend/MultiplexConsumer.cpp
lib/Frontend/SerializedDiagnosticPrinter.cpp
lib/FrontendTool/ExecuteCompilerInvocation.cpp
lib/Lex/HeaderMap.cpp
lib/Lex/PTHLexer.cpp
lib/Parse/ParseAST.cpp
lib/Parse/ParseDecl.cpp
lib/Parse/ParseStmt.cpp
lib/Rewrite/Core/Rewriter.cpp
lib/Rewrite/Frontend/FixItRewriter.cpp
lib/Rewrite/Frontend/FrontendActions.cpp
lib/Sema/SemaLookup.cpp
lib/Sema/SemaObjCProperty.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/GlobalModuleIndex.cpp
lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp
lib/StaticAnalyzer/Checkers/CStringChecker.cpp
lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp
lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp
lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp
lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp
lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp
lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp
lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
lib/StaticAnalyzer/Checkers/StreamChecker.cpp
lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp
lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp
lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp
lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
lib/StaticAnalyzer/Core/BugReporter.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/PathDiagnostic.cpp
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
lib/Tooling/CompilationDatabase.cpp
lib/Tooling/JSONCompilationDatabase.cpp
lib/Tooling/Tooling.cpp
tools/arcmt-test/arcmt-test.cpp
tools/clang-check/ClangCheck.cpp
tools/clang-format/ClangFormat.cpp
tools/diagtool/ShowEnabledWarnings.cpp
tools/driver/cc1_main.cpp
tools/driver/cc1as_main.cpp
tools/driver/driver.cpp
tools/libclang/ARCMigrate.cpp
tools/libclang/CIndex.cpp
tools/libclang/CXLoadedDiagnostic.cpp
tools/libclang/Indexing.cpp
unittests/AST/DeclPrinterTest.cpp
unittests/AST/DeclTest.cpp
unittests/AST/MatchVerifier.h
unittests/AST/StmtPrinterTest.cpp
unittests/ASTMatchers/ASTMatchersTest.cpp
unittests/ASTMatchers/ASTMatchersTest.h
unittests/ASTMatchers/Dynamic/RegistryTest.cpp
unittests/Basic/VirtualFileSystemTest.cpp
unittests/Sema/ExternalSemaSourceTest.cpp
unittests/Tooling/CompilationDatabaseTest.cpp
unittests/Tooling/RefactoringCallbacksTest.cpp
unittests/Tooling/ToolingTest.cpp

index f7677cc8620a8a5afc6b046cfc77863bffd29e97..c69892b69c6bc244489c8a2137bc0e014858b307 100644 (file)
@@ -30,7 +30,7 @@ namespace arcmt {
 
 class FileRemapper {
   // FIXME: Reuse the same FileManager for multiple ASTContexts.
-  OwningPtr<FileManager> FileMgr;
+  std::unique_ptr<FileManager> FileMgr;
 
   typedef llvm::PointerUnion<const FileEntry *, llvm::MemoryBuffer *> Target;
   typedef llvm::DenseMap<const FileEntry *, Target> MappingsTy;
index 20fddf2d44a2caaed2f96c0788ae02154f5c72a5..3f04588d562648d3dad149979935f3686f9a9549 100644 (file)
@@ -394,7 +394,7 @@ private:
   PartialDiagnostic::StorageAllocator DiagAllocator;
 
   /// \brief The current C++ ABI.
-  OwningPtr<CXXABI> ABI;
+  std::unique_ptr<CXXABI> ABI;
   CXXABI *createCXXABI(const TargetInfo &T);
 
   /// \brief The logical -> physical address space map.
@@ -2300,9 +2300,9 @@ private:
   friend class DeclarationNameTable;
   void ReleaseDeclContextMaps();
 
-  llvm::OwningPtr<ParentMap> AllParents;
+  std::unique_ptr<ParentMap> AllParents;
 
-  llvm::OwningPtr<VTableContextBase> VTContext;
+  std::unique_ptr<VTableContextBase> VTContext;
 };
 
 /// \brief Utility function for constructing a nullary selector.
index 1b9970dd8f1d3d70b2728a1f91f605a117173363..a20237fc62721f75c8f773ef96bae90fbc8b0b0a 100644 (file)
@@ -173,7 +173,7 @@ private:
     const MatcherT &matcher() const { return *Out; }
 
   private:
-    OwningPtr<MatcherT> Out;
+    std::unique_ptr<MatcherT> Out;
   };
 
   IntrusiveRefCntPtr<const Payload> Value;
index 8fc05f0561fb47fab7118860de133b5e97294815..9188d144384c319dceb333c0deda1e0c44e83516 100644 (file)
@@ -69,16 +69,16 @@ class AnalysisDeclContext {
 
   const Decl * const D;
 
-  OwningPtr<CFG> cfg, completeCFG;
-  OwningPtr<CFGStmtMap> cfgStmtMap;
+  std::unique_ptr<CFG> cfg, completeCFG;
+  std::unique_ptr<CFGStmtMap> cfgStmtMap;
 
   CFG::BuildOptions cfgBuildOptions;
   CFG::BuildOptions::ForcedBlkExprs *forcedBlkExprs;
 
   bool builtCFG, builtCompleteCFG;
-  OwningPtr<ParentMap> PM;
-  OwningPtr<PseudoConstantAnalysis> PCA;
-  OwningPtr<CFGReverseBlockReachabilityAnalysis> CFA;
+  std::unique_ptr<ParentMap> PM;
+  std::unique_ptr<PseudoConstantAnalysis> PCA;
+  std::unique_ptr<CFGReverseBlockReachabilityAnalysis> CFA;
 
   llvm::BumpPtrAllocator A;
 
index 1e13442770ee9db4fcc2376db9d851a8efae30e4..a1068fe8800238dd965fab1b2a427f3562f0046e 100644 (file)
@@ -70,7 +70,7 @@ class FileEntry {
   bool IsValid;               // Is this \c FileEntry initialized and valid?
 
   /// \brief The open file, if it is owned by the \p FileEntry.
-  mutable OwningPtr<vfs::File> File;
+  mutable std::unique_ptr<vfs::File> File;
   friend class FileManager;
 
   void closeFile() const {
@@ -169,7 +169,7 @@ class FileManager : public RefCountedBase<FileManager> {
   unsigned NumDirCacheMisses, NumFileCacheMisses;
 
   // Caching.
-  OwningPtr<FileSystemStatCache> StatCache;
+  std::unique_ptr<FileSystemStatCache> StatCache;
 
   bool getStatValue(const char *Path, FileData &Data, bool isFile,
                     vfs::File **F);
index 05b65eede5b1cc7ea7630975c51288765d4fc30c..96384849c1bb42f8ccadd5be35610bbb07889804 100644 (file)
@@ -46,8 +46,8 @@ struct FileData {
 class FileSystemStatCache {
   virtual void anchor();
 protected:
-  OwningPtr<FileSystemStatCache> NextStatCache;
-  
+  std::unique_ptr<FileSystemStatCache> NextStatCache;
+
 public:
   virtual ~FileSystemStatCache() {}
   
index 1d6868148368e0ae21273bc96d3265046a555af8..415a0afdf1f23dc17e2924057b6d69578f8b3191 100644 (file)
@@ -569,7 +569,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
 
   /// \brief Lazily create the object keeping overridden files info, since
   /// it is uncommonly used.
-  OwningPtr<OverriddenFilesInfoTy> OverriddenFilesInfo;
+  std::unique_ptr<OverriddenFilesInfoTy> OverriddenFilesInfo;
 
   OverriddenFilesInfoTy &getOverriddenFilesInfo() {
     if (!OverriddenFilesInfo)
index 4c5f5a7f6503dd752684dbdd81a2b5c8771a4a4b..5595e143bc27abc4952933a3045541c0ff40bbc1 100644 (file)
@@ -84,10 +84,9 @@ public:
   /// \brief Get the status of the file.
   virtual llvm::ErrorOr<Status> status() = 0;
   /// \brief Get the contents of the file as a \p MemoryBuffer.
-  virtual llvm::error_code getBuffer(const Twine &Name,
-                                     OwningPtr<llvm::MemoryBuffer> &Result,
-                                     int64_t FileSize = -1,
-                                     bool RequiresNullTerminator = true) = 0;
+  virtual llvm::error_code
+  getBuffer(const Twine &Name, std::unique_ptr<llvm::MemoryBuffer> &Result,
+            int64_t FileSize = -1, bool RequiresNullTerminator = true) = 0;
   /// \brief Closes the file.
   virtual llvm::error_code close() = 0;
   /// \brief Sets the name to use for this file.
@@ -103,12 +102,12 @@ public:
   virtual llvm::ErrorOr<Status> status(const Twine &Path) = 0;
   /// \brief Get a \p File object for the file at \p Path, if one exists.
   virtual llvm::error_code openFileForRead(const Twine &Path,
-                                           OwningPtr<File> &Result) = 0;
+                                           std::unique_ptr<File> &Result) = 0;
 
   /// This is a convenience method that opens a file, gets its content and then
   /// closes the file.
   llvm::error_code getBufferForFile(const Twine &Name,
-                                    OwningPtr<llvm::MemoryBuffer> &Result,
+                                    std::unique_ptr<llvm::MemoryBuffer> &Result,
                                     int64_t FileSize = -1,
                                     bool RequiresNullTerminator = true);
 };
@@ -149,7 +148,7 @@ public:
 
   llvm::ErrorOr<Status> status(const Twine &Path) override;
   llvm::error_code openFileForRead(const Twine &Path,
-                                   OwningPtr<File> &Result) override;
+                                   std::unique_ptr<File> &Result) override;
 };
 
 /// \brief Get a globally unique ID for a virtual file or directory.
index 912ef01a018c320557d53584dfd1acfa0588599d..6097a021a8334f2388deb75828aa434b6ab7c1d9 100644 (file)
@@ -24,7 +24,7 @@ class BackendConsumer;
 class CodeGenAction : public ASTFrontendAction {
 private:
   unsigned Act;
-  OwningPtr<llvm::Module> TheModule;
+  std::unique_ptr<llvm::Module> TheModule;
   llvm::Module *LinkModule;
   llvm::LLVMContext *VMContext;
   bool OwnsVMContext;
index d7e74a9ce83e7e3a5f74d886e176b4f3ca08afb2..db571bf0c57b27d37b7b7ad517e93f2bada5156b 100644 (file)
@@ -117,7 +117,7 @@ public:
   }
 
 private:
-  OwningPtr<Command> Fallback;
+  std::unique_ptr<Command> Fallback;
 };
 
 /// JobList - A sequence of jobs to perform.
index e8f2c78b733b4e331e43ab876aa3f4c6c7bb26e2..0acf743b1fcb38aa1ccbaddcfd99dd8fefa6de73 100644 (file)
@@ -66,15 +66,15 @@ private:
   /// programs.
   path_list ProgramPaths;
 
-  mutable OwningPtr<Tool> Clang;
-  mutable OwningPtr<Tool> Assemble;
-  mutable OwningPtr<Tool> Link;
+  mutable std::unique_ptr<Tool> Clang;
+  mutable std::unique_ptr<Tool> Assemble;
+  mutable std::unique_ptr<Tool> Link;
   Tool *getClang() const;
   Tool *getAssemble() const;
   Tool *getLink() const;
   Tool *getClangAs() const;
 
-  mutable OwningPtr<SanitizerArgs> SanitizerArguments;
+  mutable std::unique_ptr<SanitizerArgs> SanitizerArguments;
 
 protected:
   MultilibSet Multilibs;
index 3cf6d18642fb46e9e43e955e060532b152df49cc..fd8fed24c2d2d744a456d0d4b6a6bdc212aef3bf 100644 (file)
@@ -87,7 +87,7 @@ private:
   IntrusiveRefCntPtr<DiagnosticsEngine>   Diagnostics;
   IntrusiveRefCntPtr<FileManager>         FileMgr;
   IntrusiveRefCntPtr<SourceManager>       SourceMgr;
-  OwningPtr<HeaderSearch>                 HeaderInfo;
+  std::unique_ptr<HeaderSearch>           HeaderInfo;
   IntrusiveRefCntPtr<TargetInfo>          Target;
   IntrusiveRefCntPtr<Preprocessor>        PP;
   IntrusiveRefCntPtr<ASTContext>          Ctx;
@@ -97,18 +97,18 @@ private:
   bool HadModuleLoaderFatalFailure;
 
   struct ASTWriterData;
-  OwningPtr<ASTWriterData> WriterData;
+  std::unique_ptr<ASTWriterData> WriterData;
 
   FileSystemOptions FileSystemOpts;
 
   /// \brief The AST consumer that received information about the translation
   /// unit as it was parsed or loaded.
-  OwningPtr<ASTConsumer> Consumer;
-  
+  std::unique_ptr<ASTConsumer> Consumer;
+
   /// \brief The semantic analysis object used to type-check the translation
   /// unit.
-  OwningPtr<Sema> TheSema;
-  
+  std::unique_ptr<Sema> TheSema;
+
   /// Optional owned invocation, just used to make the invocation used in
   /// LoadFromCommandLine available.
   IntrusiveRefCntPtr<CompilerInvocation> Invocation;
@@ -382,8 +382,8 @@ private:
   /// \brief Allocator used to store cached code completions.
   IntrusiveRefCntPtr<GlobalCodeCompletionAllocator>
     CachedCompletionAllocator;
-  
-  OwningPtr<CodeCompletionTUInfo> CCTUInfo;
+
+  std::unique_ptr<CodeCompletionTUInfo> CCTUInfo;
 
   /// \brief The set of cached code-completion results.
   std::vector<CachedCodeCompletionResult> CachedCompletionResults;
@@ -754,19 +754,14 @@ public:
   /// This will only receive an ASTUnit if a new one was created. If an already
   /// created ASTUnit was passed in \p Unit then the caller can check that.
   ///
-  static ASTUnit *LoadFromCompilerInvocationAction(CompilerInvocation *CI,
-                              IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
-                                             ASTFrontendAction *Action = 0,
-                                             ASTUnit *Unit = 0,
-                                             bool Persistent = true,
-                                      StringRef ResourceFilesPath = StringRef(),
-                                             bool OnlyLocalDecls = false,
-                                             bool CaptureDiagnostics = false,
-                                             bool PrecompilePreamble = false,
-                                       bool CacheCodeCompletionResults = false,
-                              bool IncludeBriefCommentsInCodeCompletion = false,
-                                       bool UserFilesAreVolatile = false,
-                                       OwningPtr<ASTUnit> *ErrAST = 0);
+  static ASTUnit *LoadFromCompilerInvocationAction(
+      CompilerInvocation *CI, IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
+      ASTFrontendAction *Action = 0, ASTUnit *Unit = 0, bool Persistent = true,
+      StringRef ResourceFilesPath = StringRef(), bool OnlyLocalDecls = false,
+      bool CaptureDiagnostics = false, bool PrecompilePreamble = false,
+      bool CacheCodeCompletionResults = false,
+      bool IncludeBriefCommentsInCodeCompletion = false,
+      bool UserFilesAreVolatile = false, std::unique_ptr<ASTUnit> *ErrAST = 0);
 
   /// LoadFromCompilerInvocation - Create an ASTUnit from a source file, via a
   /// CompilerInvocation object.
@@ -807,24 +802,19 @@ public:
   ///
   // FIXME: Move OnlyLocalDecls, UseBumpAllocator to setters on the ASTUnit, we
   // shouldn't need to specify them at construction time.
-  static ASTUnit *LoadFromCommandLine(const char **ArgBegin,
-                                      const char **ArgEnd,
-                              IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
-                                      StringRef ResourceFilesPath,
-                                      bool OnlyLocalDecls = false,
-                                      bool CaptureDiagnostics = false,
-                                      ArrayRef<RemappedFile> RemappedFiles = None,
-                                      bool RemappedFilesKeepOriginalName = true,
-                                      bool PrecompilePreamble = false,
-                                      TranslationUnitKind TUKind = TU_Complete,
-                                      bool CacheCodeCompletionResults = false,
-                            bool IncludeBriefCommentsInCodeCompletion = false,
-                                      bool AllowPCHWithCompilerErrors = false,
-                                      bool SkipFunctionBodies = false,
-                                      bool UserFilesAreVolatile = false,
-                                      bool ForSerialization = false,
-                                      OwningPtr<ASTUnit> *ErrAST = 0);
-  
+  static ASTUnit *LoadFromCommandLine(
+      const char **ArgBegin, const char **ArgEnd,
+      IntrusiveRefCntPtr<DiagnosticsEngine> Diags, StringRef ResourceFilesPath,
+      bool OnlyLocalDecls = false, bool CaptureDiagnostics = false,
+      ArrayRef<RemappedFile> RemappedFiles = None,
+      bool RemappedFilesKeepOriginalName = true,
+      bool PrecompilePreamble = false, TranslationUnitKind TUKind = TU_Complete,
+      bool CacheCodeCompletionResults = false,
+      bool IncludeBriefCommentsInCodeCompletion = false,
+      bool AllowPCHWithCompilerErrors = false, bool SkipFunctionBodies = false,
+      bool UserFilesAreVolatile = false, bool ForSerialization = false,
+      std::unique_ptr<ASTUnit> *ErrAST = 0);
+
   /// \brief Reparse the source files using the same command-line options that
   /// were originally used to produce this translation unit.
   ///
index b7dc7c7b529113e7d6a70aa624f5f62fab98c093..b428200f37db5738386f9fa6e58b5dc78b3dd565 100644 (file)
@@ -22,8 +22,8 @@ class LangOptions;
 /// diagnostics should be included in counts.
 class ChainedDiagnosticConsumer : public DiagnosticConsumer {
   virtual void anchor();
-  OwningPtr<DiagnosticConsumer> Primary;
-  OwningPtr<DiagnosticConsumer> Secondary;
+  std::unique_ptr<DiagnosticConsumer> Primary;
+  std::unique_ptr<DiagnosticConsumer> Secondary;
 
 public:
   ChainedDiagnosticConsumer(DiagnosticConsumer *_Primary,
index 62aeca103ca9cf563b2b38a4430fa3c23c726751..3cb2d21e8141ea2ce73221564318aab260621e14 100644 (file)
@@ -91,16 +91,16 @@ class CompilerInstance : public ModuleLoader {
   IntrusiveRefCntPtr<ASTContext> Context;
 
   /// The AST consumer.
-  OwningPtr<ASTConsumer> Consumer;
+  std::unique_ptr<ASTConsumer> Consumer;
 
   /// The code completion consumer.
-  OwningPtr<CodeCompleteConsumer> CompletionConsumer;
+  std::unique_ptr<CodeCompleteConsumer> CompletionConsumer;
 
   /// \brief The semantic analysis object.
-  OwningPtr<Sema> TheSema;
+  std::unique_ptr<Sema> TheSema;
 
   /// \brief The frontend timer
-  OwningPtr<llvm::Timer> FrontendTimer;
+  std::unique_ptr<llvm::Timer> FrontendTimer;
 
   /// \brief The ASTReader, if one exists.
   IntrusiveRefCntPtr<ASTReader> ModuleManager;
index 034d38c1d8b70c80c6d869948e49a3b958527ca7..20a7b99fc1c853b4b5db58703d2a2b75f97babc7 100644 (file)
@@ -35,7 +35,7 @@ class CompilerInstance;
 /// Abstract base class for actions which can be performed by the frontend.
 class FrontendAction {
   FrontendInputFile CurrentInput;
-  OwningPtr<ASTUnit> CurrentASTUnit;
+  std::unique_ptr<ASTUnit> CurrentASTUnit;
   CompilerInstance *Instance;
   friend class ASTMergeAction;
   friend class WrapperFrontendAction;
@@ -260,7 +260,7 @@ public:
 /// some existing action's behavior. It implements every virtual method in
 /// the FrontendAction interface by forwarding to the wrapped action.
 class WrapperFrontendAction : public FrontendAction {
-  OwningPtr<FrontendAction> WrappedAction;
+  std::unique_ptr<FrontendAction> WrappedAction;
 
 protected:
   virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
index 6ea7547c71401bfc9835337bd7af053ff3476be7..b0080ec32cb81c08bfd5d2ee836f6404263b03ee 100644 (file)
@@ -53,8 +53,8 @@ public:
 
 private:
   std::vector<ASTConsumer*> Consumers;  // Owns these.
-  OwningPtr<MultiplexASTMutationListener> MutationListener;
-  OwningPtr<MultiplexASTDeserializationListener> DeserializationListener;
+  std::unique_ptr<MultiplexASTMutationListener> MutationListener;
+  std::unique_ptr<MultiplexASTDeserializationListener> DeserializationListener;
 };
 
 }  // end namespace clang
index dc8047066c1d315d056855b2ef141d02375f662a..658f9d49736edc8195c4f57ac8dbc2ed597498bc 100644 (file)
@@ -30,7 +30,7 @@ class TextDiagnosticPrinter : public DiagnosticConsumer {
   IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts;
 
   /// \brief Handle to the currently active text diagnostic emitter.
-  OwningPtr<TextDiagnostic> TextDiag;
+  std::unique_ptr<TextDiagnostic> TextDiag;
 
   /// A string to prefix to error messages.
   std::string Prefix;
index 517c7374f066b67186d427abf24af980bbff6d47..216b99ac78dbd38a88695c4a016df06b7b91b569 100644 (file)
@@ -204,7 +204,7 @@ private:
   DiagnosticsEngine &Diags;
   DiagnosticConsumer *PrimaryClient;
   bool OwnsPrimaryClient;
-  OwningPtr<TextDiagnosticBuffer> Buffer;
+  std::unique_ptr<TextDiagnosticBuffer> Buffer;
   const Preprocessor *CurrentPreprocessor;
   const LangOptions *LangOpts;
   SourceManager *SrcManager;
index 93efa2d4a3cb93188168f80ba389ed010c6a7dc7..ffd13b4c77fb63d6a28f7da2ec613357eba9d05a 100644 (file)
@@ -205,7 +205,7 @@ class HeaderSearch {
   /// include_alias pragma for Microsoft compatibility.
   typedef llvm::StringMap<std::string, llvm::BumpPtrAllocator>
     IncludeAliasMap;
-  OwningPtr<IncludeAliasMap> IncludeAliases;
+  std::unique_ptr<IncludeAliasMap> IncludeAliases;
 
   /// HeaderMaps - This is a mapping from FileEntry -> HeaderMap, uniquing
   /// headermaps.  This vector owns the headermap.
index e0cfc82c471d8ca2e15107eabd58768979fb196f..a992beee8fa7730c6773d9e6cd0453a5ff8076b8 100644 (file)
@@ -102,7 +102,7 @@ class Preprocessor : public RefCountedBase<Preprocessor> {
 
   /// An optional PTHManager object used for getting tokens from
   /// a token cache rather than lexing the original source file.
-  OwningPtr<PTHManager> PTH;
+  std::unique_ptr<PTHManager> PTH;
 
   /// A BumpPtrAllocator object used to quickly allocate and release
   /// objects internal to the Preprocessor.
@@ -254,13 +254,13 @@ class Preprocessor : public RefCountedBase<Preprocessor> {
   /// not expanding a macro and we are lexing directly from source code.
   ///
   /// Only one of CurLexer, CurPTHLexer, or CurTokenLexer will be non-null.
-  OwningPtr<Lexer> CurLexer;
+  std::unique_ptr<Lexer> CurLexer;
 
   /// \brief The current top of stack that we're lexing from if
   /// not expanding from a macro and we are lexing from a PTH cache.
   ///
   /// Only one of CurLexer, CurPTHLexer, or CurTokenLexer will be non-null.
-  OwningPtr<PTHLexer> CurPTHLexer;
+  std::unique_ptr<PTHLexer> CurPTHLexer;
 
   /// \brief The current top of the stack what we're lexing from
   /// if not expanding a macro.
@@ -278,7 +278,7 @@ class Preprocessor : public RefCountedBase<Preprocessor> {
   /// \brief The current macro we are expanding, if we are expanding a macro.
   ///
   /// One of CurLexer and CurTokenLexer must be null.
-  OwningPtr<TokenLexer> CurTokenLexer;
+  std::unique_ptr<TokenLexer> CurTokenLexer;
 
   /// \brief The kind of lexer we're currently working with.
   enum CurLexerKind {
index 93fc611bdbdde29cd5a59618f68a4aced59ffb6b..0574f1835182c5905c36af64248830614595bd00 100644 (file)
@@ -139,23 +139,23 @@ class Parser : public CodeCompletionHandler {
   llvm::SmallDenseMap<const IdentifierInfo *, tok::TokenKind>
   ContextualKeywords;
 
-  OwningPtr<PragmaHandler> AlignHandler;
-  OwningPtr<PragmaHandler> GCCVisibilityHandler;
-  OwningPtr<PragmaHandler> OptionsHandler;
-  OwningPtr<PragmaHandler> PackHandler;
-  OwningPtr<PragmaHandler> MSStructHandler;
-  OwningPtr<PragmaHandler> UnusedHandler;
-  OwningPtr<PragmaHandler> WeakHandler;
-  OwningPtr<PragmaHandler> RedefineExtnameHandler;
-  OwningPtr<PragmaHandler> FPContractHandler;
-  OwningPtr<PragmaHandler> OpenCLExtensionHandler;
-  OwningPtr<PragmaHandler> OpenMPHandler;
-  OwningPtr<PragmaHandler> MSCommentHandler;
-  OwningPtr<PragmaHandler> MSDetectMismatchHandler;
-  OwningPtr<PragmaHandler> MSPointersToMembers;
-  OwningPtr<PragmaHandler> MSVtorDisp;
-
-  OwningPtr<CommentHandler> CommentSemaHandler;
+  std::unique_ptr<PragmaHandler> AlignHandler;
+  std::unique_ptr<PragmaHandler> GCCVisibilityHandler;
+  std::unique_ptr<PragmaHandler> OptionsHandler;
+  std::unique_ptr<PragmaHandler> PackHandler;
+  std::unique_ptr<PragmaHandler> MSStructHandler;
+  std::unique_ptr<PragmaHandler> UnusedHandler;
+  std::unique_ptr<PragmaHandler> WeakHandler;
+  std::unique_ptr<PragmaHandler> RedefineExtnameHandler;
+  std::unique_ptr<PragmaHandler> FPContractHandler;
+  std::unique_ptr<PragmaHandler> OpenCLExtensionHandler;
+  std::unique_ptr<PragmaHandler> OpenMPHandler;
+  std::unique_ptr<PragmaHandler> MSCommentHandler;
+  std::unique_ptr<PragmaHandler> MSDetectMismatchHandler;
+  std::unique_ptr<PragmaHandler> MSPointersToMembers;
+  std::unique_ptr<PragmaHandler> MSVtorDisp;
+
+  std::unique_ptr<CommentHandler> CommentSemaHandler;
 
   /// Whether the '>' token acts as an operator or not. This will be
   /// true except when we are parsing an expression within a C++
index ec0bb5ba082749c7f156a0f84cffff69dc7d3e2d..78fbd24db8c9953c150a882f429e08699bd2d3f4 100644 (file)
@@ -41,7 +41,7 @@ namespace clang {
 
     /// ScratchBuf - This is the buffer that we create scratch tokens from.
     ///
-    OwningPtr<ScratchBuffer> ScratchBuf;
+    std::unique_ptr<ScratchBuffer> ScratchBuf;
 
     TokenRewriter(const TokenRewriter &) LLVM_DELETED_FUNCTION;
     void operator=(const TokenRewriter &) LLVM_DELETED_FUNCTION;
index ea876d9980f63c746841a5b7a945f6c895cfb15f..70ff71f9906cf52c0e1f9761758ba43eb4662954 100644 (file)
@@ -28,8 +28,8 @@ protected:
 
 class FixItAction : public ASTFrontendAction {
 protected:
-  OwningPtr<FixItRewriter> Rewriter;
-  OwningPtr<FixItOptions> FixItOpts;
+  std::unique_ptr<FixItRewriter> Rewriter;
+  std::unique_ptr<FixItOptions> FixItOpts;
 
   virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
                                          StringRef InFile);
index ffbaa48cc9cb95895a9776d598ec05f58e6a7be8..49c2b6b0a00b5c450b183b5c37701b9b096ee4ad 100644 (file)
@@ -333,7 +333,7 @@ public:
   ExtVectorDeclsType ExtVectorDecls;
 
   /// FieldCollector - Collects CXXFieldDecls during parsing of C++ classes.
-  OwningPtr<CXXFieldCollector> FieldCollector;
+  std::unique_ptr<CXXFieldCollector> FieldCollector;
 
   typedef llvm::SmallSetVector<const NamedDecl*, 16> NamedDeclSetType;
 
@@ -345,7 +345,7 @@ public:
   /// PureVirtualClassDiagSet - a set of class declarations which we have
   /// emitted a list of pure virtual functions. Used to prevent emitting the
   /// same list more than once.
-  OwningPtr<RecordDeclSetTy> PureVirtualClassDiagSet;
+  std::unique_ptr<RecordDeclSetTy> PureVirtualClassDiagSet;
 
   /// ParsingInitForAutoVars - a set of declarations with auto types for which
   /// we are currently parsing the initializer.
@@ -597,7 +597,7 @@ public:
   RecordDecl *MSVCGuidDecl;
 
   /// \brief Caches identifiers/selectors for NSFoundation APIs.
-  OwningPtr<NSAPI> NSAPIObj;
+  std::unique_ptr<NSAPI> NSAPIObj;
 
   /// \brief The declaration of the Objective-C NSNumber class.
   ObjCInterfaceDecl *NSNumberDecl;
@@ -8026,7 +8026,7 @@ public:
 
 private:
   /// \brief A map from magic value to type information.
-  OwningPtr<llvm::DenseMap<TypeTagMagicValue, TypeTagData> >
+  std::unique_ptr<llvm::DenseMap<TypeTagMagicValue, TypeTagData>>
       TypeTagForDatatypeMagicValues;
 
   /// \brief Peform checks on a call of a function with argument_with_type_tag
index 1fb493084c7c0ab96f2d7e534de128c9cdc0f61b..4ab9999d7bf9ebc880e18262fdaf8864c3f04d25 100644 (file)
@@ -322,7 +322,7 @@ public:
 
 private:
   /// \brief The receiver of some callbacks invoked by ASTReader.
-  OwningPtr<ASTReaderListener> Listener;
+  std::unique_ptr<ASTReaderListener> Listener;
 
   /// \brief The receiver of deserialization events.
   ASTDeserializationListener *DeserializationListener;
@@ -352,7 +352,7 @@ private:
   SourceLocation CurrentImportLoc;
 
   /// \brief The global module index, if loaded.
-  llvm::OwningPtr<GlobalModuleIndex> GlobalIndex;
+  std::unique_ptr<GlobalModuleIndex> GlobalIndex;
 
   /// \brief A map of global bit offsets to the module that stores entities
   /// at those bit offsets.
index 76414ba634ccf79f9778e62c8025ce65785fd6dc..69ba38a119dd408f96cd85d09d59b6419b57aa20 100644 (file)
@@ -59,7 +59,7 @@ using serialization::ModuleFile;
 class GlobalModuleIndex {
   /// \brief Buffer containing the index file, which is lazily accessed so long
   /// as the global module index is live.
-  llvm::OwningPtr<llvm::MemoryBuffer> Buffer;
+  std::unique_ptr<llvm::MemoryBuffer> Buffer;
 
   /// \brief The hash table.
   ///
index ce4a7cb1c5b53f5bb6a64473d3f93c1e15be352f..09e6c0ea28908d0f82703bd86c2eebe3d4ffddc1 100644 (file)
@@ -151,7 +151,7 @@ public:
   
   /// \brief The memory buffer that stores the data associated with
   /// this AST file.
-  OwningPtr<llvm::MemoryBuffer> Buffer;
+  std::unique_ptr<llvm::MemoryBuffer> Buffer;
 
   /// \brief The size of this file, in bits.
   uint64_t SizeInBits;
index 0bbe1985e2e636ef1e2087844dad83fe925c2b70..6e41f38f54d52bf48626e9f5fe8ff439c45ebae8 100644 (file)
@@ -499,7 +499,7 @@ class PathDiagnosticEventPiece : public PathDiagnosticSpotPiece {
   /// supply a message that will be used to construct an extra hint on the
   /// returns from all the calls on the stack from this event to the final
   /// diagnostic.
-  OwningPtr<StackHintGenerator> CallStackHint;
+  std::unique_ptr<StackHintGenerator> CallStackHint;
 
 public:
   PathDiagnosticEventPiece(const PathDiagnosticLocation &pos,
index e38fd88c152257df6c2dcca47df416f9134a31f4..2e2f5f2e0bc790500f28786007ac06ab4bd2c9b2 100644 (file)
@@ -60,12 +60,12 @@ private:
   SubEngine& SubEng;
 
   /// G - The simulation graph.  Each node is a (location,state) pair.
-  OwningPtr<ExplodedGraph> G;
+  std::unique_ptr<ExplodedGraph> G;
 
   /// WList - A set of queued nodes that need to be processed by the
   ///  worklist algorithm.  It is up to the implementation of WList to decide
   ///  the order that nodes are processed.
-  OwningPtr<WorkList> WList;
+  std::unique_ptr<WorkList> WList;
 
   /// BCounterFactory - A factory object for created BlockCounter objects.
   ///   These are used to record for key nodes in the ExplodedGraph the
index f10a14c0c7f60710c4214fdd25b2ccb7931c320e..93c9259ea7a882c02834bd1a86ce6a595fe129b3 100644 (file)
@@ -441,8 +441,8 @@ private:
   SubEngine *Eng; /* Can be null. */
 
   EnvironmentManager                   EnvMgr;
-  OwningPtr<StoreManager>              StoreMgr;
-  OwningPtr<ConstraintManager>         ConstraintMgr;
+  std::unique_ptr<StoreManager>        StoreMgr;
+  std::unique_ptr<ConstraintManager>   ConstraintMgr;
 
   ProgramState::GenericDataMap::Factory     GDMFactory;
 
@@ -454,10 +454,10 @@ private:
   llvm::FoldingSet<ProgramState> StateSet;
 
   /// Object that manages the data for all created SVals.
-  OwningPtr<SValBuilder> svalBuilder;
+  std::unique_ptr<SValBuilder> svalBuilder;
 
   /// Manages memory for created CallEvents.
-  OwningPtr<CallEventManager> CallEventMgr;
+  std::unique_ptr<CallEventManager> CallEventMgr;
 
   /// A BumpPtrAllocator to allocate states.
   llvm::BumpPtrAllocator &Alloc;
index 666e1504786f4f369a4fe3d50f2925f867f39280..1f32cd82cfe5613b2b7facba16bad9621dd8fffc 100644 (file)
@@ -87,7 +87,7 @@ public:
   static const char *const HelpMessage;
 
 private:
-  OwningPtr<CompilationDatabase> Compilations;
+  std::unique_ptr<CompilationDatabase> Compilations;
   std::vector<std::string> SourcePathList;
 };
 
index 8cca3296f94d112233efc232776d2e14034b8685..e24175bd85a919605672f4e77c51762242107e3e 100644 (file)
@@ -166,7 +166,7 @@ public:
   /// The argument list is meant to be compatible with normal llvm command line
   /// parsing in main methods.
   /// int main(int argc, char **argv) {
-  ///   OwningPtr<FixedCompilationDatabase> Compilations(
+  ///   std::unique_ptr<FixedCompilationDatabase> Compilations(
   ///     FixedCompilationDatabase::loadFromCommandLine(argc, argv));
   ///   cl::ParseCommandLineOptions(argc, argv);
   ///   ...
index e531854cca49fbe9c6889b0c5a0e2ac42c60ec09..8e72dc9b24c718dd1765695c8f11ed3b538e0de7 100644 (file)
@@ -79,7 +79,7 @@ public:
                            raw_ostream &Error) const;
 private:
   FileMatchTrieNode *Root;
-  OwningPtr<PathComparator> Comparator;
+  std::unique_ptr<PathComparator> Comparator;
 };
 
 
index e3f149bebc86168e43e21e1031d2891d7aa95dc1..1ab91fc1eb34ef18a7570c35a26c3e5c1f544d1a 100644 (file)
@@ -104,7 +104,7 @@ private:
 
   FileMatchTrie MatchTrie;
 
-  OwningPtr<llvm::MemoryBuffer> Database;
+  std::unique_ptr<llvm::MemoryBuffer> Database;
   llvm::SourceMgr SM;
   llvm::yaml::Stream YAMLStream;
 };
index f8c477b5eda5059e429044348299b365fbbd5a3b..5cbd799572e1fb9123bebd434acba5b0cca9fe93 100644 (file)
@@ -167,7 +167,7 @@ static bool HasARCRuntime(CompilerInvocation &origCI) {
 
 static CompilerInvocation *
 createInvocationForMigration(CompilerInvocation &origCI) {
-  OwningPtr<CompilerInvocation> CInvok;
+  std::unique_ptr<CompilerInvocation> CInvok;
   CInvok.reset(new CompilerInvocation(origCI));
   PreprocessorOptions &PPOpts = CInvok->getPreprocessorOpts();
   if (!PPOpts.ImplicitPCHInclude.empty()) {
@@ -246,7 +246,7 @@ bool arcmt::checkForManualIssues(CompilerInvocation &origCI,
                                                                      NoFinalizeRemoval);
   assert(!transforms.empty());
 
-  OwningPtr<CompilerInvocation> CInvok;
+  std::unique_ptr<CompilerInvocation> CInvok;
   CInvok.reset(createInvocationForMigration(origCI));
   CInvok->getFrontendOpts().Inputs.clear();
   CInvok->getFrontendOpts().Inputs.push_back(Input);
@@ -263,7 +263,7 @@ bool arcmt::checkForManualIssues(CompilerInvocation &origCI,
   CaptureDiagnosticConsumer errRec(*Diags, *DiagClient, capturedDiags);
   Diags->setClient(&errRec, /*ShouldOwnClient=*/false);
 
-  OwningPtr<ASTUnit> Unit(
+  std::unique_ptr<ASTUnit> Unit(
       ASTUnit::LoadFromCompilerInvocationAction(CInvok.release(), Diags));
   if (!Unit) {
     errRec.FinishCapture();
@@ -515,7 +515,7 @@ MigrationProcess::MigrationProcess(const CompilerInvocation &CI,
 
 bool MigrationProcess::applyTransform(TransformFn trans,
                                       RewriteListener *listener) {
-  OwningPtr<CompilerInvocation> CInvok;
+  std::unique_ptr<CompilerInvocation> CInvok;
   CInvok.reset(createInvocationForMigration(OrigCI));
   CInvok->getDiagnosticOpts().IgnoreWarnings = true;
 
@@ -534,7 +534,7 @@ bool MigrationProcess::applyTransform(TransformFn trans,
   CaptureDiagnosticConsumer errRec(*Diags, *DiagClient, capturedDiags);
   Diags->setClient(&errRec, /*ShouldOwnClient=*/false);
 
-  OwningPtr<ARCMTMacroTrackerAction> ASTAction;
+  std::unique_ptr<ARCMTMacroTrackerAction> ASTAction;
   ASTAction.reset(new ARCMTMacroTrackerAction(ARCMTMacroLocs));
 
   OwningPtr<ASTUnit> Unit(ASTUnit::LoadFromCompilerInvocationAction(
index a6c019bcae3127bd3cda97decbee7bd11889fd19..e1cebc71a066b807f280064dce87f5ae95f67ade 100644 (file)
@@ -64,8 +64,8 @@ bool FileRemapper::initFromFile(StringRef filePath, DiagnosticsEngine &Diag,
     return false;
 
   std::vector<std::pair<const FileEntry *, const FileEntry *> > pairs;
-  
-  OwningPtr<llvm::MemoryBuffer> fileBuf;
+
+  std::unique_ptr<llvm::MemoryBuffer> fileBuf;
   if (llvm::MemoryBuffer::getFile(infoFile.c_str(), fileBuf))
     return report("Error opening file: " + infoFile, Diag);
   
index d8d84194c5479a8f63515909fff85200434c306f..307f9109454c3c0922570f0ecb6e8524af30b71c 100644 (file)
@@ -88,8 +88,8 @@ public:
   FileID FileId;
   const TypedefDecl *NSIntegerTypedefed;
   const TypedefDecl *NSUIntegerTypedefed;
-  OwningPtr<NSAPI> NSAPIObj;
-  OwningPtr<edit::EditedSource> Editor;
+  std::unique_ptr<NSAPI> NSAPIObj;
+  std::unique_ptr<edit::EditedSource> Editor;
   FileRemapper &Remapper;
   FileManager &FileMgr;
   const PPConditionalDirectiveRecord *PPRec;
@@ -253,7 +253,7 @@ public:
 
 class BodyMigrator : public RecursiveASTVisitor<BodyMigrator> {
   ObjCMigrateASTConsumer &Consumer;
-  OwningPtr<ParentMap> PMap;
+  std::unique_ptr<ParentMap> PMap;
 
 public:
   BodyMigrator(ObjCMigrateASTConsumer &consumer) : Consumer(consumer) { }
@@ -1988,7 +1988,7 @@ public:
   bool parse(StringRef File, SmallVectorImpl<EditEntry> &Entries) {
     using namespace llvm::yaml;
 
-    OwningPtr<llvm::MemoryBuffer> FileBuf;
+    std::unique_ptr<llvm::MemoryBuffer> FileBuf;
     if (llvm::MemoryBuffer::getFile(File, FileBuf))
       return true;
 
index 61e2e98513425e6c7a5133cfd7138cd387c5e1fe..5db5fa084d8c7b1d18232656e61c2b5d17ecc506 100644 (file)
@@ -38,7 +38,7 @@ class RetainReleaseDeallocRemover :
   MigrationPass &Pass;
 
   ExprSet Removables;
-  OwningPtr<ParentMap> StmtMap;
+  std::unique_ptr<ParentMap> StmtMap;
 
   Selector DelegateSel, FinalizeSel;
 
index 8c621280ab7c97e5a79ac9053644cb1d4154e92f..0aa0c89f39fbf964097713fc226cfe02f77316aa 100644 (file)
@@ -60,10 +60,10 @@ namespace {
 class UnbridgedCastRewriter : public RecursiveASTVisitor<UnbridgedCastRewriter>{
   MigrationPass &Pass;
   IdentifierInfo *SelfII;
-  OwningPtr<ParentMap> StmtMap;
+  std::unique_ptr<ParentMap> StmtMap;
   Decl *ParentD;
   Stmt *Body;
-  mutable OwningPtr<ExprSet> Removables;
+  mutable std::unique_ptr<ExprSet> Removables;
 
 public:
   UnbridgedCastRewriter(MigrationPass &pass) : Pass(pass), ParentD(0), Body(0) {
index 4492d02b7a7934751ea5c9c3efd39ceb3ee7496d..0b8948e5fa4d4aa88042a3d41423b76d2bb5d0fa 100644 (file)
@@ -453,7 +453,7 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) {
 
   if (IT == PredefinedExpr::FuncDName) {
     if (const NamedDecl *ND = dyn_cast<NamedDecl>(CurrentDecl)) {
-      OwningPtr<MangleContext> MC;
+      std::unique_ptr<MangleContext> MC;
       MC.reset(Context.createMangleContext());
 
       if (MC->shouldMangleDeclName(ND)) {
index da953b779b6dd44d8e3cb11e4410ac25f0b610b5..f8c8fe4c0a7254c3074b164b61bfa5a783331c7e 100644 (file)
@@ -291,7 +291,7 @@ class CFGBuilder {
   typedef BlockScopePosPair JumpSource;
 
   ASTContext *Context;
-  OwningPtr<CFG> cfg;
+  std::unique_ptr<CFG> cfg;
 
   CFGBlock *Block;
   CFGBlock *Succ;
index 23fc437dfa581aeb345083bf50f3c03ecf3f3377..ce85796ab411396db996dee94f2c9eddb22cdf0c 100644 (file)
@@ -1286,8 +1286,9 @@ void ConsumedAnalyzer::determineExpectedReturnState(AnalysisDeclContext &AC,
 
 bool ConsumedAnalyzer::splitState(const CFGBlock *CurrBlock,
                                   const ConsumedStmtVisitor &Visitor) {
-  
-  OwningPtr<ConsumedStateMap> FalseStates(new ConsumedStateMap(*CurrStates));
+
+  std::unique_ptr<ConsumedStateMap> FalseStates(
+      new ConsumedStateMap(*CurrStates));
   PropagationInfo PInfo;
   
   if (const IfStmt *IfNode =
index 4431e45962b5b7b3dc3af45cc0a3a638ca373e3b..579c8185b3d193c9de4a451415f254eb9d11e896 100644 (file)
@@ -379,7 +379,7 @@ void FileManager::FixupRelativePath(SmallVectorImpl<char> &path) const {
 llvm::MemoryBuffer *FileManager::
 getBufferForFile(const FileEntry *Entry, std::string *ErrorStr,
                  bool isVolatile) {
-  OwningPtr<llvm::MemoryBuffer> Result;
+  std::unique_ptr<llvm::MemoryBuffer> Result;
   llvm::error_code ec;
 
   uint64_t FileSize = Entry->getSize();
@@ -417,7 +417,7 @@ getBufferForFile(const FileEntry *Entry, std::string *ErrorStr,
 
 llvm::MemoryBuffer *FileManager::
 getBufferForFile(StringRef Filename, std::string *ErrorStr) {
-  OwningPtr<llvm::MemoryBuffer> Result;
+  std::unique_ptr<llvm::MemoryBuffer> Result;
   llvm::error_code ec;
   if (FileSystemOpts.WorkingDir.empty()) {
     ec = FS->getBufferForFile(Filename, Result);
index dfab9299c093f5df4afa5e46e8fc1b3f58ebd807..9d87999509eed8eac188f44473edcc03645ff3d5 100644 (file)
@@ -77,7 +77,7 @@ bool FileSystemStatCache::get(const char *Path, FileData &Data, bool isFile,
     //
     // Because of this, check to see if the file exists with 'open'.  If the
     // open succeeds, use fstat to get the stat info.
-    llvm::OwningPtr<vfs::File> OwnedFile;
+    std::unique_ptr<vfs::File> OwnedFile;
     llvm::error_code EC = FS.openFileForRead(Path, OwnedFile);
 
     if (EC) {
index a839b6a9389c12938ea022c9a8ff6403cbe97f25..0d1e388c8dc1f6c6b61d22dca10c56d4ef9f4fe2 100644 (file)
@@ -5965,7 +5965,7 @@ TargetInfo *TargetInfo::CreateTargetInfo(DiagnosticsEngine &Diags,
   llvm::Triple Triple(Opts->Triple);
 
   // Construct the target
-  OwningPtr<TargetInfo> Target(AllocateTarget(Triple));
+  std::unique_ptr<TargetInfo> Target(AllocateTarget(Triple));
   if (!Target) {
     Diags.Report(diag::err_target_unknown_triple) << Triple.str();
     return 0;
index 3775fda4920b8d4c4b4e88c028f10f7a662d8f2b..1ff21e1552055e15744d3b653594b222c454b3e8 100644 (file)
@@ -65,10 +65,10 @@ File::~File() {}
 FileSystem::~FileSystem() {}
 
 error_code FileSystem::getBufferForFile(const llvm::Twine &Name,
-                                        OwningPtr<MemoryBuffer> &Result,
+                                        std::unique_ptr<MemoryBuffer> &Result,
                                         int64_t FileSize,
                                         bool RequiresNullTerminator) {
-  llvm::OwningPtr<File> F;
+  std::unique_ptr<File> F;
   if (error_code EC = openFileForRead(Name, F))
     return EC;
 
@@ -93,7 +93,7 @@ class RealFile : public File {
 public:
   ~RealFile();
   ErrorOr<Status> status() override;
-  error_code getBuffer(const Twine &Name, OwningPtr<MemoryBuffer> &Result,
+  error_code getBuffer(const Twine &Name, std::unique_ptr<MemoryBuffer> &Result,
                        int64_t FileSize = -1,
                        bool RequiresNullTerminator = true) override;
   error_code close() override;
@@ -116,7 +116,7 @@ ErrorOr<Status> RealFile::status() {
 }
 
 error_code RealFile::getBuffer(const Twine &Name,
-                               OwningPtr<MemoryBuffer> &Result,
+                               std::unique_ptr<MemoryBuffer> &Result,
                                int64_t FileSize, bool RequiresNullTerminator) {
   assert(FD != -1 && "cannot get buffer for closed file");
   return MemoryBuffer::getOpenFile(FD, Name.str().c_str(), Result, FileSize,
@@ -150,7 +150,7 @@ class RealFileSystem : public FileSystem {
 public:
   ErrorOr<Status> status(const Twine &Path) override;
   error_code openFileForRead(const Twine &Path,
-                             OwningPtr<File> &Result) override;
+                             std::unique_ptr<File> &Result) override;
 };
 } // end anonymous namespace
 
@@ -164,7 +164,7 @@ ErrorOr<Status> RealFileSystem::status(const Twine &Path) {
 }
 
 error_code RealFileSystem::openFileForRead(const Twine &Name,
-                                           OwningPtr<File> &Result) {
+                                           std::unique_ptr<File> &Result) {
   int FD;
   if (error_code EC = sys::fs::openFileForRead(Name, FD))
     return EC;
@@ -200,7 +200,7 @@ ErrorOr<Status> OverlayFileSystem::status(const Twine &Path) {
 }
 
 error_code OverlayFileSystem::openFileForRead(const llvm::Twine &Path,
-                                              OwningPtr<File> &Result) {
+                                              std::unique_ptr<File> &Result) {
   // FIXME: handle symlinks that cross file systems
   for (iterator I = overlays_begin(), E = overlays_end(); I != E; ++I) {
     error_code EC = (*I)->openFileForRead(Path, Result);
@@ -389,7 +389,7 @@ public:
 
   ErrorOr<Status> status(const Twine &Path) override;
   error_code openFileForRead(const Twine &Path,
-                             OwningPtr<File> &Result) override;
+                             std::unique_ptr<File> &Result) override;
 };
 
 /// \brief A helper class to hold the common YAML parsing state.
@@ -727,7 +727,7 @@ VFSFromYAML *VFSFromYAML::create(MemoryBuffer *Buffer,
 
   VFSFromYAMLParser P(Stream);
 
-  OwningPtr<VFSFromYAML> FS(new VFSFromYAML(ExternalFS));
+  std::unique_ptr<VFSFromYAML> FS(new VFSFromYAML(ExternalFS));
   if (!P.parse(Root, FS.get()))
     return NULL;
 
@@ -810,7 +810,7 @@ ErrorOr<Status> VFSFromYAML::status(const Twine &Path) {
 }
 
 error_code VFSFromYAML::openFileForRead(const Twine &Path,
-                                        OwningPtr<vfs::File> &Result) {
+                                        std::unique_ptr<vfs::File> &Result) {
   ErrorOr<Entry *> E = lookupPath(Path);
   if (!E)
     return E.getError();
index dbc62b79de2162cee2d765e1ef2154e149677c6a..73b7db7fb93f2785c862d2376f19e245ba7cbcb8 100644 (file)
@@ -122,7 +122,7 @@ public:
       BuryPointer(TM.release());
   }
 
-  llvm::OwningPtr<TargetMachine> TM;
+  std::unique_ptr<TargetMachine> TM;
 
   void EmitAssembly(BackendAction Action, raw_ostream *OS);
 };
index 86afa324895c6ee49d53a33290e1ab702507dca3..7f2533d1ffedbe81f41dfc4f42a26ea370a2035b 100644 (file)
@@ -679,7 +679,7 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const BlockExpr *blockExpr) {
   }
 
   // Find the block info for this block and take ownership of it.
-  OwningPtr<CGBlockInfo> blockInfo;
+  std::unique_ptr<CGBlockInfo> blockInfo;
   blockInfo.reset(findAndRemoveBlockInfo(&FirstBlockInfo,
                                          blockExpr->getBlockDecl()));
 
index 1112739cc186ff59808f097c25fd7d028701f23f..73ad93f6524b1016f61bb1a53cbf78fe0419df39 100644 (file)
@@ -41,7 +41,7 @@ namespace CodeGen {
 class CGCXXABI {
 protected:
   CodeGenModule &CGM;
-  OwningPtr<MangleContext> MangleCtx;
+  std::unique_ptr<MangleContext> MangleCtx;
 
   CGCXXABI(CodeGenModule &CGM)
     : CGM(CGM), MangleCtx(CGM.getContext().createMangleContext()) {}
index 4a381a8d4856215746519b973a7947404a9edd73..0ad765ce22b82b7845c661bffe5455408bb32a79 100644 (file)
@@ -554,7 +554,7 @@ CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD,
   if (CGDebugInfo *DI = CGM.getModuleDebugInfo())
     DI->completeClassData(Base.getBase());
 
-  OwningPtr<VTableLayout> VTLayout(
+  std::unique_ptr<VTableLayout> VTLayout(
       getItaniumVTableContext().createConstructionVTableLayout(
           Base.getBase(), Base.getBaseOffset(), BaseIsVirtual, RD));
 
index 280d7646be3bea950dfc2604206621ae25e2f61b..24961abc726f83047d3a1cd8a8e37aa417e197ca 100644 (file)
@@ -47,9 +47,9 @@ namespace clang {
 
     Timer LLVMIRGeneration;
 
-    OwningPtr<CodeGenerator> Gen;
+    std::unique_ptr<CodeGenerator> Gen;
 
-    OwningPtr<llvm::Module> TheModule, LinkModule;
+    std::unique_ptr<llvm::Module> TheModule, LinkModule;
 
   public:
     BackendConsumer(BackendAction action, DiagnosticsEngine &_Diags,
@@ -465,7 +465,7 @@ static raw_ostream *GetOutputStream(CompilerInstance &CI,
 ASTConsumer *CodeGenAction::CreateASTConsumer(CompilerInstance &CI,
                                               StringRef InFile) {
   BackendAction BA = static_cast<BackendAction>(Act);
-  OwningPtr<raw_ostream> OS(GetOutputStream(CI, InFile, BA));
+  std::unique_ptr<raw_ostream> OS(GetOutputStream(CI, InFile, BA));
   if (BA != Backend_EmitNothing && !OS)
     return 0;
 
index 11272fc2cae5eb66afefae8bae78010f7324288c..4bd8b7a3de7e454f198d95005b08feb5746c0ad1 100644 (file)
@@ -235,7 +235,7 @@ class CodeGenModule : public CodeGenTypeCache {
   DiagnosticsEngine &Diags;
   const llvm::DataLayout &TheDataLayout;
   const TargetInfo &Target;
-  llvm::OwningPtr<CGCXXABI> ABI;
+  std::unique_ptr<CGCXXABI> ABI;
   llvm::LLVMContext &VMContext;
 
   CodeGenTBAA *TBAA;
@@ -430,7 +430,7 @@ class CodeGenModule : public CodeGenTypeCache {
 
   GlobalDecl initializedGlobalDecl;
 
-  llvm::OwningPtr<llvm::SpecialCaseList> SanitizerBlacklist;
+  std::unique_ptr<llvm::SpecialCaseList> SanitizerBlacklist;
 
   const SanitizerOptions &SanOpts;
 
index 0fc570ad9cda4e9d8873126b16d10c18cb7780dc..f556b13dadc4f8313f9a0c26a2ca74f0df2d77e1 100644 (file)
@@ -30,7 +30,7 @@ class RegionCounter;
 class PGOProfileData {
 private:
   /// The PGO data
-  llvm::OwningPtr<llvm::MemoryBuffer> DataBuffer;
+  std::unique_ptr<llvm::MemoryBuffer> DataBuffer;
   /// Offsets into DataBuffer for each function's counters
   llvm::StringMap<unsigned> DataOffsets;
   /// Execution counts for each function.
index d54a4a8186f082e367a1a3cf4990e35492cc9e65..22914c37755a1ef3cd7ed1692e1809014f3cb061 100644 (file)
@@ -30,12 +30,13 @@ using namespace clang;
 namespace {
   class CodeGeneratorImpl : public CodeGenerator {
     DiagnosticsEngine &Diags;
-    OwningPtr<const llvm::DataLayout> TD;
+    std::unique_ptr<const llvm::DataLayout> TD;
     ASTContext *Ctx;
     const CodeGenOptions CodeGenOpts;  // Intentionally copied in.
   protected:
-    OwningPtr<llvm::Module> M;
-    OwningPtr<CodeGen::CodeGenModule> Builder;
+    std::unique_ptr<llvm::Module> M;
+    std::unique_ptr<CodeGen::CodeGenModule> Builder;
+
   public:
     CodeGeneratorImpl(DiagnosticsEngine &diags, const std::string& ModuleName,
                       const CodeGenOptions &CGO, llvm::LLVMContext& C)
index bfe332b90249f0de72210c84917b3d11fa71165e..4dc25e8972acded26f01d7fd52b1f81b76cd0a62 100644 (file)
@@ -1203,7 +1203,7 @@ void Driver::BuildActions(const ToolChain &TC, DerivedArgList &Args,
     }
 
     // Build the pipeline for this file.
-    OwningPtr<Action> Current(new InputAction(*InputArg, InputType));
+    std::unique_ptr<Action> Current(new InputAction(*InputArg, InputType));
     for (SmallVectorImpl<phases::ID>::iterator
            i = PL.begin(), e = PL.end(); i != e; ++i) {
       phases::ID Phase = *i;
index f2ac7b163f90e05181fe5fd04e483f68d2588001..53b8e9cb740b3b8c26437e4a1c1b7a4dfc26bc5f 100644 (file)
@@ -143,7 +143,7 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
       if (llvm::sys::fs::exists(BLPath)) {
         // Validate the blacklist format.
         std::string BLError;
-        llvm::OwningPtr<llvm::SpecialCaseList> SCL(
+        std::unique_ptr<llvm::SpecialCaseList> SCL(
             llvm::SpecialCaseList::create(BLPath, BLError));
         if (!SCL.get())
           D.Diag(diag::err_drv_malformed_sanitizer_blacklist) << BLError;
index 9232a5d4b0c9cb24568d58d685eaab597876c3d6..d597da8ecb3ed59770f25f3538d2cd4a682961ca 100644 (file)
@@ -2682,7 +2682,7 @@ static bool IsUbuntu(enum Distro Distro) {
 }
 
 static Distro DetectDistro(llvm::Triple::ArchType Arch) {
-  OwningPtr<llvm::MemoryBuffer> File;
+  std::unique_ptr<llvm::MemoryBuffer> File;
   if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) {
     StringRef Data = File.get()->getBuffer();
     SmallVector<StringRef, 8> Lines;
index 86cd136f6545b53db9bebc3d566c5eebe660c1eb..cba764e0bf493bff5efc51c44a2b19bb73422758 100644 (file)
@@ -186,8 +186,8 @@ protected:
   /// @}
 
 private:
-  mutable OwningPtr<tools::gcc::Preprocess> Preprocess;
-  mutable OwningPtr<tools::gcc::Compile> Compile;
+  mutable std::unique_ptr<tools::gcc::Preprocess> Preprocess;
+  mutable std::unique_ptr<tools::gcc::Compile> Compile;
 };
 
 class LLVM_LIBRARY_VISIBILITY MachO : public ToolChain {
@@ -196,9 +196,9 @@ protected:
   virtual Tool *buildLinker() const;
   virtual Tool *getTool(Action::ActionClass AC) const;
 private:
-  mutable OwningPtr<tools::darwin::Lipo> Lipo;
-  mutable OwningPtr<tools::darwin::Dsymutil> Dsymutil;
-  mutable OwningPtr<tools::darwin::VerifyDebug> VerifyDebug;
+  mutable std::unique_ptr<tools::darwin::Lipo> Lipo;
+  mutable std::unique_ptr<tools::darwin::Dsymutil> Dsymutil;
+  mutable std::unique_ptr<tools::darwin::VerifyDebug> VerifyDebug;
 
 public:
   MachO(const Driver &D, const llvm::Triple &Triple,
index b82726a6b83e09807ecacce2fe5e075b1492c67e..ed5ce4a21e868b43e4d8ba368a379dd4ef0b5f0c 100644 (file)
@@ -791,7 +791,7 @@ unsigned ContinuationIndenter::breakProtrudingToken(const FormatToken &Current,
   if (!Current.isStringLiteral() && !Current.is(tok::comment))
     return 0;
 
-  llvm::OwningPtr<BreakableToken> Token;
+  std::unique_ptr<BreakableToken> Token;
   unsigned StartColumn = State.Column - Current.ColumnWidth;
   unsigned ColumnLimit = getColumnLimit(State);
 
index 79bf1012521e52e5f5f81543c18f9d2dd23944ef..18ee6cb83967db15d2da8d9ae0b9c09ae14a7222 100644 (file)
@@ -1790,7 +1790,7 @@ FormatStyle getStyle(StringRef StyleName, StringRef FileName,
     }
 
     if (IsFile) {
-      OwningPtr<llvm::MemoryBuffer> Text;
+      std::unique_ptr<llvm::MemoryBuffer> Text;
       if (llvm::error_code ec =
               llvm::MemoryBuffer::getFile(ConfigFile.c_str(), Text)) {
         llvm::errs() << ec.message() << "\n";
index a4947dd8059bf8c04ed7429f4c7ff23fbcf1d873..a6849b7c11ef304f5e8ce431d3bb0c667f3d9644 100644 (file)
@@ -187,7 +187,7 @@ struct FormatToken {
 
   /// \brief A token can have a special role that can carry extra information
   /// about the token's formatting.
-  llvm::OwningPtr<TokenRole> Role;
+  std::unique_ptr<TokenRole> Role;
 
   /// \brief If this is an opening parenthesis, how are the parameters packed?
   ParameterPackingKind PackingKind;
index ce48de2d4f5c7233bedc27d8fe7c210d337d971e..62e0b58ea13b0316691054316a409c5307bf3987 100644 (file)
@@ -112,7 +112,7 @@ private:
   // FIXME: We are constantly running into bugs where Line.Level is incorrectly
   // subtracted from beyond 0. Introduce a method to subtract from Line.Level
   // and use that everywhere in the Parser.
-  OwningPtr<UnwrappedLine> Line;
+  std::unique_ptr<UnwrappedLine> Line;
 
   // Comments are sorted into unwrapped lines by whether they are in the same
   // line as the previous token, or not. If not, they belong to the next token.
index a3ebd41a586c8c8b6356675ce1e55bacc45aaefe..570ff9ccfb550852f0a29ad1e1b33bae711af53e 100644 (file)
@@ -677,7 +677,7 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename,
                                   bool CaptureDiagnostics,
                                   bool AllowPCHWithCompilerErrors,
                                   bool UserFilesAreVolatile) {
-  OwningPtr<ASTUnit> AST(new ASTUnit(true));
+  std::unique_ptr<ASTUnit> AST(new ASTUnit(true));
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit>
@@ -1055,7 +1055,7 @@ bool ASTUnit::Parse(llvm::MemoryBuffer *OverrideMainBuffer) {
   }
   
   // Create the compiler instance to use for building the AST.
-  OwningPtr<CompilerInstance> Clang(new CompilerInstance());
+  std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance>
@@ -1141,10 +1141,10 @@ bool ASTUnit::Parse(llvm::MemoryBuffer *OverrideMainBuffer) {
     // Keep track of the override buffer;
     SavedMainFileBuffer = OverrideMainBuffer;
   }
-  
-  OwningPtr<TopLevelDeclTrackerAction> Act(
-    new TopLevelDeclTrackerAction(*this));
-    
+
+  std::unique_ptr<TopLevelDeclTrackerAction> Act(
+      new TopLevelDeclTrackerAction(*this));
+
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<TopLevelDeclTrackerAction>
     ActCleanup(Act.get());
@@ -1406,7 +1406,7 @@ llvm::MemoryBuffer *ASTUnit::getMainBufferWithPrecompiledPreamble(
     = ComputePreamble(*PreambleInvocation, MaxLines, CreatedPreambleBuffer);
 
   // If ComputePreamble() Take ownership of the preamble buffer.
-  OwningPtr<llvm::MemoryBuffer> OwnedPreambleBuffer;
+  std::unique_ptr<llvm::MemoryBuffer> OwnedPreambleBuffer;
   if (CreatedPreambleBuffer)
     OwnedPreambleBuffer.reset(NewPreamble.first);
 
@@ -1587,7 +1587,7 @@ llvm::MemoryBuffer *ASTUnit::getMainBufferWithPrecompiledPreamble(
   PreprocessorOpts.PrecompiledPreambleBytes.second = false;
   
   // Create the compiler instance to use for building the precompiled preamble.
-  OwningPtr<CompilerInstance> Clang(new CompilerInstance());
+  std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance>
@@ -1638,8 +1638,8 @@ llvm::MemoryBuffer *ASTUnit::getMainBufferWithPrecompiledPreamble(
   // Create the source manager.
   Clang->setSourceManager(new SourceManager(getDiagnostics(),
                                             Clang->getFileManager()));
-  
-  OwningPtr<PrecompilePreambleAction> Act;
+
+  std::unique_ptr<PrecompilePreambleAction> Act;
   Act.reset(new PrecompilePreambleAction(*this));
   if (!Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0])) {
     llvm::sys::fs::remove(FrontendOpts.OutputFile);
@@ -1786,7 +1786,7 @@ ASTUnit *ASTUnit::create(CompilerInvocation *CI,
                          IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
                          bool CaptureDiagnostics,
                          bool UserFilesAreVolatile) {
-  OwningPtr<ASTUnit> AST;
+  std::unique_ptr<ASTUnit> AST;
   AST.reset(new ASTUnit(false));
   ConfigureDiags(Diags, 0, 0, *AST, CaptureDiagnostics);
   AST->Diagnostics = Diags;
@@ -1800,22 +1800,16 @@ ASTUnit *ASTUnit::create(CompilerInvocation *CI,
   return AST.release();
 }
 
-ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(CompilerInvocation *CI,
-                              IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
-                                             ASTFrontendAction *Action,
-                                             ASTUnit *Unit,
-                                             bool Persistent,
-                                             StringRef ResourceFilesPath,
-                                             bool OnlyLocalDecls,
-                                             bool CaptureDiagnostics,
-                                             bool PrecompilePreamble,
-                                             bool CacheCodeCompletionResults,
-                                    bool IncludeBriefCommentsInCodeCompletion,
-                                             bool UserFilesAreVolatile,
-                                             OwningPtr<ASTUnit> *ErrAST) {
+ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(
+    CompilerInvocation *CI, IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
+    ASTFrontendAction *Action, ASTUnit *Unit, bool Persistent,
+    StringRef ResourceFilesPath, bool OnlyLocalDecls, bool CaptureDiagnostics,
+    bool PrecompilePreamble, bool CacheCodeCompletionResults,
+    bool IncludeBriefCommentsInCodeCompletion, bool UserFilesAreVolatile,
+    std::unique_ptr<ASTUnit> *ErrAST) {
   assert(CI && "A CompilerInvocation is required");
 
-  OwningPtr<ASTUnit> OwnAST;
+  std::unique_ptr<ASTUnit> OwnAST;
   ASTUnit *AST = Unit;
   if (!AST) {
     // Create the AST unit.
@@ -1849,7 +1843,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(CompilerInvocation *CI,
   ProcessWarningOptions(AST->getDiagnostics(), CI->getDiagnosticOpts());
 
   // Create the compiler instance to use for building the AST.
-  OwningPtr<CompilerInstance> Clang(new CompilerInstance());
+  std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance>
@@ -1895,7 +1889,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(CompilerInvocation *CI,
 
   ASTFrontendAction *Act = Action;
 
-  OwningPtr<TopLevelDeclTrackerAction> TrackerAct;
+  std::unique_ptr<TopLevelDeclTrackerAction> TrackerAct;
   if (!Act) {
     TrackerAct.reset(new TopLevelDeclTrackerAction(*AST));
     Act = TrackerAct.get();
@@ -1978,7 +1972,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI,
                                     bool IncludeBriefCommentsInCodeCompletion,
                                              bool UserFilesAreVolatile) {
   // Create the AST unit.
-  OwningPtr<ASTUnit> AST;
+  std::unique_ptr<ASTUnit> AST;
   AST.reset(new ASTUnit(false));
   ConfigureDiags(Diags, 0, 0, *AST, CaptureDiagnostics);
   AST->Diagnostics = Diags;
@@ -2004,23 +1998,16 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI,
                                                              : AST.release();
 }
 
-ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
-                                      const char **ArgEnd,
-                                    IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
-                                      StringRef ResourceFilesPath,
-                                      bool OnlyLocalDecls,
-                                      bool CaptureDiagnostics,
-                                      ArrayRef<RemappedFile> RemappedFiles,
-                                      bool RemappedFilesKeepOriginalName,
-                                      bool PrecompilePreamble,
-                                      TranslationUnitKind TUKind,
-                                      bool CacheCodeCompletionResults,
-                                      bool IncludeBriefCommentsInCodeCompletion,
-                                      bool AllowPCHWithCompilerErrors,
-                                      bool SkipFunctionBodies,
-                                      bool UserFilesAreVolatile,
-                                      bool ForSerialization,
-                                      OwningPtr<ASTUnit> *ErrAST) {
+ASTUnit *ASTUnit::LoadFromCommandLine(
+    const char **ArgBegin, const char **ArgEnd,
+    IntrusiveRefCntPtr<DiagnosticsEngine> Diags, StringRef ResourceFilesPath,
+    bool OnlyLocalDecls, bool CaptureDiagnostics,
+    ArrayRef<RemappedFile> RemappedFiles, bool RemappedFilesKeepOriginalName,
+    bool PrecompilePreamble, TranslationUnitKind TUKind,
+    bool CacheCodeCompletionResults, bool IncludeBriefCommentsInCodeCompletion,
+    bool AllowPCHWithCompilerErrors, bool SkipFunctionBodies,
+    bool UserFilesAreVolatile, bool ForSerialization,
+    std::unique_ptr<ASTUnit> *ErrAST) {
   if (!Diags.getPtr()) {
     // No diagnostics engine was provided, so create our own diagnostics object
     // with the default options.
@@ -2058,7 +2045,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
   CI->getFrontendOpts().SkipFunctionBodies = SkipFunctionBodies;
 
   // Create the AST unit.
-  OwningPtr<ASTUnit> AST;
+  std::unique_ptr<ASTUnit> AST;
   AST.reset(new ASTUnit(false));
   ConfigureDiags(Diags, ArgBegin, ArgEnd, *AST, CaptureDiagnostics);
   AST->Diagnostics = Diags;
@@ -2427,7 +2414,7 @@ void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column,
   // Set the language options appropriately.
   LangOpts = *CCInvocation->getLangOpts();
 
-  OwningPtr<CompilerInstance> Clang(new CompilerInstance());
+  std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance>
@@ -2524,8 +2511,8 @@ void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column,
   // Disable the preprocessing record if modules are not enabled.
   if (!Clang->getLangOpts().Modules)
     PreprocessorOpts.DetailedRecord = false;
-  
-  OwningPtr<SyntaxOnlyAction> Act;
+
+  std::unique_ptr<SyntaxOnlyAction> Act;
   Act.reset(new SyntaxOnlyAction);
   if (Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0])) {
     Act->Execute();
index 04753ee0c03004185d8b775ee3aa8e6e3f1a13dc..674116034b5b5c74e10bbefe30a437865bdc89f3 100644 (file)
@@ -31,7 +31,7 @@ static ASTReader *createASTReader(CompilerInstance &CI,
                              SmallVectorImpl<std::string> &bufNames,
                              ASTDeserializationListener *deserialListener = 0) {
   Preprocessor &PP = CI.getPreprocessor();
-  OwningPtr<ASTReader> Reader;
+  std::unique_ptr<ASTReader> Reader;
   Reader.reset(new ASTReader(PP, CI.getASTContext(), /*isysroot=*/"",
                              /*DisableValidation=*/true));
   for (unsigned ti = 0; ti < bufNames.size(); ++ti) {
@@ -76,7 +76,7 @@ ChainedIncludesSource::create(CompilerInstance &CI) {
 
   for (unsigned i = 0, e = includes.size(); i != e; ++i) {
     bool firstInclude = (i == 0);
-    OwningPtr<CompilerInvocation> CInvok;
+    std::unique_ptr<CompilerInvocation> CInvok;
     CInvok.reset(new CompilerInvocation(CI.getInvocation()));
     
     CInvok->getPreprocessorOpts().ChainedIncludes.clear();
@@ -97,7 +97,7 @@ ChainedIncludesSource::create(CompilerInstance &CI) {
     IntrusiveRefCntPtr<DiagnosticsEngine> Diags(
         new DiagnosticsEngine(DiagID, &CI.getDiagnosticOpts(), DiagClient));
 
-    OwningPtr<CompilerInstance> Clang(new CompilerInstance());
+    std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
     Clang->setInvocation(CInvok.release());
     Clang->setDiagnostics(Diags.getPtr());
     Clang->setTarget(TargetInfo::CreateTargetInfo(Clang->getDiagnostics(),
@@ -111,7 +111,7 @@ ChainedIncludesSource::create(CompilerInstance &CI) {
 
     SmallVector<char, 256> serialAST;
     llvm::raw_svector_ostream OS(serialAST);
-    OwningPtr<ASTConsumer> consumer;
+    std::unique_ptr<ASTConsumer> consumer;
     consumer.reset(new PCHGenerator(Clang->getPreprocessor(), "-", 0,
                                     /*isysroot=*/"", &OS));
     Clang->getASTContext().setASTMutationListener(
index 086d96fca83dd745cbc72d9fc4ed391067fc2e08..11b5ba9f5491adff777f8e624477509dd3fce859 100644 (file)
@@ -147,7 +147,7 @@ static void SetupSerializedDiagnostics(DiagnosticOptions *DiagOpts,
                                        DiagnosticsEngine &Diags,
                                        StringRef OutputFile) {
   std::string ErrorInfo;
-  OwningPtr<llvm::raw_fd_ostream> OS;
+  std::unique_ptr<llvm::raw_fd_ostream> OS;
   OS.reset(new llvm::raw_fd_ostream(OutputFile.str().c_str(), ErrorInfo,
                                     llvm::sys::fs::F_None));
 
@@ -334,7 +334,7 @@ CompilerInstance::createPCHExternalASTSource(StringRef Path,
                                              void *DeserializationListener,
                                              bool Preamble,
                                              bool UseGlobalModuleIndex) {
-  OwningPtr<ASTReader> Reader;
+  std::unique_ptr<ASTReader> Reader;
   Reader.reset(new ASTReader(PP, Context,
                              Sysroot.empty() ? "" : Sysroot.c_str(),
                              DisablePCHValidation,
@@ -539,7 +539,7 @@ CompilerInstance::createOutputFile(StringRef OutputPath,
     OutFile = "-";
   }
 
-  OwningPtr<llvm::raw_fd_ostream> OS;
+  std::unique_ptr<llvm::raw_fd_ostream> OS;
   std::string OSFile;
 
   if (UseTemporary) {
@@ -662,7 +662,7 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input,
 
     SourceMgr.createMainFileID(File, Kind);
   } else {
-    OwningPtr<llvm::MemoryBuffer> SB;
+    std::unique_ptr<llvm::MemoryBuffer> SB;
     if (llvm::error_code ec = llvm::MemoryBuffer::getSTDIN(SB)) {
       Diags.Report(diag::err_fe_error_reading_stdin) << ec.message();
       return false;
index d28af7c469fa365467c8dd09523689bbc761c6e9..44fbf45bd17d730bfb694ecb5df26a75f1a6da8b 100644 (file)
@@ -1669,12 +1669,12 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
   bool Success = true;
 
   // Parse the arguments.
-  OwningPtr<OptTable> Opts(createDriverOptTable());
+  std::unique_ptr<OptTable> Opts(createDriverOptTable());
   const unsigned IncludedFlagsBitmask = options::CC1Option;
   unsigned MissingArgIndex, MissingArgCount;
-  OwningPtr<InputArgList> Args(
-    Opts->ParseArgs(ArgBegin, ArgEnd, MissingArgIndex, MissingArgCount,
-                    IncludedFlagsBitmask));
+  std::unique_ptr<InputArgList> Args(
+      Opts->ParseArgs(ArgBegin, ArgEnd, MissingArgIndex, MissingArgCount,
+                      IncludedFlagsBitmask));
 
   // Check for missing argument error.
   if (MissingArgCount) {
@@ -1834,7 +1834,7 @@ std::string CompilerInvocation::getModuleHash() const {
   //   $sysroot/System/Library/CoreServices/SystemVersion.plist
   // as part of the module hash.
   if (!hsOpts.Sysroot.empty()) {
-    llvm::OwningPtr<llvm::MemoryBuffer> buffer;
+    std::unique_ptr<llvm::MemoryBuffer> buffer;
     SmallString<128> systemVersionFile;
     systemVersionFile += hsOpts.Sysroot;
     llvm::sys::path::append(systemVersionFile, "System");
index 62a89fa13073bef7cd7eaa308e389d3609316987..ededf9a7577e3c212f35d16e535887164c459078 100644 (file)
@@ -52,7 +52,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
   // Don't check that inputs exist, they may have been remapped.
   TheDriver.setCheckInputsExist(false);
 
-  OwningPtr<driver::Compilation> C(TheDriver.BuildCompilation(Args));
+  std::unique_ptr<driver::Compilation> C(TheDriver.BuildCompilation(Args));
 
   // Just print the cc1 options if -### was present.
   if (C->getArgs().hasArg(driver::options::OPT__HASH_HASH_HASH)) {
@@ -78,7 +78,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
   }
 
   const ArgStringList &CCArgs = Cmd->getArguments();
-  OwningPtr<CompilerInvocation> CI(new CompilerInvocation());
+  std::unique_ptr<CompilerInvocation> CI(new CompilerInvocation());
   if (!CompilerInvocation::CreateFromArgs(*CI,
                                      const_cast<const char **>(CCArgs.data()),
                                      const_cast<const char **>(CCArgs.data()) +
index f61b3bacc4756bcf9984d7049699553ab3179445..24f2ec496cda3954bbb468aa98f9280d67d99c68 100644 (file)
@@ -148,7 +148,7 @@ ASTConsumer* FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI,
         ie = FrontendPluginRegistry::end();
         it != ie; ++it) {
       if (it->getName() == CI.getFrontendOpts().AddPluginActions[i]) {
-        OwningPtr<PluginASTAction> P(it->instantiate());
+        std::unique_ptr<PluginASTAction> P(it->instantiate());
         FrontendAction* c = P.get();
         if (P->ParseArgs(CI, CI.getFrontendOpts().AddPluginArgs[i]))
           Consumers.push_back(c->CreateASTConsumer(CI, InFile));
@@ -220,7 +220,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
     for (std::vector<std::string>::const_iterator I = Files.begin(),
                                                   E = Files.end();
          I != E; ++I) {
-      OwningPtr<llvm::MemoryBuffer> Buffer;
+      std::unique_ptr<llvm::MemoryBuffer> Buffer;
       if (llvm::errc::success != llvm::MemoryBuffer::getFile(*I, Buffer)) {
         CI.getDiagnostics().Report(diag::err_missing_vfs_overlay_file) << *I;
         goto failure;
@@ -307,8 +307,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
   if (!usesPreprocessorOnly()) {
     CI.createASTContext();
 
-    OwningPtr<ASTConsumer> Consumer(
-                                   CreateWrappedASTConsumer(CI, InputFile));
+    std::unique_ptr<ASTConsumer> Consumer(
+        CreateWrappedASTConsumer(CI, InputFile));
     if (!Consumer)
       goto failure;
 
index 4ed2df3a25ced8f796a336822a2c9895f6b909f6..70c34b9653db9b419b991370a959bb4156ddbf3d 100644 (file)
@@ -344,13 +344,13 @@ void VerifyPCHAction::ExecuteAction() {
   CompilerInstance &CI = getCompilerInstance();
   bool Preamble = CI.getPreprocessorOpts().PrecompiledPreambleBytes.first != 0;
   const std::string &Sysroot = CI.getHeaderSearchOpts().Sysroot;
-  OwningPtr<ASTReader> Reader(new ASTReader(
-    CI.getPreprocessor(), CI.getASTContext(),
-    Sysroot.empty() ? "" : Sysroot.c_str(),
-    /*DisableValidation*/false,
-    /*AllowPCHWithCompilerErrors*/false,
-    /*AllowConfigurationMismatch*/true,
-    /*ValidateSystemInputs*/true));
+  std::unique_ptr<ASTReader> Reader(
+      new ASTReader(CI.getPreprocessor(), CI.getASTContext(),
+                    Sysroot.empty() ? "" : Sysroot.c_str(),
+                    /*DisableValidation*/ false,
+                    /*AllowPCHWithCompilerErrors*/ false,
+                    /*AllowConfigurationMismatch*/ true,
+                    /*ValidateSystemInputs*/ true));
 
   Reader->ReadAST(getCurrentFile(),
                   Preamble ? serialization::MK_Preamble
@@ -461,7 +461,7 @@ namespace {
 
 void DumpModuleInfoAction::ExecuteAction() {
   // Set up the output file.
-  llvm::OwningPtr<llvm::raw_fd_ostream> OutFile;
+  std::unique_ptr<llvm::raw_fd_ostream> OutFile;
   StringRef OutputFileName = getCompilerInstance().getFrontendOpts().OutputFile;
   if (!OutputFileName.empty() && OutputFileName != "-") {
     std::string ErrorInfo;
index 89aeeb4c0b421c212190d46b3052d34983b4919a..ca7e6d35b19a1567d9ed0144ed72656b80a1eb80 100644 (file)
@@ -184,10 +184,9 @@ void MultiplexASTMutationListener::DeclarationMarkedUsed(const Decl *D) {
 
 }  // end namespace clang
 
-
-MultiplexConsumer::MultiplexConsumer(ArrayRef<ASTConsumer*> C)
-    : Consumers(C.begin(), C.end()),
-      MutationListener(0), DeserializationListener(0) {
+MultiplexConsumer::MultiplexConsumer(ArrayRef<ASTConsumer *> C)
+    : Consumers(C.begin(), C.end()), MutationListener(),
+      DeserializationListener() {
   // Collect the mutation listeners and deserialization listeners of all
   // children, and create a multiplex listener each if so.
   std::vector<ASTMutationListener*> mutationListeners;
index bed52b5361bfdb728482b3a0a82eeddb5b0ff5ca..767843576839994389289ee06a7b396c0663effb 100644 (file)
@@ -200,7 +200,7 @@ private:
     llvm::BitstreamWriter Stream;
 
     /// \brief The name of the diagnostics file.
-    OwningPtr<raw_ostream> OS;
+    std::unique_ptr<raw_ostream> OS;
 
     /// \brief The set of constructed record abbreviations.
     AbbreviationMap Abbrevs;
index 540e8b6951d6e000589ab8ec7ef840cf86b42cea..0edd5770f13e15f94de39882bc93bfe1ee3b5e08 100644 (file)
@@ -72,7 +72,7 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
            FrontendPluginRegistry::begin(), ie = FrontendPluginRegistry::end();
          it != ie; ++it) {
       if (it->getName() == CI.getFrontendOpts().ActionName) {
-        OwningPtr<PluginASTAction> P(it->instantiate());
+        std::unique_ptr<PluginASTAction> P(it->instantiate());
         if (!P->ParseArgs(CI, CI.getFrontendOpts().PluginArgs))
           return 0;
         return P.release();
@@ -181,7 +181,7 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
 bool clang::ExecuteCompilerInvocation(CompilerInstance *Clang) {
   // Honor -help.
   if (Clang->getFrontendOpts().ShowHelp) {
-    OwningPtr<OptTable> Opts(driver::createDriverOptTable());
+    std::unique_ptr<OptTable> Opts(driver::createDriverOptTable());
     Opts->PrintHelp(llvm::outs(), "clang -cc1",
                     "LLVM 'Clang' Compiler: http://clang.llvm.org",
                     /*Include=*/ driver::options::CC1Option, /*Exclude=*/ 0);
@@ -233,7 +233,7 @@ bool clang::ExecuteCompilerInvocation(CompilerInstance *Clang) {
   if (Clang->getDiagnostics().hasErrorOccurred())
     return false;
   // Create and execute the frontend action.
-  OwningPtr<FrontendAction> Act(CreateFrontendAction(*Clang));
+  std::unique_ptr<FrontendAction> Act(CreateFrontendAction(*Clang));
   if (!Act)
     return false;
   bool Success = Clang->ExecuteAction(*Act);
index 56fd6946b03ef93842317ac9263f7ed0a22f93d8..d71e4bc278e13b37a1163635bcc4ec21c0734b42 100644 (file)
@@ -81,7 +81,7 @@ const HeaderMap *HeaderMap::Create(const FileEntry *FE, FileManager &FM) {
   unsigned FileSize = FE->getSize();
   if (FileSize <= sizeof(HMapHeader)) return 0;
 
-  OwningPtr<const llvm::MemoryBuffer> FileBuffer(FM.getBufferForFile(FE));
+  std::unique_ptr<const llvm::MemoryBuffer> FileBuffer(FM.getBufferForFile(FE));
   if (!FileBuffer) return 0;  // Unreadable file?
   const char *FileStart = FileBuffer->getBufferStart();
 
index c962409dbd75ec770f501a31cb290229b32ab6b3..c79aa185d86b07623110e82e93eb6b71cbbdc0fa 100644 (file)
@@ -425,7 +425,7 @@ static void InvalidPTH(DiagnosticsEngine &Diags, const char *Msg) {
 PTHManager *PTHManager::Create(const std::string &file,
                                DiagnosticsEngine &Diags) {
   // Memory map the PTH file.
-  OwningPtr<llvm::MemoryBuffer> File;
+  std::unique_ptr<llvm::MemoryBuffer> File;
 
   if (llvm::MemoryBuffer::getFile(file, File)) {
     // FIXME: Add ec.message() to this diag.
@@ -475,7 +475,7 @@ PTHManager *PTHManager::Create(const std::string &file,
     return 0; // FIXME: Proper error diagnostic?
   }
 
-  OwningPtr<PTHFileLookup> FL(PTHFileLookup::Create(FileTable, BufBeg));
+  std::unique_ptr<PTHFileLookup> FL(PTHFileLookup::Create(FileTable, BufBeg));
 
   // Warn if the PTH file is empty.  We still want to create a PTHManager
   // as the PTH could be used with -include-pth.
@@ -501,8 +501,8 @@ PTHManager *PTHManager::Create(const std::string &file,
     return 0;
   }
 
-  OwningPtr<PTHStringIdLookup> SL(PTHStringIdLookup::Create(StringIdTable,
-                                                                  BufBeg));
+  std::unique_ptr<PTHStringIdLookup> SL(
+      PTHStringIdLookup::Create(StringIdTable, BufBeg));
 
   // Get the location of the spelling cache.
   const unsigned char* spellingBaseOffset = PrologueOffset + sizeof(uint32_t)*3;
index 5678ece0c822ccc02ce95daaece8b0f48a319703..604d672879db5c02793e1dee338ad26cb9591376 100644 (file)
@@ -88,7 +88,8 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer,
                      CodeCompleteConsumer *CompletionConsumer,
                      bool SkipFunctionBodies) {
 
-  OwningPtr<Sema> S(new Sema(PP, Ctx, *Consumer, TUKind, CompletionConsumer));
+  std::unique_ptr<Sema> S(
+      new Sema(PP, Ctx, *Consumer, TUKind, CompletionConsumer));
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<Sema> CleanupSema(S.get());
@@ -109,8 +110,8 @@ void clang::ParseAST(Sema &S, bool PrintStats, bool SkipFunctionBodies) {
 
   ASTConsumer *Consumer = &S.getASTConsumer();
 
-  OwningPtr<Parser> ParseOP(new Parser(S.getPreprocessor(), S,
-                                       SkipFunctionBodies));
+  std::unique_ptr<Parser> ParseOP(
+      new Parser(S.getPreprocessor(), S, SkipFunctionBodies));
   Parser &P = *ParseOP.get();
 
   PrettyStackTraceParserEntry CrashInfo(P);
index e007998be389d938619b763a9d0f6eec7ec34c61..b7d9abfc3adf329626f598b2ba8152a1640b452b 100644 (file)
@@ -302,7 +302,7 @@ void Parser::ParseGNUAttributeArgs(IdentifierInfo *AttrName,
 
   // These may refer to the function arguments, but need to be parsed early to
   // participate in determining whether it's a redeclaration.
-  llvm::OwningPtr<ParseScope> PrototypeScope;
+  std::unique_ptr<ParseScope> PrototypeScope;
   if (AttrName->isStr("enable_if") && D && D->isFunctionDeclarator()) {
     DeclaratorChunk::FunctionTypeInfo FTI = D->getFunctionTypeInfo();
     PrototypeScope.reset(new ParseScope(this, Scope::FunctionPrototypeScope |
@@ -342,7 +342,7 @@ void Parser::ParseGNUAttributeArgs(IdentifierInfo *AttrName,
 
     // Parse the non-empty comma-separated list of expressions.
     do {
-      OwningPtr<EnterExpressionEvaluationContext> Unevaluated;
+      std::unique_ptr<EnterExpressionEvaluationContext> Unevaluated;
       if (attributeParsedArgsUnevaluated(*AttrName))
         Unevaluated.reset(new EnterExpressionEvaluationContext(Actions,
         Sema::Unevaluated));
index 4cd27fe88f5bb907d42ddb478d11f32637ea4767..ae30ce715abf33d7f6acd36586151830c729fe70 100644 (file)
@@ -2163,13 +2163,13 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
   if (buildMSAsmString(PP, AsmLoc, AsmToks, TokOffsets, AsmString))
     return StmtError();
 
-  OwningPtr<llvm::MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TT));
-  OwningPtr<llvm::MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TT));
+  std::unique_ptr<llvm::MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TT));
+  std::unique_ptr<llvm::MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TT));
   // Get the instruction descriptor.
-  const llvm::MCInstrInfo *MII = TheTarget->createMCInstrInfo(); 
-  OwningPtr<llvm::MCObjectFileInfo> MOFI(new llvm::MCObjectFileInfo());
-  OwningPtr<llvm::MCSubtargetInfo>
-    STI(TheTarget->createMCSubtargetInfo(TT, "", ""));
+  const llvm::MCInstrInfo *MII = TheTarget->createMCInstrInfo();
+  std::unique_ptr<llvm::MCObjectFileInfo> MOFI(new llvm::MCObjectFileInfo());
+  std::unique_ptr<llvm::MCSubtargetInfo> STI(
+      TheTarget->createMCSubtargetInfo(TT, "", ""));
 
   llvm::SourceMgr TempSrcMgr;
   llvm::MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &TempSrcMgr);
@@ -2179,11 +2179,11 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
   // Tell SrcMgr about this buffer, which is what the parser will pick up.
   TempSrcMgr.AddNewSourceBuffer(Buffer, llvm::SMLoc());
 
-  OwningPtr<llvm::MCStreamer> Str(createNullStreamer(Ctx));
-  OwningPtr<llvm::MCAsmParser>
-    Parser(createMCAsmParser(TempSrcMgr, Ctx, *Str.get(), *MAI));
-  OwningPtr<llvm::MCTargetAsmParser>
-    TargetParser(TheTarget->createMCAsmParser(*STI, *Parser, *MII));
+  std::unique_ptr<llvm::MCStreamer> Str(createNullStreamer(Ctx));
+  std::unique_ptr<llvm::MCAsmParser> Parser(
+      createMCAsmParser(TempSrcMgr, Ctx, *Str.get(), *MAI));
+  std::unique_ptr<llvm::MCTargetAsmParser> TargetParser(
+      TheTarget->createMCAsmParser(*STI, *Parser, *MII));
 
   llvm::MCInstPrinter *IP =
     TheTarget->createMCInstPrinter(1, *MAI, *MII, *MRI, *STI);
index e5f65c28cf9460c2fbe044e45d4ecae1208de4e4..69f039baf5885d556085ccc2016ca24109e3ba3f 100644 (file)
@@ -471,7 +471,7 @@ private:
   DiagnosticsEngine &Diagnostics;
   StringRef Filename;
   SmallString<128> TempFilename;
-  OwningPtr<llvm::raw_fd_ostream> FileStream;
+  std::unique_ptr<llvm::raw_fd_ostream> FileStream;
   bool &AllWritten;
 };
 } // end anonymous namespace
index 906bc84169e565cedc8882d026ac0ff43dea3592..bdff71dcd2f9128dec4998f4e122ec7987fe45bf 100644 (file)
@@ -87,7 +87,7 @@ bool FixItRewriter::WriteFixedFiles(
     int fd;
     std::string Filename = FixItOpts->RewriteFilename(Entry->getName(), fd);
     std::string Err;
-    OwningPtr<llvm::raw_fd_ostream> OS;
+    std::unique_ptr<llvm::raw_fd_ostream> OS;
     if (fd != -1) {
       OS.reset(new llvm::raw_fd_ostream(fd, /*shouldClose=*/true));
     } else {
index e9ec38818265073017c99b2803ce526d4b847436..9a5e953fa0eed2aaf9256eea41ef06803ef36d7f 100644 (file)
@@ -110,9 +110,9 @@ bool FixItRecompile::BeginInvocation(CompilerInstance &CI) {
   bool err = false;
   {
     const FrontendOptions &FEOpts = CI.getFrontendOpts();
-    OwningPtr<FrontendAction> FixAction(new SyntaxOnlyAction());
+    std::unique_ptr<FrontendAction> FixAction(new SyntaxOnlyAction());
     if (FixAction->BeginSourceFile(CI, FEOpts.Inputs[0])) {
-      OwningPtr<FixItOptions> FixItOpts;
+      std::unique_ptr<FixItOptions> FixItOpts;
       if (FEOpts.FixToTemporaries)
         FixItOpts.reset(new FixItRewriteToTemp());
       else
index 5c66f077c82a80bf6aeab23031b6635b4a379b9d..b738d7fddacd868a2861329e37ebf6554b9133bc 100644 (file)
@@ -4163,7 +4163,7 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName,
     // FIXME: Re-add the ability to skip very unlikely potential corrections.
     if (IdentifierInfoLookup *External
                             = Context.Idents.getExternalIdentifierLookup()) {
-      OwningPtr<IdentifierIterator> Iter(External->getIdentifiers());
+      std::unique_ptr<IdentifierIterator> Iter(External->getIdentifiers());
       do {
         StringRef Name = Iter->Next();
         if (Name.empty())
index c96fcbed53734177e32408a03e4b87d94225aa6d..78db05302ec012116cf9a36cbf67b7b7fa366c2a 100644 (file)
@@ -1709,7 +1709,7 @@ void Sema::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl* IMPDecl,
   // require an explicit implementation, via attribute
   // 'objc_protocol_requires_explicit_implementation'.
   if (IDecl) {
-    OwningPtr<ObjCContainerDecl::PropertyMap> LazyMap;
+    std::unique_ptr<ObjCContainerDecl::PropertyMap> LazyMap;
 
     for (ObjCInterfaceDecl::all_protocol_iterator
           PI = IDecl->all_referenced_protocol_begin(),
index 99ef8f0c9b859db2373fd765e6497bc6cfae5648..7e31723b165e2540439656e5058b234744eade86 100644 (file)
@@ -3709,7 +3709,7 @@ std::string ASTReader::getOriginalSourceFile(const std::string &ASTFileName,
                                              DiagnosticsEngine &Diags) {
   // Open the AST file.
   std::string ErrStr;
-  OwningPtr<llvm::MemoryBuffer> Buffer;
+  std::unique_ptr<llvm::MemoryBuffer> Buffer;
   Buffer.reset(FileMgr.getBufferForFile(ASTFileName, &ErrStr));
   if (!Buffer) {
     Diags.Report(diag::err_fe_unable_to_read_pch_file) << ASTFileName << ErrStr;
@@ -3798,7 +3798,7 @@ bool ASTReader::readASTFileControlBlock(StringRef Filename,
                                         ASTReaderListener &Listener) {
   // Open the AST file.
   std::string ErrStr;
-  OwningPtr<llvm::MemoryBuffer> Buffer;
+  std::unique_ptr<llvm::MemoryBuffer> Buffer;
   Buffer.reset(FileMgr.getBufferForFile(Filename, &ErrStr));
   if (!Buffer) {
     return true;
index e46cb97b9f3d053ae39713886fa3d09576ef8d22..5cd3ad55757913e674c744bc8bc5f2c1f77c320a 100644 (file)
@@ -228,7 +228,7 @@ GlobalModuleIndex::readIndex(StringRef Path) {
   IndexPath += Path;
   llvm::sys::path::append(IndexPath, IndexFileName);
 
-  llvm::OwningPtr<llvm::MemoryBuffer> Buffer;
+  std::unique_ptr<llvm::MemoryBuffer> Buffer;
   if (llvm::MemoryBuffer::getFile(IndexPath.c_str(), Buffer) !=
       llvm::errc::success)
     return std::make_pair((GlobalModuleIndex *)0, EC_NotFound);
@@ -469,7 +469,7 @@ namespace {
 
 bool GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) {
   // Open the module file.
-  OwningPtr<llvm::MemoryBuffer> Buffer;
+  std::unique_ptr<llvm::MemoryBuffer> Buffer;
   std::string ErrorStr;
   Buffer.reset(FileMgr.getBufferForFile(File, &ErrorStr, /*isVolatile=*/true));
   if (!Buffer) {
@@ -593,10 +593,10 @@ bool GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) {
     if (State == ASTBlock && Code == IDENTIFIER_TABLE && Record[0] > 0) {
       typedef OnDiskChainedHashTable<InterestingASTIdentifierLookupTrait>
         InterestingIdentifierTable;
-      llvm::OwningPtr<InterestingIdentifierTable>
-        Table(InterestingIdentifierTable::Create(
-                (const unsigned char *)Blob.data() + Record[0],
-                (const unsigned char *)Blob.data()));
+      std::unique_ptr<InterestingIdentifierTable> Table(
+          InterestingIdentifierTable::Create(
+              (const unsigned char *)Blob.data() + Record[0],
+              (const unsigned char *)Blob.data()));
       for (InterestingIdentifierTable::data_iterator D = Table->data_begin(),
                                                      DEnd = Table->data_end();
            D != DEnd; ++D) {
index f76de9bfe6ae30d598a9758d40fef542f16b4666..cb5b01009f1d9546c1f0b642831f6ecf529551bf 100644 (file)
@@ -25,7 +25,8 @@ using namespace ento;
 namespace {
 class ArrayBoundChecker : 
     public Checker<check::Location> {
-  mutable OwningPtr<BuiltinBug> BT;
+  mutable std::unique_ptr<BuiltinBug> BT;
+
 public:
   void checkLocation(SVal l, bool isLoad, const Stmt* S,
                      CheckerContext &C) const;
index 936d8db4668c8bdd3774035140426487b4360dea..a8d7b3ab61babaf4f57d1b9a47fabce5600fddf8 100644 (file)
@@ -28,8 +28,8 @@ using namespace ento;
 namespace {
 class ArrayBoundCheckerV2 : 
     public Checker<check::Location> {
-  mutable OwningPtr<BuiltinBug> BT;
-      
+  mutable std::unique_ptr<BuiltinBug> BT;
+
   enum OOB_Kind { OOB_Precedes, OOB_Excedes, OOB_Tainted };
   
   void reportOOB(CheckerContext &C, ProgramStateRef errorState,
index 53e12cd3939794d0f405b0fcc0aca6f1811e9ff3..4b2ccd43aa396f9dbd1a0ac5dbffe760ff9642aa 100644 (file)
@@ -95,7 +95,7 @@ namespace {
   class NilArgChecker : public Checker<check::PreObjCMessage,
                                        check::PostStmt<ObjCDictionaryLiteral>,
                                        check::PostStmt<ObjCArrayLiteral> > {
-    mutable OwningPtr<APIMisuse> BT;
+    mutable std::unique_ptr<APIMisuse> BT;
 
     void warnIfNilExpr(const Expr *E,
                        const char *Msg,
@@ -313,7 +313,7 @@ void NilArgChecker::checkPostStmt(const ObjCDictionaryLiteral *DL,
 
 namespace {
 class CFNumberCreateChecker : public Checker< check::PreStmt<CallExpr> > {
-  mutable OwningPtr<APIMisuse> BT;
+  mutable std::unique_ptr<APIMisuse> BT;
   mutable IdentifierInfo* II;
 public:
   CFNumberCreateChecker() : II(0) {}
@@ -498,7 +498,7 @@ void CFNumberCreateChecker::checkPreStmt(const CallExpr *CE,
 
 namespace {
 class CFRetainReleaseChecker : public Checker< check::PreStmt<CallExpr> > {
-  mutable OwningPtr<APIMisuse> BT;
+  mutable std::unique_ptr<APIMisuse> BT;
   mutable IdentifierInfo *Retain, *Release, *MakeCollectable;
 public:
   CFRetainReleaseChecker(): Retain(0), Release(0), MakeCollectable(0) {}
@@ -590,7 +590,7 @@ class ClassReleaseChecker : public Checker<check::PreObjCMessage> {
   mutable Selector retainS;
   mutable Selector autoreleaseS;
   mutable Selector drainS;
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
 
 public:
   void checkPreObjCMessage(const ObjCMethodCall &msg, CheckerContext &C) const;
@@ -649,7 +649,7 @@ class VariadicMethodTypeChecker : public Checker<check::PreObjCMessage> {
   mutable Selector orderedSetWithObjectsS;
   mutable Selector initWithObjectsS;
   mutable Selector initWithObjectsAndKeysS;
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
 
   bool isVariadicMessage(const ObjCMethodCall &msg) const;
 
index 7227dcf82cb0ce59fe68f98e1e2b79fbfce82f66..83a37c978c22c767201c9306f6989a4bdc954178 100644 (file)
@@ -23,7 +23,7 @@ using namespace ento;
 
 namespace {
   class BoolAssignmentChecker : public Checker< check::Bind > {
-    mutable OwningPtr<BuiltinBug> BT;
+    mutable std::unique_ptr<BuiltinBug> BT;
     void emitReport(ProgramStateRef state, CheckerContext &C) const;
   public:
     void checkBind(SVal loc, SVal val, const Stmt *S, CheckerContext &C) const;
index 3c5cf615c8e7bd6c7dc704416a9ce08b8ec06a58..01361c65df7e906b0658bc03d2c3469af1409450 100644 (file)
@@ -35,11 +35,8 @@ class CStringChecker : public Checker< eval::Call,
                                          check::DeadSymbols,
                                          check::RegionChanges
                                          > {
-  mutable OwningPtr<BugType> BT_Null,
-                             BT_Bounds,
-                             BT_Overlap,
-                             BT_NotCString,
-                             BT_AdditionOverflow;
+  mutable std::unique_ptr<BugType> BT_Null, BT_Bounds, BT_Overlap,
+      BT_NotCString, BT_AdditionOverflow;
 
   mutable const char *CurrentFunctionDescription;
 
index c0467b1e7e76c1c85e4919c44697e7fa88a8a7b6..1a9e892218760202fade6a01575bac202ae9b624 100644 (file)
@@ -32,18 +32,19 @@ class CallAndMessageChecker
                     check::PreStmt<CXXDeleteExpr>,
                     check::PreObjCMessage,
                     check::PreCall > {
-  mutable OwningPtr<BugType> BT_call_null;
-  mutable OwningPtr<BugType> BT_call_undef;
-  mutable OwningPtr<BugType> BT_cxx_call_null;
-  mutable OwningPtr<BugType> BT_cxx_call_undef;
-  mutable OwningPtr<BugType> BT_call_arg;
-  mutable OwningPtr<BugType> BT_cxx_delete_undef;
-  mutable OwningPtr<BugType> BT_msg_undef;
-  mutable OwningPtr<BugType> BT_objc_prop_undef;
-  mutable OwningPtr<BugType> BT_objc_subscript_undef;
-  mutable OwningPtr<BugType> BT_msg_arg;
-  mutable OwningPtr<BugType> BT_msg_ret;
-  mutable OwningPtr<BugType> BT_call_few_args;
+  mutable std::unique_ptr<BugType> BT_call_null;
+  mutable std::unique_ptr<BugType> BT_call_undef;
+  mutable std::unique_ptr<BugType> BT_cxx_call_null;
+  mutable std::unique_ptr<BugType> BT_cxx_call_undef;
+  mutable std::unique_ptr<BugType> BT_call_arg;
+  mutable std::unique_ptr<BugType> BT_cxx_delete_undef;
+  mutable std::unique_ptr<BugType> BT_msg_undef;
+  mutable std::unique_ptr<BugType> BT_objc_prop_undef;
+  mutable std::unique_ptr<BugType> BT_objc_subscript_undef;
+  mutable std::unique_ptr<BugType> BT_msg_arg;
+  mutable std::unique_ptr<BugType> BT_msg_ret;
+  mutable std::unique_ptr<BugType> BT_call_few_args;
+
 public:
 
   void checkPreStmt(const CallExpr *CE, CheckerContext &C) const;
@@ -55,7 +56,7 @@ private:
   bool PreVisitProcessArg(CheckerContext &C, SVal V, SourceRange argRange,
                           const Expr *argEx, bool IsFirstArgument,
                           bool checkUninitFields, const CallEvent &Call,
-                          OwningPtr<BugType> &BT) const;
+                          std::unique_ptr<BugType> &BT) const;
 
   static void emitBadCall(BugType *BT, CheckerContext &C, const Expr *BadE);
   void emitNilReceiverBug(CheckerContext &C, const ObjCMethodCall &msg,
@@ -65,7 +66,7 @@ private:
                          ProgramStateRef state,
                          const ObjCMethodCall &msg) const;
 
-  void LazyInit_BT(const char *desc, OwningPtr<BugType> &BT) const {
+  void LazyInit_BT(const char *desc, std::unique_ptr<BugType> &BT) const {
     if (!BT)
       BT.reset(new BuiltinBug(this, desc));
   }
@@ -113,13 +114,10 @@ static StringRef describeUninitializedArgumentInCall(const CallEvent &Call,
   }
 }
 
-bool CallAndMessageChecker::PreVisitProcessArg(CheckerContext &C,
-                                               SVal V, SourceRange argRange,
-                                               const Expr *argEx,
-                                               bool IsFirstArgument,
-                                               bool checkUninitFields,
-                                               const CallEvent &Call,
-                                               OwningPtr<BugType> &BT) const {
+bool CallAndMessageChecker::PreVisitProcessArg(
+    CheckerContext &C, SVal V, SourceRange argRange, const Expr *argEx,
+    bool IsFirstArgument, bool checkUninitFields, const CallEvent &Call,
+    std::unique_ptr<BugType> &BT) const {
   if (V.isUndef()) {
     if (ExplodedNode *N = C.generateSink()) {
       LazyInit_BT("Uninitialized argument value", BT);
@@ -340,7 +338,7 @@ void CallAndMessageChecker::checkPreCall(const CallEvent &Call,
   const bool checkUninitFields =
     !(C.getAnalysisManager().shouldInlineCall() && (D && D->getBody()));
 
-  OwningPtr<BugType> *BT;
+  std::unique_ptr<BugType> *BT;
   if (isa<ObjCMethodCall>(Call))
     BT = &BT_msg_arg;
   else
index 79fc1ce849ba03c94b8a3c7336aeee19765497eb..e9adf305a4f8ec1bcf5bd17513335868c6f99898 100644 (file)
@@ -23,7 +23,8 @@ using namespace ento;
 
 namespace {
 class CastSizeChecker : public Checker< check::PreStmt<CastExpr> > {
-  mutable OwningPtr<BuiltinBug> BT;
+  mutable std::unique_ptr<BuiltinBug> BT;
+
 public:
   void checkPreStmt(const CastExpr *CE, CheckerContext &C) const;
 };
index e9c7599e153895a2bbd4d27c6f2e0f80b218b58e..d765315bb57bc9b2e84f4b4a87c9f1858e240042 100644 (file)
@@ -24,7 +24,7 @@ using namespace ento;
 
 namespace {
 class CastToStructChecker : public Checker< check::PreStmt<CastExpr> > {
-  mutable OwningPtr<BuiltinBug> BT;
+  mutable std::unique_ptr<BuiltinBug> BT;
 
 public:
   void checkPreStmt(const CastExpr *CE, CheckerContext &C) const;
index 9cfc0f3116a071b21a395e24ea1a7dadbfaca5f7..628cf2c8118c49f3fa04cdd37d83aecd7c74b5dc 100644 (file)
@@ -41,7 +41,7 @@ bool isRootChanged(intptr_t k) { return k == ROOT_CHANGED; }
 class ChrootChecker : public Checker<eval::Call, check::PreStmt<CallExpr> > {
   mutable IdentifierInfo *II_chroot, *II_chdir;
   // This bug refers to possibly break out of a chroot() jail.
-  mutable OwningPtr<BuiltinBug> BT_BreakJail;
+  mutable std::unique_ptr<BuiltinBug> BT_BreakJail;
 
 public:
   ChrootChecker() : II_chroot(0), II_chdir(0) {}
index ee12a4d75ff3f3419cc505c68dfb0a9c4d580156..87f1a3d19a99271218c330563755c45c62c341b9 100644 (file)
@@ -128,9 +128,9 @@ class DeadStoreObs : public LiveVariables::Observer {
   AnalysisDeclContext* AC;
   ParentMap& Parents;
   llvm::SmallPtrSet<const VarDecl*, 20> Escaped;
-  OwningPtr<ReachableCode> reachableCode;
+  std::unique_ptr<ReachableCode> reachableCode;
   const CFGBlock *currentBlock;
-  OwningPtr<llvm::DenseSet<const VarDecl *> > InEH;
+  std::unique_ptr<llvm::DenseSet<const VarDecl *>> InEH;
 
   enum DeadStoreKind { Standard, Enclosing, DeadIncrement, DeadInit };
 
index bc9a77098d42da23abe5bc0bc61b74553c6ea2d0..efdc213ac82c4aad157811648f9cdcb26d81fd9b 100644 (file)
@@ -29,8 +29,8 @@ class DereferenceChecker
     : public Checker< check::Location,
                       check::Bind,
                       EventDispatcher<ImplicitNullDerefEvent> > {
-  mutable OwningPtr<BuiltinBug> BT_null;
-  mutable OwningPtr<BuiltinBug> BT_undef;
+  mutable std::unique_ptr<BuiltinBug> BT_null;
+  mutable std::unique_ptr<BuiltinBug> BT_undef;
 
   void reportBug(ProgramStateRef State, const Stmt *S, CheckerContext &C,
                  bool IsBind = false) const;
index ae76b563b009982a172bc7f133f014019d483eba..e060c36184c4a8d7f017fa999c4a47b923a8e254 100644 (file)
@@ -23,7 +23,7 @@ using namespace ento;
 
 namespace {
 class DivZeroChecker : public Checker< check::PreStmt<BinaryOperator> > {
-  mutable OwningPtr<BuiltinBug> BT;
+  mutable std::unique_ptr<BuiltinBug> BT;
   void reportBug(const char *Msg,
                  ProgramStateRef StateZero,
                  CheckerContext &C) const ;
index ff367625031be954a879046b751accae0afdcabf..9a0fa097332b81aa47caf76120c56ed19fcea6b9 100644 (file)
@@ -18,7 +18,7 @@ using namespace ento;
 
 namespace {
 class ExprInspectionChecker : public Checker< eval::Call > {
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
 
   void analyzerEval(const CallExpr *CE, CheckerContext &C) const;
   void analyzerCheckInlined(const CallExpr *CE, CheckerContext &C) const;
index c73b068300c688b3c5cf9a40fb55f8b0d8be21ef..60bb03654f5dcfc02ee1a771d5f01d9ef0e134c5 100644 (file)
@@ -25,7 +25,7 @@ using namespace ento;
 namespace {
 class FixedAddressChecker 
   : public Checker< check::PreStmt<BinaryOperator> > {
-  mutable OwningPtr<BuiltinBug> BT;
+  mutable std::unique_ptr<BuiltinBug> BT;
 
 public:
   void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
index c65dd8ca877ac3ec41c019652b7899e0537e1b56..a55f8112d05f5f8774bcab7dd479a2cb6e7ff36e 100644 (file)
@@ -43,7 +43,7 @@ private:
   /// Denotes the return vale.
   static const unsigned ReturnValueIndex = UINT_MAX - 1;
 
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
   inline void initBugType() const {
     if (!BT)
       BT.reset(new BugType(this, "Use of Untrusted Data", "Untrusted Data"));
index 57cead1fd75bbf980d3bdf4ac54e98f3fa734d9a..0c0da8bc7d2a667338d3744970595dd52532f144 100644 (file)
@@ -29,7 +29,7 @@ namespace {
 class MacOSKeychainAPIChecker : public Checker<check::PreStmt<CallExpr>,
                                                check::PostStmt<CallExpr>,
                                                check::DeadSymbols> {
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
 
 public:
   /// AllocationState is a part of the checker specific state together with the
index 2fbfbafbe2c1b9fede40317ec6672ee2746881c9..d9e46990c8844c19296e65aa770889d4c31fce36 100644 (file)
@@ -31,7 +31,7 @@ using namespace ento;
 
 namespace {
 class MacOSXAPIChecker : public Checker< check::PreStmt<CallExpr> > {
-  mutable OwningPtr<BugType> BT_dispatchOnce;
+  mutable std::unique_ptr<BugType> BT_dispatchOnce;
 
 public:
   void checkPreStmt(const CallExpr *CE, CheckerContext &C) const;
index de615a88b3e04e285dafb894ef05b32a8a687461..51d26d8a648135bc3401340d2a33579d71570572 100644 (file)
@@ -199,13 +199,13 @@ public:
                   const char *NL, const char *Sep) const;
 
 private:
-  mutable OwningPtr<BugType> BT_DoubleFree[CK_NumCheckKinds];
-  mutable OwningPtr<BugType> BT_DoubleDelete;
-  mutable OwningPtr<BugType> BT_Leak[CK_NumCheckKinds];
-  mutable OwningPtr<BugType> BT_UseFree[CK_NumCheckKinds];
-  mutable OwningPtr<BugType> BT_BadFree[CK_NumCheckKinds];
-  mutable OwningPtr<BugType> BT_MismatchedDealloc;
-  mutable OwningPtr<BugType> BT_OffsetFree[CK_NumCheckKinds];
+  mutable std::unique_ptr<BugType> BT_DoubleFree[CK_NumCheckKinds];
+  mutable std::unique_ptr<BugType> BT_DoubleDelete;
+  mutable std::unique_ptr<BugType> BT_Leak[CK_NumCheckKinds];
+  mutable std::unique_ptr<BugType> BT_UseFree[CK_NumCheckKinds];
+  mutable std::unique_ptr<BugType> BT_BadFree[CK_NumCheckKinds];
+  mutable std::unique_ptr<BugType> BT_MismatchedDealloc;
+  mutable std::unique_ptr<BugType> BT_OffsetFree[CK_NumCheckKinds];
   mutable IdentifierInfo *II_malloc, *II_free, *II_realloc, *II_calloc,
                          *II_valloc, *II_reallocf, *II_strndup, *II_strdup;
 
index f8570071d1b9b8c101cf1dfae4b9aaf697103a78..b180c03f0871e82485479d03ba5e032c5779b1b6 100644 (file)
@@ -32,7 +32,7 @@ using namespace ento;
 namespace {
 class NSAutoreleasePoolChecker
   : public Checker<check::PreObjCMessage> {
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
   mutable Selector releaseS;
 
 public:
index bad27899835955cec427dbc343f68bca67e5b650..293114ff2f484e3f54eb9f5682d35fc2717cdfb1 100644 (file)
@@ -29,8 +29,9 @@ using namespace ento;
 namespace {
 class NonNullParamChecker
   : public Checker< check::PreCall > {
-  mutable OwningPtr<BugType> BTAttrNonNull;
-  mutable OwningPtr<BugType> BTNullRefArg;
+  mutable std::unique_ptr<BugType> BTAttrNonNull;
+  mutable std::unique_ptr<BugType> BTNullRefArg;
+
 public:
 
   void checkPreCall(const CallEvent &Call, CheckerContext &C) const;
index 1fce2bbbea4d318245a34c61db4489a2c888afb8..fbf2d73dd86c4d8e646d61f717586a60dc73dd09 100644 (file)
@@ -26,8 +26,8 @@ using namespace ento;
 namespace {
 class ObjCAtSyncChecker
     : public Checker< check::PreStmt<ObjCAtSynchronizedStmt> > {
-  mutable OwningPtr<BuiltinBug> BT_null;
-  mutable OwningPtr<BuiltinBug> BT_undef;
+  mutable std::unique_ptr<BuiltinBug> BT_null;
+  mutable std::unique_ptr<BuiltinBug> BT_undef;
 
 public:
   void checkPreStmt(const ObjCAtSynchronizedStmt *S, CheckerContext &C) const;
index 165bdafccbc445201d9ad9c1db32e8069f369eb4..8e51154fc3a17a0f0c6a9fb19c050e9cc68651d4 100644 (file)
@@ -30,7 +30,7 @@ using namespace ento;
 namespace {
 class ObjCContainersChecker : public Checker< check::PreStmt<CallExpr>,
                                              check::PostStmt<CallExpr> > {
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
   inline void initBugType() const {
     if (!BT)
       BT.reset(new BugType(this, "CFArray API",
index 3e86c7618fa4f7a838bb90290464a8e0bf72d1a0..00480e4abf12c88bdc236a6ea3245afdbc63c511 100644 (file)
@@ -24,7 +24,7 @@ using namespace ento;
 namespace {
 class PointerArithChecker 
   : public Checker< check::PreStmt<BinaryOperator> > {
-  mutable OwningPtr<BuiltinBug> BT;
+  mutable std::unique_ptr<BuiltinBug> BT;
 
 public:
   void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
index 8f63cecfd39beb337012610fcbcc1c6aaf618bc5..fbb2628a9ce5336e2046d7c8f58def0bba6b7482 100644 (file)
@@ -25,7 +25,7 @@ using namespace ento;
 namespace {
 class PointerSubChecker 
   : public Checker< check::PreStmt<BinaryOperator> > {
-  mutable OwningPtr<BuiltinBug> BT;
+  mutable std::unique_ptr<BuiltinBug> BT;
 
 public:
   void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
index 568656269811c74eb49c6443565c84cc11648bc9..5afa2d16877b7862460262d9b10c9649e50f18b8 100644 (file)
@@ -25,8 +25,8 @@ using namespace ento;
 
 namespace {
 class PthreadLockChecker : public Checker< check::PostStmt<CallExpr> > {
-  mutable OwningPtr<BugType> BT_doublelock;
-  mutable OwningPtr<BugType> BT_lor;
+  mutable std::unique_ptr<BugType> BT_doublelock;
+  mutable std::unique_ptr<BugType> BT_lor;
   enum LockingSemantics {
     NotApplicable = 0,
     PthreadSemantics,
index 1cb92b861d61ee3862fa0d51349f2fa75214dbec..bd1d4173539e58abf58ad15eac0db156cf299ece 100644 (file)
@@ -2338,19 +2338,19 @@ class RetainCountChecker
                     check::RegionChanges,
                     eval::Assume,
                     eval::Call > {
-  mutable OwningPtr<CFRefBug> useAfterRelease, releaseNotOwned;
-  mutable OwningPtr<CFRefBug> deallocGC, deallocNotOwned;
-  mutable OwningPtr<CFRefBug> overAutorelease, returnNotOwnedForOwned;
-  mutable OwningPtr<CFRefBug> leakWithinFunction, leakAtReturn;
-  mutable OwningPtr<CFRefBug> leakWithinFunctionGC, leakAtReturnGC;
+  mutable std::unique_ptr<CFRefBug> useAfterRelease, releaseNotOwned;
+  mutable std::unique_ptr<CFRefBug> deallocGC, deallocNotOwned;
+  mutable std::unique_ptr<CFRefBug> overAutorelease, returnNotOwnedForOwned;
+  mutable std::unique_ptr<CFRefBug> leakWithinFunction, leakAtReturn;
+  mutable std::unique_ptr<CFRefBug> leakWithinFunctionGC, leakAtReturnGC;
 
   typedef llvm::DenseMap<SymbolRef, const CheckerProgramPointTag *> SymbolTagMap;
 
   // This map is only used to ensure proper deletion of any allocated tags.
   mutable SymbolTagMap DeadSymbolTags;
 
-  mutable OwningPtr<RetainSummaryManager> Summaries;
-  mutable OwningPtr<RetainSummaryManager> SummariesGC;
+  mutable std::unique_ptr<RetainSummaryManager> Summaries;
+  mutable std::unique_ptr<RetainSummaryManager> SummariesGC;
   mutable SummaryLogTy SummaryLog;
   mutable bool ShouldResetSummaryLog;
 
index 6a43bf8aa28487c18d0ce89a0d589dded49fff72..b1cde6b897cb66c54a6d11532fcae084160548d9 100644 (file)
@@ -25,7 +25,8 @@ using namespace ento;
 namespace {
 class ReturnPointerRangeChecker : 
     public Checker< check::PreStmt<ReturnStmt> > {
-  mutable OwningPtr<BuiltinBug> BT;
+  mutable std::unique_ptr<BuiltinBug> BT;
+
 public:
     void checkPreStmt(const ReturnStmt *RS, CheckerContext &C) const;
 };
index 0eab41f257956aa618d2ccd10b24bc4e010b77ac..b4d92d69cfae8e6d75d58c7eec90ea70d6f346ed 100644 (file)
@@ -25,8 +25,8 @@ using namespace ento;
 
 namespace {
 class ReturnUndefChecker : public Checker< check::PreStmt<ReturnStmt> > {
-  mutable OwningPtr<BuiltinBug> BT_Undef;
-  mutable OwningPtr<BuiltinBug> BT_NullReference;
+  mutable std::unique_ptr<BuiltinBug> BT_Undef;
+  mutable std::unique_ptr<BuiltinBug> BT_NullReference;
 
   void emitUndef(CheckerContext &C, const Expr *RetE) const;
   void checkReference(CheckerContext &C, const Expr *RetE,
index ac250cac1e176933cbe05302e64e72dfe939b36d..483063b52f6cba99e1062a3734fc966490a971ca 100644 (file)
@@ -54,8 +54,8 @@ class SimpleStreamChecker : public Checker<check::PostCall,
 
   mutable IdentifierInfo *IIfopen, *IIfclose;
 
-  OwningPtr<BugType> DoubleCloseBugType;
-  OwningPtr<BugType> LeakBugType;
+  std::unique_ptr<BugType> DoubleCloseBugType;
+  std::unique_ptr<BugType> LeakBugType;
 
   void initIdentifierInfo(ASTContext &Ctx) const;
 
index 96384904f6be8b782813ebde0d41f4cf99ac9cd6..44c873262d56497f31e881c9f8d69f70bbe4b225 100644 (file)
@@ -28,8 +28,8 @@ using namespace ento;
 namespace {
 class StackAddrEscapeChecker : public Checker< check::PreStmt<ReturnStmt>,
                                                check::EndFunction > {
-  mutable OwningPtr<BuiltinBug> BT_stackleak;
-  mutable OwningPtr<BuiltinBug> BT_returnstack;
+  mutable std::unique_ptr<BuiltinBug> BT_stackleak;
+  mutable std::unique_ptr<BuiltinBug> BT_returnstack;
 
 public:
   void checkPreStmt(const ReturnStmt *RS, CheckerContext &C) const;
index 17d6d8e1d573a0868275ece5f938c25e9920ad18..600094200447c453e9c6b969f9e7140cb2ac0253 100644 (file)
@@ -62,8 +62,8 @@ class StreamChecker : public Checker<eval::Call,
                  *II_fwrite, 
                  *II_fseek, *II_ftell, *II_rewind, *II_fgetpos, *II_fsetpos,  
                  *II_clearerr, *II_feof, *II_ferror, *II_fileno;
-  mutable OwningPtr<BuiltinBug> BT_nullfp, BT_illegalwhence,
-                                      BT_doubleclose, BT_ResourceLeak;
+  mutable std::unique_ptr<BuiltinBug> BT_nullfp, BT_illegalwhence,
+      BT_doubleclose, BT_ResourceLeak;
 
 public:
   StreamChecker() 
index 2d261ca62cfa7ed45eb4ff28d532d9c7fe9c30b7..d33c977826a5bc507a1d0be14543f95b7916b1f3 100644 (file)
@@ -22,7 +22,7 @@ using namespace ento;
 namespace {
 class TaintTesterChecker : public Checker< check::PostStmt<Expr> > {
 
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
   void initBugType() const;
 
   /// Given a pointer argument, get the symbol of the value it contains
index 410390d0fc052d382bdae61924bcf24f06541a11..22e215590c50581248eea158e124315a836c836b 100644 (file)
@@ -24,7 +24,7 @@ using namespace ento;
 namespace {
 
 class UndefBranchChecker : public Checker<check::BranchCondition> {
-  mutable OwningPtr<BuiltinBug> BT;
+  mutable std::unique_ptr<BuiltinBug> BT;
 
   struct FindUndefExpr {
     ProgramStateRef St;
index 927f28da3d4dbd43655f772a78725b3f23ce3a93..93fe7d40a1e8b2c7a9bfbe181d13d406d19feee9 100644 (file)
@@ -27,7 +27,7 @@ using namespace ento;
 namespace {
 class UndefCapturedBlockVarChecker
   : public Checker< check::PostStmt<BlockExpr> > {
mutable OwningPtr<BugType> BT;
 mutable std::unique_ptr<BugType> BT;
 
 public:
   void checkPostStmt(const BlockExpr *BE, CheckerContext &C) const;
index fd3c8f15381a00951508c4d5ec1fef285f1f7233..00fd97196950bfa6aeff253a9bd255f1dce62950 100644 (file)
@@ -28,8 +28,8 @@ namespace {
 class UndefResultChecker 
   : public Checker< check::PostStmt<BinaryOperator> > {
 
-  mutable OwningPtr<BugType> BT;
-  
+  mutable std::unique_ptr<BugType> BT;
+
 public:
   void checkPostStmt(const BinaryOperator *B, CheckerContext &C) const;
 };
index 3468e67f3c6c1a3931273ab8c92b9be46b8f358e..e952671efffcac8d3c131556f28c31a21756ceb7 100644 (file)
@@ -25,7 +25,7 @@ using namespace ento;
 namespace {
 class UndefinedArraySubscriptChecker
   : public Checker< check::PreStmt<ArraySubscriptExpr> > {
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
 
 public:
   void checkPreStmt(const ArraySubscriptExpr *A, CheckerContext &C) const;
index b06ecb0576180b06af0adc4610604641212c5d6e..30775d57ce015f23268a24b4deda11fe61befa13 100644 (file)
@@ -24,7 +24,7 @@ using namespace ento;
 namespace {
 class UndefinedAssignmentChecker
   : public Checker<check::Bind> {
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
 
 public:
   void checkBind(SVal location, SVal val, const Stmt *S,
index bdf789d7889db94c6373f5663cdd177c4545768c..8869654e9ca4f3c1f7fd31213b71b711cff700e5 100644 (file)
@@ -30,7 +30,7 @@ using namespace ento;
 
 namespace {
 class UnixAPIChecker : public Checker< check::PreStmt<CallExpr> > {
-  mutable OwningPtr<BugType> BT_open, BT_pthreadOnce, BT_mallocZero;
+  mutable std::unique_ptr<BugType> BT_open, BT_pthreadOnce, BT_mallocZero;
   mutable Optional<uint64_t> Val_O_CREAT;
 
 public:
@@ -57,7 +57,7 @@ private:
                             const unsigned numArgs,
                             const unsigned sizeArg,
                             const char *fn) const;
-  void LazyInitialize(OwningPtr<BugType> &BT, const char *name) const {
+  void LazyInitialize(std::unique_ptr<BugType> &BT, const char *name) const {
     if (BT)
       return;
     BT.reset(new BugType(this, name, categories::UnixAPI));
index 966715be0f669d6c979a8c717b9ef45f5a0a972c..c7b2024e34c46122c9a87de4e1272f2f6c52abac 100644 (file)
@@ -29,7 +29,7 @@ using namespace ento;
 
 namespace {
 class VLASizeChecker : public Checker< check::PreStmt<DeclStmt> > {
-  mutable OwningPtr<BugType> BT;
+  mutable std::unique_ptr<BugType> BT;
   enum VLASize_Kind { VLA_Garbage, VLA_Zero, VLA_Tainted };
 
   void reportBug(VLASize_Kind Kind,
index 176826d6b961a016f446d01c29a0c905a316e5ca..e3f42870563cf0374c067b8f0135bc96d4426f14 100644 (file)
@@ -2816,7 +2816,7 @@ namespace {
 class ReportGraph {
 public:
   InterExplodedGraphMap BackMap;
-  OwningPtr<ExplodedGraph> Graph;
+  std::unique_ptr<ExplodedGraph> Graph;
   const ExplodedNode *ErrorNode;
   size_t Index;
 };
@@ -2831,7 +2831,7 @@ class TrimmedGraph {
   typedef std::pair<const ExplodedNode *, size_t> NodeIndexPair;
   SmallVector<NodeIndexPair, 32> ReportNodes;
 
-  OwningPtr<ExplodedGraph> G;
+  std::unique_ptr<ExplodedGraph> G;
 
   /// A helper class for sorting ExplodedNodes by priority.
   template <bool Descending>
@@ -3415,15 +3415,13 @@ void BugReporter::FlushReport(BugReport *exampleReport,
   // Probably doesn't make a difference in practice.
   BugType& BT = exampleReport->getBugType();
 
-  OwningPtr<PathDiagnostic>
-    D(new PathDiagnostic(exampleReport->getBugType().getCheckName(),
-                         exampleReport->getDeclWithIssue(),
-                         exampleReport->getBugType().getName(),
-                         exampleReport->getDescription(),
-                         exampleReport->getShortDescription(/*Fallback=*/false),
-                         BT.getCategory(),
-                         exampleReport->getUniqueingLocation(),
-                         exampleReport->getUniqueingDecl()));
+  std::unique_ptr<PathDiagnostic> D(new PathDiagnostic(
+      exampleReport->getBugType().getCheckName(),
+      exampleReport->getDeclWithIssue(), exampleReport->getBugType().getName(),
+      exampleReport->getDescription(),
+      exampleReport->getShortDescription(/*Fallback=*/false), BT.getCategory(),
+      exampleReport->getUniqueingLocation(),
+      exampleReport->getUniqueingDecl()));
 
   MaxBugClassSize = std::max(bugReports.size(),
                              static_cast<size_t>(MaxBugClassSize));
index fde466a5279b28fa0b2f0910629949a8840d1b61..85c7b526656adb969b7044c1958f8e411506f787 100644 (file)
@@ -2550,7 +2550,7 @@ void ExprEngine::ViewGraph(ArrayRef<const ExplodedNode*> Nodes) {
   GraphPrintCheckerState = this;
   GraphPrintSourceManager = &getContext().getSourceManager();
 
-  OwningPtr<ExplodedGraph> TrimmedG(G.trim(Nodes));
+  std::unique_ptr<ExplodedGraph> TrimmedG(G.trim(Nodes));
 
   if (!TrimmedG.get())
     llvm::errs() << "warning: Trimmed ExplodedGraph is empty.\n";
index 8c08e75004d5e35622623ae7c39ed7d6383d6757..89e4309175301d41f59e111875886bf7e6496b4a 100644 (file)
@@ -197,8 +197,8 @@ PathDiagnosticConsumer::~PathDiagnosticConsumer() {
 }
 
 void PathDiagnosticConsumer::HandlePathDiagnostic(PathDiagnostic *D) {
-  OwningPtr<PathDiagnostic> OwningD(D);
-  
+  std::unique_ptr<PathDiagnostic> OwningD(D);
+
   if (!D || D->path.empty())
     return;
   
index e3977c23f73b019db80322f088b8ac7ba957face..c6e6bfd92cb0bc60297d20db516504778bca8c14 100644 (file)
@@ -171,8 +171,8 @@ public:
   StoreManagerCreator CreateStoreMgr;
   ConstraintManagerCreator CreateConstraintMgr;
 
-  OwningPtr<CheckerManager> checkerMgr;
-  OwningPtr<AnalysisManager> Mgr;
+  std::unique_ptr<CheckerManager> checkerMgr;
+  std::unique_ptr<AnalysisManager> Mgr;
 
   /// Time the analyzes time of each translation unit.
   static llvm::Timer* TUTotalTimer;
@@ -641,7 +641,7 @@ void AnalysisConsumer::ActionExprEngine(Decl *D, bool ObjCGCEnabled,
   ExprEngine Eng(*Mgr, ObjCGCEnabled, VisitedCallees, &FunctionSummaries,IMode);
 
   // Set the graph auditor.
-  OwningPtr<ExplodedNode::Auditor> Auditor;
+  std::unique_ptr<ExplodedNode::Auditor> Auditor;
   if (Mgr->options.visualizeExplodedGraphWithUbiGraph) {
     Auditor.reset(CreateUbiViz());
     ExplodedNode::SetAuditor(Auditor.get());
@@ -704,7 +704,7 @@ ento::CreateAnalysisConsumer(const Preprocessor &pp, const std::string &outDir,
 namespace {
 
 class UbigraphViz : public ExplodedNode::Auditor {
-  OwningPtr<raw_ostream> Out;
+  std::unique_ptr<raw_ostream> Out;
   std::string Filename;
   unsigned Cntr;
 
@@ -727,7 +727,7 @@ static ExplodedNode::Auditor* CreateUbiViz() {
   llvm::sys::fs::createTemporaryFile("llvm_ubi", "", FD, P);
   llvm::errs() << "Writing '" << P.str() << "'.\n";
 
-  OwningPtr<llvm::raw_fd_ostream> Stream;
+  std::unique_ptr<llvm::raw_fd_ostream> Stream;
   Stream.reset(new llvm::raw_fd_ostream(FD, true));
 
   return new UbigraphViz(Stream.release(), P);
index d7cb914822830c4de45a38d6e410d27e61d99e9c..836007bf46c1665300b25b3e6d03c958b9e31bfd 100644 (file)
@@ -104,8 +104,8 @@ CheckerManager *ento::createCheckerManager(AnalyzerOptions &opts,
                                            const LangOptions &langOpts,
                                            ArrayRef<std::string> plugins,
                                            DiagnosticsEngine &diags) {
-  OwningPtr<CheckerManager> checkerMgr(new CheckerManager(langOpts,
-                                                          &opts));
+  std::unique_ptr<CheckerManager> checkerMgr(
+      new CheckerManager(langOpts, &opts));
 
   SmallVector<CheckerOptInfo, 8> checkerOpts;
   for (unsigned i = 0, e = opts.CheckersControlList.size(); i != e; ++i) {
index 76c006f389d50a0624b5023055d9af5b896676d5..57424e37e930fe9432df942b564e852fdf5b0cca 100644 (file)
@@ -43,7 +43,7 @@ CompilationDatabase::loadFromDirectory(StringRef BuildDirectory,
        Ie = CompilationDatabasePluginRegistry::end();
        It != Ie; ++It) {
     std::string DatabaseErrorMessage;
-    OwningPtr<CompilationDatabasePlugin> Plugin(It->instantiate());
+    std::unique_ptr<CompilationDatabasePlugin> Plugin(It->instantiate());
     if (CompilationDatabase *DB =
         Plugin->loadFromDirectory(BuildDirectory, DatabaseErrorMessage))
       return DB;
@@ -213,7 +213,7 @@ static bool stripPositionalArgs(std::vector<const char *> Args,
 
   // Neither clang executable nor default image name are required since the
   // jobs the driver builds will not be executed.
-  OwningPtr<driver::Driver> NewDriver(new driver::Driver(
+  std::unique_ptr<driver::Driver> NewDriver(new driver::Driver(
       /* ClangExecutable= */ "", llvm::sys::getDefaultTargetTriple(),
       /* DefaultImageName= */ "", Diagnostics));
   NewDriver->setCheckInputsExist(false);
@@ -241,7 +241,7 @@ static bool stripPositionalArgs(std::vector<const char *> Args,
   std::remove_if(Args.begin(), Args.end(),
                  MatchesAny(std::string("-no-integrated-as")));
 
-  const OwningPtr<driver::Compilation> Compilation(
+  const std::unique_ptr<driver::Compilation> Compilation(
       NewDriver->BuildCompilation(Args));
 
   const driver::JobList &Jobs = Compilation->getJobs();
index 232c329de2345d657b6e6912d21b4d4435bd7284..04568757d4faa342e6a495829aaecce5b740442f 100644 (file)
@@ -122,7 +122,7 @@ class JSONCompilationDatabasePlugin : public CompilationDatabasePlugin {
       StringRef Directory, std::string &ErrorMessage) {
     SmallString<1024> JSONDatabasePath(Directory);
     llvm::sys::path::append(JSONDatabasePath, "compile_commands.json");
-    OwningPtr<CompilationDatabase> Database(
+    std::unique_ptr<CompilationDatabase> Database(
         JSONCompilationDatabase::loadFromFile(JSONDatabasePath, ErrorMessage));
     if (!Database)
       return NULL;
@@ -144,14 +144,14 @@ volatile int JSONAnchorSource = 0;
 JSONCompilationDatabase *
 JSONCompilationDatabase::loadFromFile(StringRef FilePath,
                                       std::string &ErrorMessage) {
-  OwningPtr<llvm::MemoryBuffer> DatabaseBuffer;
+  std::unique_ptr<llvm::MemoryBuffer> DatabaseBuffer;
   llvm::error_code Result =
     llvm::MemoryBuffer::getFile(FilePath, DatabaseBuffer);
   if (Result != 0) {
     ErrorMessage = "Error while opening JSON database: " + Result.message();
     return NULL;
   }
-  OwningPtr<JSONCompilationDatabase> Database(
+  std::unique_ptr<JSONCompilationDatabase> Database(
       new JSONCompilationDatabase(DatabaseBuffer.release()));
   if (!Database->parse(ErrorMessage))
     return NULL;
@@ -161,9 +161,9 @@ JSONCompilationDatabase::loadFromFile(StringRef FilePath,
 JSONCompilationDatabase *
 JSONCompilationDatabase::loadFromBuffer(StringRef DatabaseString,
                                         std::string &ErrorMessage) {
-  OwningPtr<llvm::MemoryBuffer> DatabaseBuffer(
+  std::unique_ptr<llvm::MemoryBuffer> DatabaseBuffer(
       llvm::MemoryBuffer::getMemBuffer(DatabaseString));
-  OwningPtr<JSONCompilationDatabase> Database(
+  std::unique_ptr<JSONCompilationDatabase> Database(
       new JSONCompilationDatabase(DatabaseBuffer.release()));
   if (!Database->parse(ErrorMessage))
     return NULL;
index 9783ed0fe0e05af3a458772b7a2c9c898c888de8..c720bf4e8516a127bac3a3e1ae2fa5a327576367 100644 (file)
@@ -207,18 +207,18 @@ bool ToolInvocation::run() {
       IntrusiveRefCntPtr<clang::DiagnosticIDs>(new DiagnosticIDs()), &*DiagOpts,
       DiagConsumer ? DiagConsumer : &DiagnosticPrinter, false);
 
-  const OwningPtr<clang::driver::Driver> Driver(
+  const std::unique_ptr<clang::driver::Driver> Driver(
       newDriver(&Diagnostics, BinaryName));
   // Since the input might only be virtual, don't check whether it exists.
   Driver->setCheckInputsExist(false);
-  const OwningPtr<clang::driver::Compilation> Compilation(
+  const std::unique_ptr<clang::driver::Compilation> Compilation(
       Driver->BuildCompilation(llvm::makeArrayRef(Argv)));
   const llvm::opt::ArgStringList *const CC1Args = getCC1Arguments(
       &Diagnostics, Compilation.get());
   if (CC1Args == NULL) {
     return false;
   }
-  OwningPtr<clang::CompilerInvocation> Invocation(
+  std::unique_ptr<clang::CompilerInvocation> Invocation(
       newInvocation(&Diagnostics, *CC1Args));
   for (llvm::StringMap<StringRef>::const_iterator
            It = MappedFileContents.begin(), End = MappedFileContents.end();
@@ -255,8 +255,8 @@ bool FrontendActionFactory::runInvocation(CompilerInvocation *Invocation,
 
   // The FrontendAction can have lifetime requirements for Compiler or its
   // members, and we need to ensure it's deleted earlier than Compiler. So we
-  // pass it to an OwningPtr declared after the Compiler variable.
-  OwningPtr<FrontendAction> ScopedToolAction(create());
+  // pass it to an std::unique_ptr declared after the Compiler variable.
+  std::unique_ptr<FrontendAction> ScopedToolAction(create());
 
   // Create the compilers actual diagnostics engine.
   Compiler.createDiagnostics(DiagConsumer, /*ShouldOwnClient=*/false);
index 50426e3f420257523efd126f46cea92c8d306506..518d06f2ad59a17d372885d8993371a117d75a5b 100644 (file)
@@ -178,7 +178,7 @@ static bool performTransformations(StringRef resourcesPath,
                                  origCI.getMigratorOpts().NoFinalizeRemoval);
   assert(!transforms.empty());
 
-  OwningPtr<PrintTransforms> transformPrinter;
+  std::unique_ptr<PrintTransforms> transformPrinter;
   if (OutputTransformations)
     transformPrinter.reset(new PrintTransforms(llvm::outs()));
 
@@ -207,12 +207,12 @@ static bool performTransformations(StringRef resourcesPath,
 static bool filesCompareEqual(StringRef fname1, StringRef fname2) {
   using namespace llvm;
 
-  OwningPtr<MemoryBuffer> file1;
+  std::unique_ptr<MemoryBuffer> file1;
   MemoryBuffer::getFile(fname1, file1);
   if (!file1)
     return false;
-  
-  OwningPtr<MemoryBuffer> file2;
+
+  std::unique_ptr<MemoryBuffer> file2;
   MemoryBuffer::getFile(fname2, file2);
   if (!file2)
     return false;
@@ -238,7 +238,7 @@ static bool verifyTransformedFiles(ArrayRef<std::string> resultFiles) {
     resultMap[sys::path::stem(fname)] = fname;
   }
 
-  OwningPtr<MemoryBuffer> inputBuf;
+  std::unique_ptr<MemoryBuffer> inputBuf;
   if (RemappingsFile.empty())
     MemoryBuffer::getSTDIN(inputBuf);
   else
index 9cdaf878a2c27a72dd6484c3aec01f8b4c8dae30..011cd3fad841f4ab9196946754aa41f7d3c6af4f 100644 (file)
@@ -50,7 +50,7 @@ static cl::extrahelp MoreHelp(
 );
 
 static cl::OptionCategory ClangCheckCategory("clang-check options");
-static OwningPtr<opt::OptTable> Options(createDriverOptTable());
+static std::unique_ptr<opt::OptTable> Options(createDriverOptTable());
 static cl::opt<bool>
 ASTDump("ast-dump", cl::desc(Options->getOptionHelpText(options::OPT_ast_dump)),
         cl::cat(ClangCheckCategory));
index 9107fd2b109f4be7956f5689a37f2683cd4da118..6f94461aba3dc642942557b2d8a0bb1470417c80 100644 (file)
@@ -208,7 +208,7 @@ static bool format(StringRef FileName) {
       IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs),
       new DiagnosticOptions);
   SourceManager Sources(Diagnostics, Files);
-  OwningPtr<MemoryBuffer> Code;
+  std::unique_ptr<MemoryBuffer> Code;
   if (error_code ec = MemoryBuffer::getFileOrSTDIN(FileName, Code)) {
     llvm::errs() << ec.message() << "\n";
     return true;
index 51213a41fc59f780e117883c10822919b4b204c1..ad56b0360442b5591d663aeeb9ee4615cf07323b 100644 (file)
@@ -64,9 +64,9 @@ createDiagnostics(unsigned int argc, char **argv) {
     new DiagnosticsEngine(DiagIDs, new DiagnosticOptions(), DiagsBuffer));
 
   // Try to build a CompilerInvocation.
-  OwningPtr<CompilerInvocation> Invocation(
-    createInvocationFromCommandLine(ArrayRef<const char *>(argv, argc),
-                                    InterimDiags));
+  std::unique_ptr<CompilerInvocation> Invocation(
+      createInvocationFromCommandLine(ArrayRef<const char *>(argv, argc),
+                                      InterimDiags));
   if (!Invocation)
     return NULL;
 
index 8738e0afecf9d48a819e705a856bab78f32777d8..1c37c7ddeeddb15568e8907da5622a484d8e87ff 100644 (file)
@@ -59,7 +59,7 @@ static void LLVMErrorHandler(void *UserData, const std::string &Message,
 
 int cc1_main(const char **ArgBegin, const char **ArgEnd,
              const char *Argv0, void *MainAddr) {
-  OwningPtr<CompilerInstance> Clang(new CompilerInstance());
+  std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
   IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
 
   // Initialize targets first, so that --version shows registered targets.
index e68bd025925223bad9399ba253d2727a16b666c8..7d6af7925f232d74ac2f8cbf4d3d7ec81ecda7b1 100644 (file)
@@ -151,10 +151,10 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
   bool Success = true;
 
   // Parse the arguments.
-  OwningPtr<OptTable> OptTbl(createCC1AsOptTable());
+  std::unique_ptr<OptTable> OptTbl(createCC1AsOptTable());
   unsigned MissingArgIndex, MissingArgCount;
-  OwningPtr<InputArgList> Args(
-    OptTbl->ParseArgs(ArgBegin, ArgEnd,MissingArgIndex, MissingArgCount));
+  std::unique_ptr<InputArgList> Args(
+      OptTbl->ParseArgs(ArgBegin, ArgEnd, MissingArgIndex, MissingArgCount));
 
   // Check for missing argument error.
   if (MissingArgCount) {
@@ -271,7 +271,7 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
     return false;
   }
 
-  OwningPtr<MemoryBuffer> BufferPtr;
+  std::unique_ptr<MemoryBuffer> BufferPtr;
   if (error_code ec = MemoryBuffer::getFileOrSTDIN(Opts.InputFile, BufferPtr)) {
     Error = ec.message();
     Diags.Report(diag::err_fe_error_reading) << Opts.InputFile;
@@ -288,10 +288,10 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
   // it later.
   SrcMgr.setIncludeDirs(Opts.IncludePaths);
 
-  OwningPtr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(Opts.Triple));
+  std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(Opts.Triple));
   assert(MRI && "Unable to create target register info!");
 
-  OwningPtr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, Opts.Triple));
+  std::unique_ptr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, Opts.Triple));
   assert(MAI && "Unable to create target asm info!");
 
   bool IsBinary = Opts.OutputType == AssemblerInvocation::FT_Obj;
@@ -301,7 +301,7 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
 
   // FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and
   // MCObjectFileInfo needs a MCContext reference in order to initialize itself.
-  OwningPtr<MCObjectFileInfo> MOFI(new MCObjectFileInfo());
+  std::unique_ptr<MCObjectFileInfo> MOFI(new MCObjectFileInfo());
   MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &SrcMgr);
   // FIXME: Assembler behavior can change with -static.
   MOFI->InitMCObjectFileInfo(Opts.Triple,
@@ -327,11 +327,11 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
       FS += "," + Opts.Features[i];
   }
 
-  OwningPtr<MCStreamer> Str;
+  std::unique_ptr<MCStreamer> Str;
 
-  OwningPtr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());
-  OwningPtr<MCSubtargetInfo>
-    STI(TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS));
+  std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());
+  std::unique_ptr<MCSubtargetInfo> STI(
+      TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS));
 
   // FIXME: There is a bit of code duplication with addPassesToEmitFile.
   if (Opts.OutputType == AssemblerInvocation::FT_Asm) {
@@ -363,9 +363,10 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
     Str.get()->InitSections();
   }
 
-  OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr, Ctx,
-                                                  *Str.get(), *MAI));
-  OwningPtr<MCTargetAsmParser> TAP(TheTarget->createMCAsmParser(*STI, *Parser, *MCII));
+  std::unique_ptr<MCAsmParser> Parser(
+      createMCAsmParser(SrcMgr, Ctx, *Str.get(), *MAI));
+  std::unique_ptr<MCTargetAsmParser> TAP(
+      TheTarget->createMCAsmParser(*STI, *Parser, *MCII));
   if (!TAP) {
     Diags.Report(diag::err_target_unknown_triple) << Opts.Triple;
     return false;
@@ -427,7 +428,7 @@ int cc1as_main(const char **ArgBegin, const char **ArgEnd,
 
   // Honor -help.
   if (Asm.ShowHelp) {
-    OwningPtr<OptTable> Opts(driver::createCC1AsOptTable());
+    std::unique_ptr<OptTable> Opts(driver::createCC1AsOptTable());
     Opts->PrintHelp(llvm::outs(), "clang -cc1as", "Clang Integrated Assembler");
     return 0;
   }
index 90e3371a14fe0c62d9fb7070cfc6a70cc63640d5..6fca3ecbed9fd540f86ef2996c091b45c494207f 100644 (file)
@@ -341,11 +341,10 @@ int main(int argc_, const char **argv_) {
 
   IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions;
   {
-    OwningPtr<OptTable> Opts(createDriverOptTable());
+    std::unique_ptr<OptTable> Opts(createDriverOptTable());
     unsigned MissingArgIndex, MissingArgCount;
-    OwningPtr<InputArgList> Args(Opts->ParseArgs(argv.begin()+1, argv.end(),
-                                                 MissingArgIndex,
-                                                 MissingArgCount));
+    std::unique_ptr<InputArgList> Args(Opts->ParseArgs(
+        argv.begin() + 1, argv.end(), MissingArgIndex, MissingArgCount));
     // We ignore MissingArgCount and the return value of ParseDiagnosticArgs.
     // Any errors that would be diagnosed here will also be diagnosed later,
     // when the DiagnosticsEngine actually exists.
@@ -408,7 +407,7 @@ int main(int argc_, const char **argv_) {
   if (TheDriver.CCLogDiagnostics)
     TheDriver.CCLogDiagnosticsFilename = ::getenv("CC_LOG_DIAGNOSTICS_FILE");
 
-  OwningPtr<Compilation> C(TheDriver.BuildCompilation(argv));
+  std::unique_ptr<Compilation> C(TheDriver.BuildCompilation(argv));
   int Res = 0;
   SmallVector<std::pair<int, const Command *>, 4> FailingCommands;
   if (C.get())
index 1b80b2f5c32039e6565db06919fbf8aa441884d6..dbb604d7972dafa8acbeb20772de1685152f2a90 100644 (file)
@@ -55,7 +55,7 @@ CXRemapping clang_getRemappings(const char *migrate_dir_path) {
   }
 
   TextDiagnosticBuffer diagBuffer;
-  OwningPtr<Remap> remap(new Remap());
+  std::unique_ptr<Remap> remap(new Remap());
 
   bool err = arcmt::getFileRemappings(remap->Vec, migrate_dir_path,&diagBuffer);
 
@@ -77,7 +77,7 @@ CXRemapping clang_getRemappingsFromFileList(const char **filePaths,
                                             unsigned numFiles) {
   bool Logging = ::getenv("LIBCLANG_LOGGING");
 
-  OwningPtr<Remap> remap(new Remap());
+  std::unique_ptr<Remap> remap(new Remap());
 
   if (numFiles == 0) {
     if (Logging)
index 614bb0cbfc97b8fb0201b99d28fde9fd364ff530..d98acb197fa140e796a35d856aeff191c6143b7f 100644 (file)
@@ -2723,8 +2723,8 @@ static void clang_parseTranslationUnit_Impl(void *UserData) {
     llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> >
     DiagCleanup(Diags.getPtr());
 
-  OwningPtr<std::vector<ASTUnit::RemappedFile> >
-    RemappedFiles(new std::vector<ASTUnit::RemappedFile>());
+  std::unique_ptr<std::vector<ASTUnit::RemappedFile>> RemappedFiles(
+      new std::vector<ASTUnit::RemappedFile>());
 
   // Recover resources if we crash before exiting this function.
   llvm::CrashRecoveryContextCleanupRegistrar<
@@ -2738,8 +2738,8 @@ static void clang_parseTranslationUnit_Impl(void *UserData) {
                                             Buffer));
   }
 
-  OwningPtr<std::vector<const char *> >
-    Args(new std::vector<const char*>());
+  std::unique_ptr<std::vector<const char *>> Args(
+      new std::vector<const char *>());
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<std::vector<const char*> >
@@ -2779,26 +2779,17 @@ static void clang_parseTranslationUnit_Impl(void *UserData) {
   }
   
   unsigned NumErrors = Diags->getClient()->getNumErrors();
-  OwningPtr<ASTUnit> ErrUnit;
-  OwningPtr<ASTUnit> Unit(
-    ASTUnit::LoadFromCommandLine(Args->size() ? &(*Args)[0] : 0 
-                                 /* vector::data() not portable */,
-                                 Args->size() ? (&(*Args)[0] + Args->size()) :0,
-                                 Diags,
-                                 CXXIdx->getClangResourcesPath(),
-                                 CXXIdx->getOnlyLocalDecls(),
-                                 /*CaptureDiagnostics=*/true,
-                                 *RemappedFiles.get(),
-                                 /*RemappedFilesKeepOriginalName=*/true,
-                                 PrecompilePreamble,
-                                 TUKind,
-                                 CacheCodeCompletionResults,
-                                 IncludeBriefCommentsInCodeCompletion,
-                                 /*AllowPCHWithCompilerErrors=*/true,
-                                 SkipFunctionBodies,
-                                 /*UserFilesAreVolatile=*/true,
-                                 ForSerialization,
-                                 &ErrUnit));
+  std::unique_ptr<ASTUnit> ErrUnit;
+  std::unique_ptr<ASTUnit> Unit(ASTUnit::LoadFromCommandLine(
+      Args->size() ? &(*Args)[0] : 0
+          /* vector::data() not portable */,
+      Args->size() ? (&(*Args)[0] + Args->size()) : 0, Diags,
+      CXXIdx->getClangResourcesPath(), CXXIdx->getOnlyLocalDecls(),
+      /*CaptureDiagnostics=*/true, *RemappedFiles.get(),
+      /*RemappedFilesKeepOriginalName=*/true, PrecompilePreamble, TUKind,
+      CacheCodeCompletionResults, IncludeBriefCommentsInCodeCompletion,
+      /*AllowPCHWithCompilerErrors=*/true, SkipFunctionBodies,
+      /*UserFilesAreVolatile=*/true, ForSerialization, &ErrUnit));
 
   if (NumErrors != Diags->getClient()->getNumErrors()) {
     // Make sure to check that 'Unit' is non-NULL.
@@ -3019,10 +3010,10 @@ static void clang_reparseTranslationUnit_Impl(void *UserData) {
 
   ASTUnit *CXXUnit = cxtu::getASTUnit(TU);
   ASTUnit::ConcurrencyCheck Check(*CXXUnit);
-  
-  OwningPtr<std::vector<ASTUnit::RemappedFile> >
-    RemappedFiles(new std::vector<ASTUnit::RemappedFile>());
-  
+
+  std::unique_ptr<std::vector<ASTUnit::RemappedFile>> RemappedFiles(
+      new std::vector<ASTUnit::RemappedFile>());
+
   // Recover resources if we crash before exiting this function.
   llvm::CrashRecoveryContextCleanupRegistrar<
     std::vector<ASTUnit::RemappedFile> > RemappedCleanup(RemappedFiles.get());
@@ -6524,7 +6515,7 @@ CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU) {
   }
   
   ASTUnit *astUnit = cxtu::getASTUnit(TU);
-  OwningPtr<MemUsageEntries> entries(new MemUsageEntries());
+  std::unique_ptr<MemUsageEntries> entries(new MemUsageEntries());
   ASTContext &astContext = astUnit->getASTContext();
   
   // How much memory is used by AST nodes and types?
index 2871256b0cbace2be46eb72847176b10eca3855c..679c5285263a036a77c0f743f35976c124cf025c 100644 (file)
@@ -259,7 +259,7 @@ CXDiagnosticSet DiagLoader::load(const char *file) {
   FileSystemOptions FO;
   FileManager FileMgr(FO);
 
-  OwningPtr<llvm::MemoryBuffer> Buffer;
+  std::unique_ptr<llvm::MemoryBuffer> Buffer;
   Buffer.reset(FileMgr.getBufferForFile(file));
 
   if (!Buffer) {
@@ -284,7 +284,8 @@ CXDiagnosticSet DiagLoader::load(const char *file) {
     return 0;
   }
 
-  OwningPtr<CXLoadedDiagnosticSetImpl> Diags(new CXLoadedDiagnosticSetImpl());
+  std::unique_ptr<CXLoadedDiagnosticSetImpl> Diags(
+      new CXLoadedDiagnosticSetImpl());
 
   while (true) {
     unsigned BlockID = 0;
@@ -539,8 +540,8 @@ LoadResult DiagLoader::readDiagnosticBlock(llvm::BitstreamCursor &Stream,
     reportInvalidFile("malformed diagnostic block");
     return Failure;
   }
-  
-  OwningPtr<CXLoadedDiagnostic> D(new CXLoadedDiagnostic());
+
+  std::unique_ptr<CXLoadedDiagnostic> D(new CXLoadedDiagnostic());
   RecordData Record;
   
   while (true) {
index 29ecd1ccc78cb90945f99f3082cbbcc6988d3f0a..24c1362217207a9c2cc9e069a1af663369d56520 100644 (file)
@@ -411,7 +411,7 @@ class IndexingFrontendAction : public ASTFrontendAction {
   CXTranslationUnit CXTU;
 
   SessionSkipBodyData *SKData;
-  OwningPtr<TUSkipBodyControl> SKCtrl;
+  std::unique_ptr<TUSkipBodyControl> SKCtrl;
 
 public:
   IndexingFrontendAction(CXClientData clientData,
@@ -465,7 +465,7 @@ public:
 
 struct IndexSessionData {
   CXIndex CIdx;
-  OwningPtr<SessionSkipBodyData> SkipBodyData;
+  std::unique_ptr<SessionSkipBodyData> SkipBodyData;
 
   explicit IndexSessionData(CXIndex cIdx)
     : CIdx(cIdx), SkipBodyData(new SessionSkipBodyData) {}
@@ -559,9 +559,9 @@ static void clang_indexSourceFile_Impl(void *UserData) {
   llvm::CrashRecoveryContextCleanupRegistrar<DiagnosticsEngine,
     llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> >
     DiagCleanup(Diags.getPtr());
-  
-  OwningPtr<std::vector<const char *> >
-    Args(new std::vector<const char*>());
+
+  std::unique_ptr<std::vector<const char *>> Args(
+      new std::vector<const char *>());
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<std::vector<const char*> >
@@ -592,7 +592,7 @@ static void clang_indexSourceFile_Impl(void *UserData) {
   if (CInvok->getFrontendOpts().Inputs.empty())
     return;
 
-  OwningPtr<MemBufferOwner> BufOwner(new MemBufferOwner());
+  std::unique_ptr<MemBufferOwner> BufOwner(new MemBufferOwner());
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<MemBufferOwner>
@@ -618,7 +618,8 @@ static void clang_indexSourceFile_Impl(void *UserData) {
   ASTUnit *Unit = ASTUnit::create(CInvok.getPtr(), Diags,
                                   CaptureDiagnostics,
                                   /*UserFilesAreVolatile=*/true);
-  OwningPtr<CXTUOwner> CXTU(new CXTUOwner(MakeCXTranslationUnit(CXXIdx, Unit)));
+  std::unique_ptr<CXTUOwner> CXTU(
+      new CXTUOwner(MakeCXTranslationUnit(CXXIdx, Unit)));
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<CXTUOwner>
@@ -631,7 +632,7 @@ static void clang_indexSourceFile_Impl(void *UserData) {
   if (SkipBodies)
     CInvok->getFrontendOpts().SkipFunctionBodies = true;
 
-  OwningPtr<IndexingFrontendAction> IndexAction;
+  std::unique_ptr<IndexingFrontendAction> IndexAction;
   IndexAction.reset(new IndexingFrontendAction(client_data, CB,
                                                index_options, CXTU->getTU(),
                               SkipBodies ? IdxSession->SkipBodyData.get() : 0));
@@ -790,14 +791,14 @@ static void clang_indexTranslationUnit_Impl(void *UserData) {
                                   ? index_callbacks_size : sizeof(CB);
   memcpy(&CB, client_index_callbacks, ClientCBSize);
 
-  OwningPtr<IndexingContext> IndexCtx;
+  std::unique_ptr<IndexingContext> IndexCtx;
   IndexCtx.reset(new IndexingContext(client_data, CB, index_options, TU));
 
   // Recover resources if we crash before exiting this method.
   llvm::CrashRecoveryContextCleanupRegistrar<IndexingContext>
     IndexCtxCleanup(IndexCtx.get());
 
-  OwningPtr<IndexingConsumer> IndexConsumer;
+  std::unique_ptr<IndexingConsumer> IndexConsumer;
   IndexConsumer.reset(new IndexingConsumer(*IndexCtx, 0));
 
   // Recover resources if we crash before exiting this method.
index 5420d968ce27d3cfbd8e3420f247de8df04456e6..5340756c03dbc79dc4af8b2e155bf7f3188da79f 100644 (file)
@@ -74,7 +74,8 @@ public:
   PrintMatch Printer;
   MatchFinder Finder;
   Finder.addMatcher(NodeMatch, &Printer);
-  OwningPtr<FrontendActionFactory> Factory(newFrontendActionFactory(&Finder));
+  std::unique_ptr<FrontendActionFactory> Factory(
+      newFrontendActionFactory(&Finder));
 
   if (!runToolOnCodeWithArgs(Factory->create(), Code, Args, FileName))
     return testing::AssertionFailure()
index c845da2ca6077c7be736a507d10a5448193b23d4..87aeef47c61fb2ede51d8296188d046adc097b5b 100644 (file)
@@ -20,7 +20,7 @@ using namespace clang::tooling;
 
 TEST(Decl, CleansUpAPValues) {
   MatchFinder Finder;
-  llvm::OwningPtr<FrontendActionFactory> Factory(
+  std::unique_ptr<FrontendActionFactory> Factory(
       newFrontendActionFactory(&Finder));
 
   // This is a regression test for a memory leak in APValues for structs that
index 5a29cde227088d2ea9d1b30cd3ff306f26071f8a..0265f4a24a14d7c3711492d6661be7f8928f1ba3 100644 (file)
@@ -79,7 +79,7 @@ testing::AssertionResult MatchVerifier<NodeType>::match(
     std::vector<std::string>& Args, Language L) {
   MatchFinder Finder;
   Finder.addMatcher(AMatcher.bind(""), this);
-  OwningPtr<tooling::FrontendActionFactory> Factory(
+  std::unique_ptr<tooling::FrontendActionFactory> Factory(
       tooling::newFrontendActionFactory(&Finder));
 
   StringRef FileName;
index 5f54abd0c0bff66784d5726dc98875415a1daf5d..d7265176d12e0f7a5b8bbd18da329de613e80859 100644 (file)
@@ -72,7 +72,8 @@ PrintedStmtMatches(StringRef Code, const std::vector<std::string> &Args,
   PrintMatch Printer;
   MatchFinder Finder;
   Finder.addMatcher(NodeMatch, &Printer);
-  OwningPtr<FrontendActionFactory> Factory(newFrontendActionFactory(&Finder));
+  std::unique_ptr<FrontendActionFactory> Factory(
+      newFrontendActionFactory(&Finder));
 
   if (!runToolOnCodeWithArgs(Factory->create(), Code, Args))
     return testing::AssertionFailure()
index 2c656e12ad9009e2471ce95964a70e99ef39c30a..f1b792139d9854c075f8e33dd83cb3fae61e19e9 100644 (file)
@@ -4165,12 +4165,13 @@ TEST(MatchFinder, InterceptsStartOfTranslationUnit) {
   MatchFinder Finder;
   VerifyStartOfTranslationUnit VerifyCallback;
   Finder.addMatcher(decl(), &VerifyCallback);
-  OwningPtr<FrontendActionFactory> Factory(newFrontendActionFactory(&Finder));
+  std::unique_ptr<FrontendActionFactory> Factory(
+      newFrontendActionFactory(&Finder));
   ASSERT_TRUE(tooling::runToolOnCode(Factory->create(), "int x;"));
   EXPECT_TRUE(VerifyCallback.Called);
 
   VerifyCallback.Called = false;
-  OwningPtr<ASTUnit> AST(tooling::buildASTFromCode("int x;"));
+  std::unique_ptr<ASTUnit> AST(tooling::buildASTFromCode("int x;"));
   ASSERT_TRUE(AST.get());
   Finder.matchAST(AST->getASTContext());
   EXPECT_TRUE(VerifyCallback.Called);
@@ -4192,12 +4193,13 @@ TEST(MatchFinder, InterceptsEndOfTranslationUnit) {
   MatchFinder Finder;
   VerifyEndOfTranslationUnit VerifyCallback;
   Finder.addMatcher(decl(), &VerifyCallback);
-  OwningPtr<FrontendActionFactory> Factory(newFrontendActionFactory(&Finder));
+  std::unique_ptr<FrontendActionFactory> Factory(
+      newFrontendActionFactory(&Finder));
   ASSERT_TRUE(tooling::runToolOnCode(Factory->create(), "int x;"));
   EXPECT_TRUE(VerifyCallback.Called);
 
   VerifyCallback.Called = false;
-  OwningPtr<ASTUnit> AST(tooling::buildASTFromCode("int x;"));
+  std::unique_ptr<ASTUnit> AST(tooling::buildASTFromCode("int x;"));
   ASSERT_TRUE(AST.get());
   Finder.matchAST(AST->getASTContext());
   EXPECT_TRUE(VerifyCallback.Called);
index e79f9114f22d4a1b0a37eec6705bdeea0e2f8795..e224722e9649808cb2cd1f25445d77fdd0362c33 100644 (file)
@@ -67,7 +67,8 @@ testing::AssertionResult matchesConditionally(const std::string &Code,
   Finder.addMatcher(AMatcher, new VerifyMatch(0, &Found));
   if (!Finder.addDynamicMatcher(AMatcher, new VerifyMatch(0, &DynamicFound)))
     return testing::AssertionFailure() << "Could not add dynamic matcher";
-  OwningPtr<FrontendActionFactory> Factory(newFrontendActionFactory(&Finder));
+  std::unique_ptr<FrontendActionFactory> Factory(
+      newFrontendActionFactory(&Finder));
   // Some tests use typeof, which is a gnu extension.
   std::vector<std::string> Args(1, CompileArg);
   if (!runToolOnCodeWithArgs(Factory->create(), Code, Args)) {
@@ -105,12 +106,13 @@ testing::AssertionResult
 matchAndVerifyResultConditionally(const std::string &Code, const T &AMatcher,
                                   BoundNodesCallback *FindResultVerifier,
                                   bool ExpectResult) {
-  OwningPtr<BoundNodesCallback> ScopedVerifier(FindResultVerifier);
+  std::unique_ptr<BoundNodesCallback> ScopedVerifier(FindResultVerifier);
   bool VerifiedResult = false;
   MatchFinder Finder;
   Finder.addMatcher(
       AMatcher, new VerifyMatch(FindResultVerifier, &VerifiedResult));
-  OwningPtr<FrontendActionFactory> Factory(newFrontendActionFactory(&Finder));
+  std::unique_ptr<FrontendActionFactory> Factory(
+      newFrontendActionFactory(&Finder));
   // Some tests use typeof, which is a gnu extension.
   std::vector<std::string> Args(1, "-std=gnu++98");
   if (!runToolOnCodeWithArgs(Factory->create(), Code, Args)) {
@@ -125,7 +127,7 @@ matchAndVerifyResultConditionally(const std::string &Code, const T &AMatcher,
   }
 
   VerifiedResult = false;
-  OwningPtr<ASTUnit> AST(buildASTFromCodeWithArgs(Code, Args));
+  std::unique_ptr<ASTUnit> AST(buildASTFromCodeWithArgs(Code, Args));
   if (!AST.get())
     return testing::AssertionFailure() << "Parsing error in \"" << Code
                                        << "\" while building AST";
index 8426649d3e6589a49a671aa119fdcba687ace1c8..1d81f2f55b71191e93049f3958a709af23e24e08 100644 (file)
@@ -370,7 +370,7 @@ TEST_F(RegistryTest, VariadicOp) {
 
 TEST_F(RegistryTest, Errors) {
   // Incorrect argument count.
-  OwningPtr<Diagnostics> Error(new Diagnostics());
+  std::unique_ptr<Diagnostics> Error(new Diagnostics());
   EXPECT_TRUE(constructMatcher("hasInitializer", Error.get()).isNull());
   EXPECT_EQ("Incorrect argument count. (Expected = 1) != (Actual = 0)",
             Error->toString());
index c03ae6bd6c2e9a123c43084cbd2a17223dbad9b2..40d2f168cdf38ac89490dba6bad71e1cb4d68ef2 100644 (file)
@@ -38,11 +38,12 @@ public:
       return error_code(errc::no_such_file_or_directory, posix_category());
     return I->second;
   }
-  error_code openFileForRead(const Twine &Path, OwningPtr<vfs::File> &Result) {
+  error_code openFileForRead(const Twine &Path,
+                             std::unique_ptr<vfs::File> &Result) {
     llvm_unreachable("unimplemented");
   }
   error_code getBufferForFile(const Twine &Name,
-                              OwningPtr<MemoryBuffer> &Result,
+                              std::unique_ptr<MemoryBuffer> &Result,
                               int64_t FileSize = -1,
                               bool RequiresNullTerminator = true) {
     llvm_unreachable("unimplemented");
index bc8b211755d8a38a511927022f5f30da464cb44c..7cb5af1f1370ec1a87469baa746b121cd6ef6716 100644 (file)
@@ -137,7 +137,7 @@ public:
 class ExternalSemaSourceInstaller : public clang::ASTFrontendAction {
   std::vector<NamespaceDiagnosticWatcher *> Watchers;
   std::vector<clang::ExternalSemaSource *> Sources;
-  llvm::OwningPtr<DiagnosticConsumer> OwnedClient;
+  std::unique_ptr<DiagnosticConsumer> OwnedClient;
 
 protected:
   virtual clang::ASTConsumer *
@@ -178,7 +178,7 @@ public:
 
 // Make sure that the NamespaceDiagnosticWatcher is not miscounting.
 TEST(ExternalSemaSource, SanityCheck) {
-  llvm::OwningPtr<ExternalSemaSourceInstaller> Installer(
+  std::unique_ptr<ExternalSemaSourceInstaller> Installer(
       new ExternalSemaSourceInstaller);
   NamespaceDiagnosticWatcher Watcher("AAB", "BBB");
   Installer->PushWatcher(&Watcher);
@@ -191,7 +191,7 @@ TEST(ExternalSemaSource, SanityCheck) {
 // Check that when we add a NamespaceTypeProvider, we use that suggestion
 // instead of the usual suggestion we would use above.
 TEST(ExternalSemaSource, ExternalTypoCorrectionPrioritized) {
-  llvm::OwningPtr<ExternalSemaSourceInstaller> Installer(
+  std::unique_ptr<ExternalSemaSourceInstaller> Installer(
       new ExternalSemaSourceInstaller);
   NamespaceTypoProvider Provider("AAB", "BBB");
   NamespaceDiagnosticWatcher Watcher("AAB", "BBB");
@@ -207,7 +207,7 @@ TEST(ExternalSemaSource, ExternalTypoCorrectionPrioritized) {
 // Check that we use the first successful TypoCorrection returned from an
 // ExternalSemaSource.
 TEST(ExternalSemaSource, ExternalTypoCorrectionOrdering) {
-  llvm::OwningPtr<ExternalSemaSourceInstaller> Installer(
+  std::unique_ptr<ExternalSemaSourceInstaller> Installer(
       new ExternalSemaSourceInstaller);
   NamespaceTypoProvider First("XXX", "BBB");
   NamespaceTypoProvider Second("AAB", "CCC");
@@ -229,7 +229,7 @@ TEST(ExternalSemaSource, ExternalTypoCorrectionOrdering) {
 // We should only try MaybeDiagnoseMissingCompleteType if we can't otherwise
 // solve the problem.
 TEST(ExternalSemaSource, TryOtherTacticsBeforeDiagnosing) {
-  llvm::OwningPtr<ExternalSemaSourceInstaller> Installer(
+  std::unique_ptr<ExternalSemaSourceInstaller> Installer(
       new ExternalSemaSourceInstaller);
   CompleteTypeDiagnoser Diagnoser(false);
   Installer->PushSource(&Diagnoser);
@@ -246,7 +246,7 @@ TEST(ExternalSemaSource, TryOtherTacticsBeforeDiagnosing) {
 // The first ExternalSemaSource where MaybeDiagnoseMissingCompleteType returns
 // true should be the last one called.
 TEST(ExternalSemaSource, FirstDiagnoserTaken) {
-  llvm::OwningPtr<ExternalSemaSourceInstaller> Installer(
+  std::unique_ptr<ExternalSemaSourceInstaller> Installer(
       new ExternalSemaSourceInstaller);
   CompleteTypeDiagnoser First(false);
   CompleteTypeDiagnoser Second(true);
index 9260e621b38b9b316c5c667c2ae99bfa3ad1e147..9f078f41033a1192f97b9c7c0b9481575878b170 100644 (file)
@@ -42,7 +42,7 @@ TEST(JSONCompilationDatabase, ErrsOnInvalidFormat) {
 
 static std::vector<std::string> getAllFiles(StringRef JSONDatabase,
                                             std::string &ErrorMessage) {
-  OwningPtr<CompilationDatabase> Database(
+  std::unique_ptr<CompilationDatabase> Database(
       JSONCompilationDatabase::loadFromBuffer(JSONDatabase, ErrorMessage));
   if (!Database) {
     ADD_FAILURE() << ErrorMessage;
@@ -53,7 +53,7 @@ static std::vector<std::string> getAllFiles(StringRef JSONDatabase,
 
 static std::vector<CompileCommand> getAllCompileCommands(StringRef JSONDatabase,
                                                     std::string &ErrorMessage) {
-  OwningPtr<CompilationDatabase> Database(
+  std::unique_ptr<CompilationDatabase> Database(
       JSONCompilationDatabase::loadFromBuffer(JSONDatabase, ErrorMessage));
   if (!Database) {
     ADD_FAILURE() << ErrorMessage;
@@ -115,7 +115,7 @@ TEST(JSONCompilationDatabase, GetAllCompileCommands) {
 static CompileCommand findCompileArgsInJsonDatabase(StringRef FileName,
                                                     StringRef JSONDatabase,
                                                     std::string &ErrorMessage) {
-  OwningPtr<CompilationDatabase> Database(
+  std::unique_ptr<CompilationDatabase> Database(
       JSONCompilationDatabase::loadFromBuffer(JSONDatabase, ErrorMessage));
   if (!Database)
     return CompileCommand();
@@ -433,7 +433,7 @@ TEST(FixedCompilationDatabase, GetAllCompileCommands) {
 
 TEST(ParseFixedCompilationDatabase, ReturnsNullOnEmptyArgumentList) {
   int Argc = 0;
-  OwningPtr<FixedCompilationDatabase> Database(
+  std::unique_ptr<FixedCompilationDatabase> Database(
       FixedCompilationDatabase::loadFromCommandLine(Argc, NULL));
   EXPECT_FALSE(Database);
   EXPECT_EQ(0, Argc);
@@ -442,7 +442,7 @@ TEST(ParseFixedCompilationDatabase, ReturnsNullOnEmptyArgumentList) {
 TEST(ParseFixedCompilationDatabase, ReturnsNullWithoutDoubleDash) {
   int Argc = 2;
   const char *Argv[] = { "1", "2" };
-  OwningPtr<FixedCompilationDatabase> Database(
+  std::unique_ptr<FixedCompilationDatabase> Database(
       FixedCompilationDatabase::loadFromCommandLine(Argc, Argv));
   EXPECT_FALSE(Database);
   EXPECT_EQ(2, Argc);
@@ -453,7 +453,7 @@ TEST(ParseFixedCompilationDatabase, ReturnsArgumentsAfterDoubleDash) {
   const char *Argv[] = {
     "1", "2", "--\0no-constant-folding", "-DDEF3", "-DDEF4"
   };
-  OwningPtr<FixedCompilationDatabase> Database(
+  std::unique_ptr<FixedCompilationDatabase> Database(
       FixedCompilationDatabase::loadFromCommandLine(Argc, Argv));
   ASSERT_TRUE((bool)Database);
   std::vector<CompileCommand> Result =
@@ -472,7 +472,7 @@ TEST(ParseFixedCompilationDatabase, ReturnsArgumentsAfterDoubleDash) {
 TEST(ParseFixedCompilationDatabase, ReturnsEmptyCommandLine) {
   int Argc = 3;
   const char *Argv[] = { "1", "2", "--\0no-constant-folding" };
-  OwningPtr<FixedCompilationDatabase> Database(
+  std::unique_ptr<FixedCompilationDatabase> Database(
       FixedCompilationDatabase::loadFromCommandLine(Argc, Argv));
   ASSERT_TRUE((bool)Database);
   std::vector<CompileCommand> Result =
@@ -489,7 +489,7 @@ TEST(ParseFixedCompilationDatabase, ReturnsEmptyCommandLine) {
 TEST(ParseFixedCompilationDatabase, HandlesPositionalArgs) {
   const char *Argv[] = {"1", "2", "--", "-c", "somefile.cpp", "-DDEF3"};
   int Argc = sizeof(Argv) / sizeof(char*);
-  OwningPtr<FixedCompilationDatabase> Database(
+  std::unique_ptr<FixedCompilationDatabase> Database(
       FixedCompilationDatabase::loadFromCommandLine(Argc, Argv));
   ASSERT_TRUE((bool)Database);
   std::vector<CompileCommand> Result =
@@ -508,7 +508,7 @@ TEST(ParseFixedCompilationDatabase, HandlesPositionalArgs) {
 TEST(ParseFixedCompilationDatabase, HandlesArgv0) {
   const char *Argv[] = {"1", "2", "--", "mytool", "somefile.cpp"};
   int Argc = sizeof(Argv) / sizeof(char*);
-  OwningPtr<FixedCompilationDatabase> Database(
+  std::unique_ptr<FixedCompilationDatabase> Database(
       FixedCompilationDatabase::loadFromCommandLine(Argc, Argv));
   ASSERT_TRUE((bool)Database);
   std::vector<CompileCommand> Result =
index 9e086d869a6882b0c7414c0c1acdf24a7b78d6e5..c2b331c70afc66254900f3f1a8185068b57fecb2 100644 (file)
@@ -25,7 +25,7 @@ void expectRewritten(const std::string &Code,
                      RefactoringCallback &Callback) {
   MatchFinder Finder;
   Finder.addMatcher(AMatcher, &Callback);
-  OwningPtr<tooling::FrontendActionFactory> Factory(
+  std::unique_ptr<tooling::FrontendActionFactory> Factory(
       tooling::newFrontendActionFactory(&Finder));
   ASSERT_TRUE(tooling::runToolOnCode(Factory->create(), Code))
       << "Parsing error in \"" << Code << "\"";
index 302616b8426ab86edce3ee5947aa13d8946734f0..f99321c617ce56d015d073aa383331acb4cbc61c 100644 (file)
@@ -107,7 +107,7 @@ TEST(runToolOnCode, FindsClassDecl) {
 }
 
 TEST(buildASTFromCode, FindsClassDecl) {
-  OwningPtr<ASTUnit> AST(buildASTFromCode("class X;"));
+  std::unique_ptr<ASTUnit> AST(buildASTFromCode("class X;"));
   ASSERT_TRUE(AST.get());
   EXPECT_TRUE(FindClassDeclX(AST.get()));
 
@@ -117,9 +117,9 @@ TEST(buildASTFromCode, FindsClassDecl) {
 }
 
 TEST(newFrontendActionFactory, CreatesFrontendActionFactoryFromType) {
-  OwningPtr<FrontendActionFactory> Factory(
+  std::unique_ptr<FrontendActionFactory> Factory(
       newFrontendActionFactory<SyntaxOnlyAction>());
-  OwningPtr<FrontendAction> Action(Factory->create());
+  std::unique_ptr<FrontendAction> Action(Factory->create());
   EXPECT_TRUE(Action.get() != NULL);
 }
 
@@ -131,9 +131,9 @@ struct IndependentFrontendActionCreator {
 
 TEST(newFrontendActionFactory, CreatesFrontendActionFactoryFromFactoryType) {
   IndependentFrontendActionCreator Creator;
-  OwningPtr<FrontendActionFactory> Factory(
+  std::unique_ptr<FrontendActionFactory> Factory(
       newFrontendActionFactory(&Creator));
-  OwningPtr<FrontendAction> Action(Factory->create());
+  std::unique_ptr<FrontendAction> Action(Factory->create());
   EXPECT_TRUE(Action.get() != NULL);
 }