summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmed Charles <ahmedcharles@gmail.com>2014-03-07 20:03:18 +0000
committerAhmed Charles <ahmedcharles@gmail.com>2014-03-07 20:03:18 +0000
commit70639e8de3f7232504008ae36507eb0125093907 (patch)
treef909e5aea2fab1df90f2ecae3695c0acfeb45e8c /include
parentcaabaa8e4b0d6d4534152852a3dfc69cfd386050 (diff)
Replace OwningPtr with std::unique_ptr.
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
Diffstat (limited to 'include')
-rw-r--r--include/clang/ARCMigrate/FileRemapper.h2
-rw-r--r--include/clang/AST/ASTContext.h6
-rw-r--r--include/clang/ASTMatchers/Dynamic/VariantValue.h2
-rw-r--r--include/clang/Analysis/AnalysisContext.h10
-rw-r--r--include/clang/Basic/FileManager.h4
-rw-r--r--include/clang/Basic/FileSystemStatCache.h4
-rw-r--r--include/clang/Basic/SourceManager.h2
-rw-r--r--include/clang/Basic/VirtualFileSystem.h13
-rw-r--r--include/clang/CodeGen/CodeGenAction.h2
-rw-r--r--include/clang/Driver/Job.h2
-rw-r--r--include/clang/Driver/ToolChain.h8
-rw-r--r--include/clang/Frontend/ASTUnit.h68
-rw-r--r--include/clang/Frontend/ChainedDiagnosticConsumer.h4
-rw-r--r--include/clang/Frontend/CompilerInstance.h8
-rw-r--r--include/clang/Frontend/FrontendAction.h4
-rw-r--r--include/clang/Frontend/MultiplexConsumer.h4
-rw-r--r--include/clang/Frontend/TextDiagnosticPrinter.h2
-rw-r--r--include/clang/Frontend/VerifyDiagnosticConsumer.h2
-rw-r--r--include/clang/Lex/HeaderSearch.h2
-rw-r--r--include/clang/Lex/Preprocessor.h8
-rw-r--r--include/clang/Parse/Parser.h34
-rw-r--r--include/clang/Rewrite/Core/TokenRewriter.h2
-rw-r--r--include/clang/Rewrite/Frontend/FrontendActions.h4
-rw-r--r--include/clang/Sema/Sema.h8
-rw-r--r--include/clang/Serialization/ASTReader.h4
-rw-r--r--include/clang/Serialization/GlobalModuleIndex.h2
-rw-r--r--include/clang/Serialization/Module.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h4
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h8
-rw-r--r--include/clang/Tooling/CommonOptionsParser.h2
-rw-r--r--include/clang/Tooling/CompilationDatabase.h2
-rw-r--r--include/clang/Tooling/FileMatchTrie.h2
-rw-r--r--include/clang/Tooling/JSONCompilationDatabase.h2
34 files changed, 112 insertions, 123 deletions
diff --git a/include/clang/ARCMigrate/FileRemapper.h b/include/clang/ARCMigrate/FileRemapper.h
index f7677cc862..c69892b69c 100644
--- a/include/clang/ARCMigrate/FileRemapper.h
+++ b/include/clang/ARCMigrate/FileRemapper.h
@@ -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;
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 20fddf2d44..3f04588d56 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -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.
diff --git a/include/clang/ASTMatchers/Dynamic/VariantValue.h b/include/clang/ASTMatchers/Dynamic/VariantValue.h
index 1b9970dd8f..a20237fc62 100644
--- a/include/clang/ASTMatchers/Dynamic/VariantValue.h
+++ b/include/clang/ASTMatchers/Dynamic/VariantValue.h
@@ -173,7 +173,7 @@ private:
const MatcherT &matcher() const { return *Out; }
private:
- OwningPtr<MatcherT> Out;
+ std::unique_ptr<MatcherT> Out;
};
IntrusiveRefCntPtr<const Payload> Value;
diff --git a/include/clang/Analysis/AnalysisContext.h b/include/clang/Analysis/AnalysisContext.h
index 8fc05f0561..9188d14438 100644
--- a/include/clang/Analysis/AnalysisContext.h
+++ b/include/clang/Analysis/AnalysisContext.h
@@ -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;
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h
index 1e13442770..a1068fe880 100644
--- a/include/clang/Basic/FileManager.h
+++ b/include/clang/Basic/FileManager.h
@@ -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);
diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h
index 05b65eede5..96384849c1 100644
--- a/include/clang/Basic/FileSystemStatCache.h
+++ b/include/clang/Basic/FileSystemStatCache.h
@@ -46,8 +46,8 @@ struct FileData {
class FileSystemStatCache {
virtual void anchor();
protected:
- OwningPtr<FileSystemStatCache> NextStatCache;
-
+ std::unique_ptr<FileSystemStatCache> NextStatCache;
+
public:
virtual ~FileSystemStatCache() {}
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 1d68681483..415a0afdf1 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -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)
diff --git a/include/clang/Basic/VirtualFileSystem.h b/include/clang/Basic/VirtualFileSystem.h
index 4c5f5a7f65..5595e143bc 100644
--- a/include/clang/Basic/VirtualFileSystem.h
+++ b/include/clang/Basic/VirtualFileSystem.h
@@ -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.
diff --git a/include/clang/CodeGen/CodeGenAction.h b/include/clang/CodeGen/CodeGenAction.h
index 912ef01a01..6097a021a8 100644
--- a/include/clang/CodeGen/CodeGenAction.h
+++ b/include/clang/CodeGen/CodeGenAction.h
@@ -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;
diff --git a/include/clang/Driver/Job.h b/include/clang/Driver/Job.h
index d7e74a9ce8..db571bf0c5 100644
--- a/include/clang/Driver/Job.h
+++ b/include/clang/Driver/Job.h
@@ -117,7 +117,7 @@ public:
}
private:
- OwningPtr<Command> Fallback;
+ std::unique_ptr<Command> Fallback;
};
/// JobList - A sequence of jobs to perform.
diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h
index e8f2c78b73..0acf743b1f 100644
--- a/include/clang/Driver/ToolChain.h
+++ b/include/clang/Driver/ToolChain.h
@@ -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;
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h
index 3cf6d18642..fd8fed24c2 100644
--- a/include/clang/Frontend/ASTUnit.h
+++ b/include/clang/Frontend/ASTUnit.h
@@ -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.
///
diff --git a/include/clang/Frontend/ChainedDiagnosticConsumer.h b/include/clang/Frontend/ChainedDiagnosticConsumer.h
index b7dc7c7b52..b428200f37 100644
--- a/include/clang/Frontend/ChainedDiagnosticConsumer.h
+++ b/include/clang/Frontend/ChainedDiagnosticConsumer.h
@@ -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,
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index 62aeca103c..3cb2d21e81 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -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;
diff --git a/include/clang/Frontend/FrontendAction.h b/include/clang/Frontend/FrontendAction.h
index 034d38c1d8..20a7b99fc1 100644
--- a/include/clang/Frontend/FrontendAction.h
+++ b/include/clang/Frontend/FrontendAction.h
@@ -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,
diff --git a/include/clang/Frontend/MultiplexConsumer.h b/include/clang/Frontend/MultiplexConsumer.h
index 6ea7547c71..b0080ec32c 100644
--- a/include/clang/Frontend/MultiplexConsumer.h
+++ b/include/clang/Frontend/MultiplexConsumer.h
@@ -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
diff --git a/include/clang/Frontend/TextDiagnosticPrinter.h b/include/clang/Frontend/TextDiagnosticPrinter.h
index dc8047066c..658f9d4973 100644
--- a/include/clang/Frontend/TextDiagnosticPrinter.h
+++ b/include/clang/Frontend/TextDiagnosticPrinter.h
@@ -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;
diff --git a/include/clang/Frontend/VerifyDiagnosticConsumer.h b/include/clang/Frontend/VerifyDiagnosticConsumer.h
index 517c7374f0..216b99ac78 100644
--- a/include/clang/Frontend/VerifyDiagnosticConsumer.h
+++ b/include/clang/Frontend/VerifyDiagnosticConsumer.h
@@ -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;
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index 93efa2d4a3..ffd13b4c77 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -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.
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index e0cfc82c47..a992beee8f 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -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 {
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index 93fc611bdb..0574f18351 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -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++
diff --git a/include/clang/Rewrite/Core/TokenRewriter.h b/include/clang/Rewrite/Core/TokenRewriter.h
index ec0bb5ba08..78fbd24db8 100644
--- a/include/clang/Rewrite/Core/TokenRewriter.h
+++ b/include/clang/Rewrite/Core/TokenRewriter.h
@@ -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;
diff --git a/include/clang/Rewrite/Frontend/FrontendActions.h b/include/clang/Rewrite/Frontend/FrontendActions.h
index ea876d9980..70ff71f990 100644
--- a/include/clang/Rewrite/Frontend/FrontendActions.h
+++ b/include/clang/Rewrite/Frontend/FrontendActions.h
@@ -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);
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index ffbaa48cc9..49c2b6b0a0 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -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
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h
index 1fb493084c..4ab9999d7b 100644
--- a/include/clang/Serialization/ASTReader.h
+++ b/include/clang/Serialization/ASTReader.h
@@ -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.
diff --git a/include/clang/Serialization/GlobalModuleIndex.h b/include/clang/Serialization/GlobalModuleIndex.h
index 76414ba634..69ba38a119 100644
--- a/include/clang/Serialization/GlobalModuleIndex.h
+++ b/include/clang/Serialization/GlobalModuleIndex.h
@@ -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.
///
diff --git a/include/clang/Serialization/Module.h b/include/clang/Serialization/Module.h
index ce4a7cb1c5..09e6c0ea28 100644
--- a/include/clang/Serialization/Module.h
+++ b/include/clang/Serialization/Module.h
@@ -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;
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
index 0bbe1985e2..6e41f38f54 100644
--- a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
+++ b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
@@ -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,
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
index e38fd88c15..2e2f5f2e0b 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
@@ -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
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
index f10a14c0c7..93c9259ea7 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
@@ -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;
diff --git a/include/clang/Tooling/CommonOptionsParser.h b/include/clang/Tooling/CommonOptionsParser.h
index 666e150478..1f32cd82cf 100644
--- a/include/clang/Tooling/CommonOptionsParser.h
+++ b/include/clang/Tooling/CommonOptionsParser.h
@@ -87,7 +87,7 @@ public:
static const char *const HelpMessage;
private:
- OwningPtr<CompilationDatabase> Compilations;
+ std::unique_ptr<CompilationDatabase> Compilations;
std::vector<std::string> SourcePathList;
};
diff --git a/include/clang/Tooling/CompilationDatabase.h b/include/clang/Tooling/CompilationDatabase.h
index 8cca3296f9..e24175bd85 100644
--- a/include/clang/Tooling/CompilationDatabase.h
+++ b/include/clang/Tooling/CompilationDatabase.h
@@ -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);
/// ...
diff --git a/include/clang/Tooling/FileMatchTrie.h b/include/clang/Tooling/FileMatchTrie.h
index e531854cca..8e72dc9b24 100644
--- a/include/clang/Tooling/FileMatchTrie.h
+++ b/include/clang/Tooling/FileMatchTrie.h
@@ -79,7 +79,7 @@ public:
raw_ostream &Error) const;
private:
FileMatchTrieNode *Root;
- OwningPtr<PathComparator> Comparator;
+ std::unique_ptr<PathComparator> Comparator;
};
diff --git a/include/clang/Tooling/JSONCompilationDatabase.h b/include/clang/Tooling/JSONCompilationDatabase.h
index e3f149bebc..1ab91fc1eb 100644
--- a/include/clang/Tooling/JSONCompilationDatabase.h
+++ b/include/clang/Tooling/JSONCompilationDatabase.h
@@ -104,7 +104,7 @@ private:
FileMatchTrie MatchTrie;
- OwningPtr<llvm::MemoryBuffer> Database;
+ std::unique_ptr<llvm::MemoryBuffer> Database;
llvm::SourceMgr SM;
llvm::yaml::Stream YAMLStream;
};