r203279 - Replace OwningPtr with std::unique_ptr.
Ahmed Charles
ahmedcharles at gmail.com
Fri Mar 7 12:03:20 PST 2014
Author: ace2001ac
Date: Fri Mar 7 14:03:18 2014
New Revision: 203279
URL: http://llvm.org/viewvc/llvm-project?rev=203279&view=rev
Log:
Replace OwningPtr with std::unique_ptr.
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.
Modified:
cfe/trunk/include/clang/ARCMigrate/FileRemapper.h
cfe/trunk/include/clang/AST/ASTContext.h
cfe/trunk/include/clang/ASTMatchers/Dynamic/VariantValue.h
cfe/trunk/include/clang/Analysis/AnalysisContext.h
cfe/trunk/include/clang/Basic/FileManager.h
cfe/trunk/include/clang/Basic/FileSystemStatCache.h
cfe/trunk/include/clang/Basic/SourceManager.h
cfe/trunk/include/clang/Basic/VirtualFileSystem.h
cfe/trunk/include/clang/CodeGen/CodeGenAction.h
cfe/trunk/include/clang/Driver/Job.h
cfe/trunk/include/clang/Driver/ToolChain.h
cfe/trunk/include/clang/Frontend/ASTUnit.h
cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h
cfe/trunk/include/clang/Frontend/CompilerInstance.h
cfe/trunk/include/clang/Frontend/FrontendAction.h
cfe/trunk/include/clang/Frontend/MultiplexConsumer.h
cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h
cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h
cfe/trunk/include/clang/Lex/HeaderSearch.h
cfe/trunk/include/clang/Lex/Preprocessor.h
cfe/trunk/include/clang/Parse/Parser.h
cfe/trunk/include/clang/Rewrite/Core/TokenRewriter.h
cfe/trunk/include/clang/Rewrite/Frontend/FrontendActions.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/include/clang/Serialization/ASTReader.h
cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h
cfe/trunk/include/clang/Serialization/Module.h
cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
cfe/trunk/include/clang/Tooling/CommonOptionsParser.h
cfe/trunk/include/clang/Tooling/CompilationDatabase.h
cfe/trunk/include/clang/Tooling/FileMatchTrie.h
cfe/trunk/include/clang/Tooling/JSONCompilationDatabase.h
cfe/trunk/lib/ARCMigrate/ARCMT.cpp
cfe/trunk/lib/ARCMigrate/FileRemapper.cpp
cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
cfe/trunk/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/lib/Analysis/CFG.cpp
cfe/trunk/lib/Analysis/Consumed.cpp
cfe/trunk/lib/Basic/FileManager.cpp
cfe/trunk/lib/Basic/FileSystemStatCache.cpp
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/Basic/VirtualFileSystem.cpp
cfe/trunk/lib/CodeGen/BackendUtil.cpp
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/CodeGen/CGCXXABI.h
cfe/trunk/lib/CodeGen/CGVTables.cpp
cfe/trunk/lib/CodeGen/CodeGenAction.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.h
cfe/trunk/lib/CodeGen/CodeGenPGO.h
cfe/trunk/lib/CodeGen/ModuleBuilder.cpp
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/SanitizerArgs.cpp
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/lib/Format/ContinuationIndenter.cpp
cfe/trunk/lib/Format/Format.cpp
cfe/trunk/lib/Format/FormatToken.h
cfe/trunk/lib/Format/UnwrappedLineParser.h
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp
cfe/trunk/lib/Frontend/CompilerInstance.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp
cfe/trunk/lib/Frontend/FrontendAction.cpp
cfe/trunk/lib/Frontend/FrontendActions.cpp
cfe/trunk/lib/Frontend/MultiplexConsumer.cpp
cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp
cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp
cfe/trunk/lib/Lex/HeaderMap.cpp
cfe/trunk/lib/Lex/PTHLexer.cpp
cfe/trunk/lib/Parse/ParseAST.cpp
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/lib/Rewrite/Core/Rewriter.cpp
cfe/trunk/lib/Rewrite/Frontend/FixItRewriter.cpp
cfe/trunk/lib/Rewrite/Frontend/FrontendActions.cpp
cfe/trunk/lib/Sema/SemaLookup.cpp
cfe/trunk/lib/Sema/SemaObjCProperty.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
cfe/trunk/lib/Tooling/CompilationDatabase.cpp
cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp
cfe/trunk/lib/Tooling/Tooling.cpp
cfe/trunk/tools/arcmt-test/arcmt-test.cpp
cfe/trunk/tools/clang-check/ClangCheck.cpp
cfe/trunk/tools/clang-format/ClangFormat.cpp
cfe/trunk/tools/diagtool/ShowEnabledWarnings.cpp
cfe/trunk/tools/driver/cc1_main.cpp
cfe/trunk/tools/driver/cc1as_main.cpp
cfe/trunk/tools/driver/driver.cpp
cfe/trunk/tools/libclang/ARCMigrate.cpp
cfe/trunk/tools/libclang/CIndex.cpp
cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp
cfe/trunk/tools/libclang/Indexing.cpp
cfe/trunk/unittests/AST/DeclPrinterTest.cpp
cfe/trunk/unittests/AST/DeclTest.cpp
cfe/trunk/unittests/AST/MatchVerifier.h
cfe/trunk/unittests/AST/StmtPrinterTest.cpp
cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h
cfe/trunk/unittests/ASTMatchers/Dynamic/RegistryTest.cpp
cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
cfe/trunk/unittests/Sema/ExternalSemaSourceTest.cpp
cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp
cfe/trunk/unittests/Tooling/RefactoringCallbacksTest.cpp
cfe/trunk/unittests/Tooling/ToolingTest.cpp
Modified: cfe/trunk/include/clang/ARCMigrate/FileRemapper.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ARCMigrate/FileRemapper.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/ARCMigrate/FileRemapper.h (original)
+++ cfe/trunk/include/clang/ARCMigrate/FileRemapper.h Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Fri Mar 7 14:03:18 2014
@@ -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.
Modified: cfe/trunk/include/clang/ASTMatchers/Dynamic/VariantValue.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/Dynamic/VariantValue.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/ASTMatchers/Dynamic/VariantValue.h (original)
+++ cfe/trunk/include/clang/ASTMatchers/Dynamic/VariantValue.h Fri Mar 7 14:03:18 2014
@@ -173,7 +173,7 @@ private:
const MatcherT &matcher() const { return *Out; }
private:
- OwningPtr<MatcherT> Out;
+ std::unique_ptr<MatcherT> Out;
};
IntrusiveRefCntPtr<const Payload> Value;
Modified: cfe/trunk/include/clang/Analysis/AnalysisContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/AnalysisContext.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/AnalysisContext.h (original)
+++ cfe/trunk/include/clang/Analysis/AnalysisContext.h Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/include/clang/Basic/FileManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileManager.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/trunk/include/clang/Basic/FileManager.h Fri Mar 7 14:03:18 2014
@@ -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 RefCountedBas
unsigned NumDirCacheMisses, NumFileCacheMisses;
// Caching.
- OwningPtr<FileSystemStatCache> StatCache;
+ std::unique_ptr<FileSystemStatCache> StatCache;
bool getStatValue(const char *Path, FileData &Data, bool isFile,
vfs::File **F);
Modified: cfe/trunk/include/clang/Basic/FileSystemStatCache.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileSystemStatCache.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/FileSystemStatCache.h (original)
+++ cfe/trunk/include/clang/Basic/FileSystemStatCache.h Fri Mar 7 14:03:18 2014
@@ -46,8 +46,8 @@ struct FileData {
class FileSystemStatCache {
virtual void anchor();
protected:
- OwningPtr<FileSystemStatCache> NextStatCache;
-
+ std::unique_ptr<FileSystemStatCache> NextStatCache;
+
public:
virtual ~FileSystemStatCache() {}
Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Fri Mar 7 14:03:18 2014
@@ -569,7 +569,7 @@ class SourceManager : public RefCountedB
/// \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)
Modified: cfe/trunk/include/clang/Basic/VirtualFileSystem.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/VirtualFileSystem.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/VirtualFileSystem.h (original)
+++ cfe/trunk/include/clang/Basic/VirtualFileSystem.h Fri Mar 7 14:03:18 2014
@@ -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.
Modified: cfe/trunk/include/clang/CodeGen/CodeGenAction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/CodeGen/CodeGenAction.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/CodeGen/CodeGenAction.h (original)
+++ cfe/trunk/include/clang/CodeGen/CodeGenAction.h Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/include/clang/Driver/Job.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Job.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Job.h (original)
+++ cfe/trunk/include/clang/Driver/Job.h Fri Mar 7 14:03:18 2014
@@ -117,7 +117,7 @@ public:
}
private:
- OwningPtr<Command> Fallback;
+ std::unique_ptr<Command> Fallback;
};
/// JobList - A sequence of jobs to perform.
Modified: cfe/trunk/include/clang/Driver/ToolChain.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/ToolChain.h (original)
+++ cfe/trunk/include/clang/Driver/ToolChain.h Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/include/clang/Frontend/ASTUnit.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ASTUnit.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/ASTUnit.h (original)
+++ cfe/trunk/include/clang/Frontend/ASTUnit.h Fri Mar 7 14:03:18 2014
@@ -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.
///
Modified: cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h (original)
+++ cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h Fri Mar 7 14:03:18 2014
@@ -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,
Modified: cfe/trunk/include/clang/Frontend/CompilerInstance.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CompilerInstance.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CompilerInstance.h (original)
+++ cfe/trunk/include/clang/Frontend/CompilerInstance.h Fri Mar 7 14:03:18 2014
@@ -91,16 +91,16 @@ class CompilerInstance : public ModuleLo
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;
Modified: cfe/trunk/include/clang/Frontend/FrontendAction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/FrontendAction.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/FrontendAction.h (original)
+++ cfe/trunk/include/clang/Frontend/FrontendAction.h Fri Mar 7 14:03:18 2014
@@ -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,
Modified: cfe/trunk/include/clang/Frontend/MultiplexConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/MultiplexConsumer.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/MultiplexConsumer.h (original)
+++ cfe/trunk/include/clang/Frontend/MultiplexConsumer.h Fri Mar 7 14:03:18 2014
@@ -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
Modified: cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h (original)
+++ cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h Fri Mar 7 14:03:18 2014
@@ -30,7 +30,7 @@ class TextDiagnosticPrinter : public Dia
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;
Modified: cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h (original)
+++ cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/include/clang/Lex/HeaderSearch.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/HeaderSearch.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/HeaderSearch.h (original)
+++ cfe/trunk/include/clang/Lex/HeaderSearch.h Fri Mar 7 14:03:18 2014
@@ -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.
Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Fri Mar 7 14:03:18 2014
@@ -102,7 +102,7 @@ class Preprocessor : public RefCountedBa
/// 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 RefCountedBa
/// 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 RefCountedBa
/// \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 {
Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Fri Mar 7 14:03:18 2014
@@ -139,23 +139,23 @@ class Parser : public CodeCompletionHand
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;
+ 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;
- OwningPtr<CommentHandler> CommentSemaHandler;
+ 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++
Modified: cfe/trunk/include/clang/Rewrite/Core/TokenRewriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Rewrite/Core/TokenRewriter.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Rewrite/Core/TokenRewriter.h (original)
+++ cfe/trunk/include/clang/Rewrite/Core/TokenRewriter.h Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/include/clang/Rewrite/Frontend/FrontendActions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Rewrite/Frontend/FrontendActions.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Rewrite/Frontend/FrontendActions.h (original)
+++ cfe/trunk/include/clang/Rewrite/Frontend/FrontendActions.h Fri Mar 7 14:03:18 2014
@@ -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);
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Fri Mar 7 14:03:18 2014
@@ -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
Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Fri Mar 7 14:03:18 2014
@@ -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.
Modified: cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h (original)
+++ cfe/trunk/include/clang/Serialization/GlobalModuleIndex.h Fri Mar 7 14:03:18 2014
@@ -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.
///
Modified: cfe/trunk/include/clang/Serialization/Module.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/Module.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/Module.h (original)
+++ cfe/trunk/include/clang/Serialization/Module.h Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h Fri Mar 7 14:03:18 2014
@@ -499,7 +499,7 @@ class PathDiagnosticEventPiece : public
/// 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,
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h Fri Mar 7 14:03:18 2014
@@ -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
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/include/clang/Tooling/CommonOptionsParser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/CommonOptionsParser.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/CommonOptionsParser.h (original)
+++ cfe/trunk/include/clang/Tooling/CommonOptionsParser.h Fri Mar 7 14:03:18 2014
@@ -87,7 +87,7 @@ public:
static const char *const HelpMessage;
private:
- OwningPtr<CompilationDatabase> Compilations;
+ std::unique_ptr<CompilationDatabase> Compilations;
std::vector<std::string> SourcePathList;
};
Modified: cfe/trunk/include/clang/Tooling/CompilationDatabase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/CompilationDatabase.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/CompilationDatabase.h (original)
+++ cfe/trunk/include/clang/Tooling/CompilationDatabase.h Fri Mar 7 14:03:18 2014
@@ -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);
/// ...
Modified: cfe/trunk/include/clang/Tooling/FileMatchTrie.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/FileMatchTrie.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/FileMatchTrie.h (original)
+++ cfe/trunk/include/clang/Tooling/FileMatchTrie.h Fri Mar 7 14:03:18 2014
@@ -79,7 +79,7 @@ public:
raw_ostream &Error) const;
private:
FileMatchTrieNode *Root;
- OwningPtr<PathComparator> Comparator;
+ std::unique_ptr<PathComparator> Comparator;
};
Modified: cfe/trunk/include/clang/Tooling/JSONCompilationDatabase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/JSONCompilationDatabase.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/JSONCompilationDatabase.h (original)
+++ cfe/trunk/include/clang/Tooling/JSONCompilationDatabase.h Fri Mar 7 14:03:18 2014
@@ -104,7 +104,7 @@ private:
FileMatchTrie MatchTrie;
- OwningPtr<llvm::MemoryBuffer> Database;
+ std::unique_ptr<llvm::MemoryBuffer> Database;
llvm::SourceMgr SM;
llvm::yaml::Stream YAMLStream;
};
Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Fri Mar 7 14:03:18 2014
@@ -167,7 +167,7 @@ static bool HasARCRuntime(CompilerInvoca
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(Compile
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(Compile
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
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(Tr
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(
Modified: cfe/trunk/lib/ARCMigrate/FileRemapper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/FileRemapper.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/FileRemapper.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/FileRemapper.cpp Fri Mar 7 14:03:18 2014
@@ -64,8 +64,8 @@ bool FileRemapper::initFromFile(StringRe
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);
Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransRetainReleaseDealloc.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransRetainReleaseDealloc.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransRetainReleaseDealloc.cpp Fri Mar 7 14:03:18 2014
@@ -38,7 +38,7 @@ class RetainReleaseDeallocRemover :
MigrationPass &Pass;
ExprSet Removables;
- OwningPtr<ParentMap> StmtMap;
+ std::unique_ptr<ParentMap> StmtMap;
Selector DelegateSel, FinalizeSel;
Modified: cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/TransUnbridgedCasts.cpp Fri Mar 7 14:03:18 2014
@@ -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) {
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Fri Mar 7 14:03:18 2014
@@ -453,7 +453,7 @@ std::string PredefinedExpr::ComputeName(
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)) {
Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Fri Mar 7 14:03:18 2014
@@ -291,7 +291,7 @@ class CFGBuilder {
typedef BlockScopePosPair JumpSource;
ASTContext *Context;
- OwningPtr<CFG> cfg;
+ std::unique_ptr<CFG> cfg;
CFGBlock *Block;
CFGBlock *Succ;
Modified: cfe/trunk/lib/Analysis/Consumed.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Consumed.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/Consumed.cpp (original)
+++ cfe/trunk/lib/Analysis/Consumed.cpp Fri Mar 7 14:03:18 2014
@@ -1286,8 +1286,9 @@ void ConsumedAnalyzer::determineExpected
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 =
Modified: cfe/trunk/lib/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileManager.cpp (original)
+++ cfe/trunk/lib/Basic/FileManager.cpp Fri Mar 7 14:03:18 2014
@@ -379,7 +379,7 @@ void FileManager::FixupRelativePath(Smal
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,
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);
Modified: cfe/trunk/lib/Basic/FileSystemStatCache.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileSystemStatCache.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileSystemStatCache.cpp (original)
+++ cfe/trunk/lib/Basic/FileSystemStatCache.cpp Fri Mar 7 14:03:18 2014
@@ -77,7 +77,7 @@ bool FileSystemStatCache::get(const char
//
// 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) {
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri Mar 7 14:03:18 2014
@@ -5965,7 +5965,7 @@ TargetInfo *TargetInfo::CreateTargetInfo
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;
Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
+++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Fri Mar 7 14:03:18 2014
@@ -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(c
}
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::statu
}
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(MemoryB
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(cons
}
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();
Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Mar 7 14:03:18 2014
@@ -122,7 +122,7 @@ public:
BuryPointer(TM.release());
}
- llvm::OwningPtr<TargetMachine> TM;
+ std::unique_ptr<TargetMachine> TM;
void EmitAssembly(BackendAction Action, raw_ostream *OS);
};
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Fri Mar 7 14:03:18 2014
@@ -679,7 +679,7 @@ llvm::Value *CodeGenFunction::EmitBlockL
}
// 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()));
Modified: cfe/trunk/lib/CodeGen/CGCXXABI.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXXABI.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXXABI.h (original)
+++ cfe/trunk/lib/CodeGen/CGCXXABI.h Fri Mar 7 14:03:18 2014
@@ -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()) {}
Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Fri Mar 7 14:03:18 2014
@@ -554,7 +554,7 @@ CodeGenVTables::GenerateConstructionVTab
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));
Modified: cfe/trunk/lib/CodeGen/CodeGenAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenAction.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenAction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenAction.cpp Fri Mar 7 14:03:18 2014
@@ -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(Comp
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;
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Fri Mar 7 14:03:18 2014
@@ -235,7 +235,7 @@ class CodeGenModule : public CodeGenType
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 CodeGenType
GlobalDecl initializedGlobalDecl;
- llvm::OwningPtr<llvm::SpecialCaseList> SanitizerBlacklist;
+ std::unique_ptr<llvm::SpecialCaseList> SanitizerBlacklist;
const SanitizerOptions &SanOpts;
Modified: cfe/trunk/lib/CodeGen/CodeGenPGO.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenPGO.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenPGO.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenPGO.h Fri Mar 7 14:03:18 2014
@@ -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.
Modified: cfe/trunk/lib/CodeGen/ModuleBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ModuleBuilder.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ModuleBuilder.cpp (original)
+++ cfe/trunk/lib/CodeGen/ModuleBuilder.cpp Fri Mar 7 14:03:18 2014
@@ -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)
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Mar 7 14:03:18 2014
@@ -1203,7 +1203,7 @@ void Driver::BuildActions(const ToolChai
}
// 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;
Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Fri Mar 7 14:03:18 2014
@@ -143,7 +143,7 @@ SanitizerArgs::SanitizerArgs(const ToolC
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;
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Fri Mar 7 14:03:18 2014
@@ -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,
Modified: cfe/trunk/lib/Format/ContinuationIndenter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/ContinuationIndenter.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Format/ContinuationIndenter.cpp (original)
+++ cfe/trunk/lib/Format/ContinuationIndenter.cpp Fri Mar 7 14:03:18 2014
@@ -791,7 +791,7 @@ unsigned ContinuationIndenter::breakProt
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);
Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Fri Mar 7 14:03:18 2014
@@ -1790,7 +1790,7 @@ FormatStyle getStyle(StringRef StyleName
}
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";
Modified: cfe/trunk/lib/Format/FormatToken.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/FormatToken.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Format/FormatToken.h (original)
+++ cfe/trunk/lib/Format/FormatToken.h Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/Format/UnwrappedLineParser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineParser.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Format/UnwrappedLineParser.h (original)
+++ cfe/trunk/lib/Format/UnwrappedLineParser.h Fri Mar 7 14:03:18 2014
@@ -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.
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Fri Mar 7 14:03:18 2014
@@ -677,7 +677,7 @@ ASTUnit *ASTUnit::LoadFromASTFile(const
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 *
}
// 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 *
// 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::getMainBuff
= 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::getMainBuff
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::getMainBuff
// 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(CompilerInvocat
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(CompilerInvocat
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::LoadFromCompilerInvoca
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::LoadFromCompilerInvoca
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::LoadFromCompilerInvoca
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::LoadFromCompilerInvoca
: 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(co
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 Fil
// 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 Fil
// 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();
Modified: cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp (original)
+++ cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp Fri Mar 7 14:03:18 2014
@@ -31,7 +31,7 @@ static ASTReader *createASTReader(Compil
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(CompilerIn
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(CompilerIn
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(CompilerIn
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(
Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Fri Mar 7 14:03:18 2014
@@ -147,7 +147,7 @@ static void SetupSerializedDiagnostics(D
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::createPCHExternalASTSo
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(Strin
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::InitializeSourceM
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;
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri Mar 7 14:03:18 2014
@@ -1669,12 +1669,12 @@ bool CompilerInvocation::CreateFromArgs(
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::getModul
// $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");
Modified: cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp (original)
+++ cfe/trunk/lib/Frontend/CreateInvocationFromCommandLine.cpp Fri Mar 7 14:03:18 2014
@@ -52,7 +52,7 @@ clang::createInvocationFromCommandLine(A
// 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(A
}
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()) +
Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendAction.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendAction.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendAction.cpp Fri Mar 7 14:03:18 2014
@@ -148,7 +148,7 @@ ASTConsumer* FrontendAction::CreateWrapp
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(Com
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(Com
if (!usesPreprocessorOnly()) {
CI.createASTContext();
- OwningPtr<ASTConsumer> Consumer(
- CreateWrappedASTConsumer(CI, InputFile));
+ std::unique_ptr<ASTConsumer> Consumer(
+ CreateWrappedASTConsumer(CI, InputFile));
if (!Consumer)
goto failure;
Modified: cfe/trunk/lib/Frontend/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendActions.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendActions.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendActions.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/Frontend/MultiplexConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/MultiplexConsumer.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/MultiplexConsumer.cpp (original)
+++ cfe/trunk/lib/Frontend/MultiplexConsumer.cpp Fri Mar 7 14:03:18 2014
@@ -184,10 +184,9 @@ void MultiplexASTMutationListener::Decla
} // 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;
Modified: cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp (original)
+++ cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp Fri Mar 7 14:03:18 2014
@@ -72,7 +72,7 @@ static FrontendAction *CreateFrontendBas
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 *CreateFrontendAct
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(Co
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);
Modified: cfe/trunk/lib/Lex/HeaderMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/HeaderMap.cpp (original)
+++ cfe/trunk/lib/Lex/HeaderMap.cpp Fri Mar 7 14:03:18 2014
@@ -81,7 +81,7 @@ const HeaderMap *HeaderMap::Create(const
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();
Modified: cfe/trunk/lib/Lex/PTHLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PTHLexer.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PTHLexer.cpp (original)
+++ cfe/trunk/lib/Lex/PTHLexer.cpp Fri Mar 7 14:03:18 2014
@@ -425,7 +425,7 @@ static void InvalidPTH(DiagnosticsEngine
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
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
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;
Modified: cfe/trunk/lib/Parse/ParseAST.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseAST.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseAST.cpp (original)
+++ cfe/trunk/lib/Parse/ParseAST.cpp Fri Mar 7 14:03:18 2014
@@ -88,7 +88,8 @@ void clang::ParseAST(Preprocessor &PP, A
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 Print
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);
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Fri Mar 7 14:03:18 2014
@@ -302,7 +302,7 @@ void Parser::ParseGNUAttributeArgs(Ident
// 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(Ident
// 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));
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Fri Mar 7 14:03:18 2014
@@ -2163,13 +2163,13 @@ StmtResult Parser::ParseMicrosoftAsmStat
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::ParseMicrosoftAsmStat
// 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);
Modified: cfe/trunk/lib/Rewrite/Core/Rewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Core/Rewriter.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/Core/Rewriter.cpp (original)
+++ cfe/trunk/lib/Rewrite/Core/Rewriter.cpp Fri Mar 7 14:03:18 2014
@@ -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
Modified: cfe/trunk/lib/Rewrite/Frontend/FixItRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Frontend/FixItRewriter.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/Frontend/FixItRewriter.cpp (original)
+++ cfe/trunk/lib/Rewrite/Frontend/FixItRewriter.cpp Fri Mar 7 14:03:18 2014
@@ -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 {
Modified: cfe/trunk/lib/Rewrite/Frontend/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Frontend/FrontendActions.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/Frontend/FrontendActions.cpp (original)
+++ cfe/trunk/lib/Rewrite/Frontend/FrontendActions.cpp Fri Mar 7 14:03:18 2014
@@ -110,9 +110,9 @@ bool FixItRecompile::BeginInvocation(Com
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
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Fri Mar 7 14:03:18 2014
@@ -4163,7 +4163,7 @@ TypoCorrection Sema::CorrectTypo(const D
// 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())
Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Fri Mar 7 14:03:18 2014
@@ -1709,7 +1709,7 @@ void Sema::DiagnoseUnimplementedProperti
// 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(),
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Fri Mar 7 14:03:18 2014
@@ -3709,7 +3709,7 @@ std::string ASTReader::getOriginalSource
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(
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;
Modified: cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp (original)
+++ cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp Fri Mar 7 14:03:18 2014
@@ -228,7 +228,7 @@ GlobalModuleIndex::readIndex(StringRef P
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::loadModul
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) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp Fri Mar 7 14:03:18 2014
@@ -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,
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp Fri Mar 7 14:03:18 2014
@@ -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
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
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 Check
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
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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp Fri Mar 7 14:03:18 2014
@@ -35,11 +35,8 @@ class CStringChecker : public Checker< e
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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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 describeUninitializedAr
}
}
-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 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
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
};
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp Fri Mar 7 14:03:18 2014
@@ -41,7 +41,7 @@ bool isRootChanged(intptr_t k) { return
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) {}
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp Fri Mar 7 14:03:18 2014
@@ -128,9 +128,9 @@ class DeadStoreObs : public LiveVariable
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 };
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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 ;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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"));
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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:
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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",
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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,
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
};
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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,
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp Fri Mar 7 14:03:18 2014
@@ -54,8 +54,8 @@ class SimpleStreamChecker : public Check
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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp Fri Mar 7 14:03:18 2014
@@ -62,8 +62,8 @@ class StreamChecker : public Checker<eva
*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()
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
};
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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,
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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));
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp Fri Mar 7 14:03:18 2014
@@ -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,
Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Fri Mar 7 14:03:18 2014
@@ -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
// 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));
Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp Fri Mar 7 14:03:18 2014
@@ -2550,7 +2550,7 @@ void ExprEngine::ViewGraph(ArrayRef<cons
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";
Modified: cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp Fri Mar 7 14:03:18 2014
@@ -197,8 +197,8 @@ PathDiagnosticConsumer::~PathDiagnosticC
}
void PathDiagnosticConsumer::HandlePathDiagnostic(PathDiagnostic *D) {
- OwningPtr<PathDiagnostic> OwningD(D);
-
+ std::unique_ptr<PathDiagnostic> OwningD(D);
+
if (!D || D->path.empty())
return;
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp Fri Mar 7 14:03:18 2014
@@ -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(
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 Prepr
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* CreateUbiV
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);
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp Fri Mar 7 14:03:18 2014
@@ -104,8 +104,8 @@ CheckerManager *ento::createCheckerManag
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) {
Modified: cfe/trunk/lib/Tooling/CompilationDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/CompilationDatabase.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/CompilationDatabase.cpp (original)
+++ cfe/trunk/lib/Tooling/CompilationDatabase.cpp Fri Mar 7 14:03:18 2014
@@ -43,7 +43,7 @@ CompilationDatabase::loadFromDirectory(S
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::vec
// 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::vec
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();
Modified: cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp (original)
+++ cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp Fri Mar 7 14:03:18 2014
@@ -122,7 +122,7 @@ class JSONCompilationDatabasePlugin : pu
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(St
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;
Modified: cfe/trunk/lib/Tooling/Tooling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Tooling.cpp (original)
+++ cfe/trunk/lib/Tooling/Tooling.cpp Fri Mar 7 14:03:18 2014
@@ -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::runInvocatio
// 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);
Modified: cfe/trunk/tools/arcmt-test/arcmt-test.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/arcmt-test/arcmt-test.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/arcmt-test/arcmt-test.cpp (original)
+++ cfe/trunk/tools/arcmt-test/arcmt-test.cpp Fri Mar 7 14:03:18 2014
@@ -178,7 +178,7 @@ static bool performTransformations(Strin
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(Strin
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(Array
resultMap[sys::path::stem(fname)] = fname;
}
- OwningPtr<MemoryBuffer> inputBuf;
+ std::unique_ptr<MemoryBuffer> inputBuf;
if (RemappingsFile.empty())
MemoryBuffer::getSTDIN(inputBuf);
else
Modified: cfe/trunk/tools/clang-check/ClangCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-check/ClangCheck.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/clang-check/ClangCheck.cpp (original)
+++ cfe/trunk/tools/clang-check/ClangCheck.cpp Fri Mar 7 14:03:18 2014
@@ -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));
Modified: cfe/trunk/tools/clang-format/ClangFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/ClangFormat.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format/ClangFormat.cpp (original)
+++ cfe/trunk/tools/clang-format/ClangFormat.cpp Fri Mar 7 14:03:18 2014
@@ -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;
Modified: cfe/trunk/tools/diagtool/ShowEnabledWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/diagtool/ShowEnabledWarnings.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/diagtool/ShowEnabledWarnings.cpp (original)
+++ cfe/trunk/tools/diagtool/ShowEnabledWarnings.cpp Fri Mar 7 14:03:18 2014
@@ -64,9 +64,9 @@ createDiagnostics(unsigned int argc, cha
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;
Modified: cfe/trunk/tools/driver/cc1_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1_main.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1_main.cpp Fri Mar 7 14:03:18 2014
@@ -59,7 +59,7 @@ static void LLVMErrorHandler(void *UserD
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.
Modified: cfe/trunk/tools/driver/cc1as_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1as_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1as_main.cpp Fri Mar 7 14:03:18 2014
@@ -151,10 +151,10 @@ bool AssemblerInvocation::CreateFromArgs
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(AssemblerIn
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(AssemblerIn
// 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(AssemblerIn
// 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(AssemblerIn
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(AssemblerIn
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, co
// 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;
}
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Fri Mar 7 14:03:18 2014
@@ -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())
Modified: cfe/trunk/tools/libclang/ARCMigrate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/ARCMigrate.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/ARCMigrate.cpp (original)
+++ cfe/trunk/tools/libclang/ARCMigrate.cpp Fri Mar 7 14:03:18 2014
@@ -55,7 +55,7 @@ CXRemapping clang_getRemappings(const ch
}
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_getRemappingsFromFileL
unsigned numFiles) {
bool Logging = ::getenv("LIBCLANG_LOGGING");
- OwningPtr<Remap> remap(new Remap());
+ std::unique_ptr<Remap> remap(new Remap());
if (numFiles == 0) {
if (Logging)
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Fri Mar 7 14:03:18 2014
@@ -2723,8 +2723,8 @@ static void clang_parseTranslationUnit_I
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_I
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_I
}
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
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_getCXTUResourceU
}
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?
Modified: cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp (original)
+++ cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp Fri Mar 7 14:03:18 2014
@@ -259,7 +259,7 @@ CXDiagnosticSet DiagLoader::load(const c
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 c
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::readDiagnosticBlo
reportInvalidFile("malformed diagnostic block");
return Failure;
}
-
- OwningPtr<CXLoadedDiagnostic> D(new CXLoadedDiagnostic());
+
+ std::unique_ptr<CXLoadedDiagnostic> D(new CXLoadedDiagnostic());
RecordData Record;
while (true) {
Modified: cfe/trunk/tools/libclang/Indexing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/Indexing.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/Indexing.cpp (original)
+++ cfe/trunk/tools/libclang/Indexing.cpp Fri Mar 7 14:03:18 2014
@@ -411,7 +411,7 @@ class IndexingFrontendAction : public AS
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(v
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(v
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(v
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(v
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_I
? 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.
Modified: cfe/trunk/unittests/AST/DeclPrinterTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/DeclPrinterTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/DeclPrinterTest.cpp (original)
+++ cfe/trunk/unittests/AST/DeclPrinterTest.cpp Fri Mar 7 14:03:18 2014
@@ -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()
Modified: cfe/trunk/unittests/AST/DeclTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/DeclTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/DeclTest.cpp (original)
+++ cfe/trunk/unittests/AST/DeclTest.cpp Fri Mar 7 14:03:18 2014
@@ -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
Modified: cfe/trunk/unittests/AST/MatchVerifier.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/MatchVerifier.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/MatchVerifier.h (original)
+++ cfe/trunk/unittests/AST/MatchVerifier.h Fri Mar 7 14:03:18 2014
@@ -79,7 +79,7 @@ testing::AssertionResult MatchVerifier<N
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;
Modified: cfe/trunk/unittests/AST/StmtPrinterTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/StmtPrinterTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/StmtPrinterTest.cpp (original)
+++ cfe/trunk/unittests/AST/StmtPrinterTest.cpp Fri Mar 7 14:03:18 2014
@@ -72,7 +72,8 @@ PrintedStmtMatches(StringRef Code, const
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()
Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp Fri Mar 7 14:03:18 2014
@@ -4165,12 +4165,13 @@ TEST(MatchFinder, InterceptsStartOfTrans
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, InterceptsEndOfTransla
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);
Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.h Fri Mar 7 14:03:18 2014
@@ -67,7 +67,8 @@ testing::AssertionResult matchesConditio
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
}
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";
Modified: cfe/trunk/unittests/ASTMatchers/Dynamic/RegistryTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/Dynamic/RegistryTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/Dynamic/RegistryTest.cpp (original)
+++ cfe/trunk/unittests/ASTMatchers/Dynamic/RegistryTest.cpp Fri Mar 7 14:03:18 2014
@@ -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());
Modified: cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp (original)
+++ cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp Fri Mar 7 14:03:18 2014
@@ -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");
Modified: cfe/trunk/unittests/Sema/ExternalSemaSourceTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Sema/ExternalSemaSourceTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/Sema/ExternalSemaSourceTest.cpp (original)
+++ cfe/trunk/unittests/Sema/ExternalSemaSourceTest.cpp Fri Mar 7 14:03:18 2014
@@ -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, ExternalTypoCor
// 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, ExternalTypoCor
// 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, TryOtherTactics
// 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);
Modified: cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/CompilationDatabaseTest.cpp Fri Mar 7 14:03:18 2014
@@ -42,7 +42,7 @@ TEST(JSONCompilationDatabase, ErrsOnInva
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> getAllFi
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, GetAllComp
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, GetAllCom
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, Retu
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, Retu
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, Retu
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, Retu
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, Hand
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 =
Modified: cfe/trunk/unittests/Tooling/RefactoringCallbacksTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/RefactoringCallbacksTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/RefactoringCallbacksTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/RefactoringCallbacksTest.cpp Fri Mar 7 14:03:18 2014
@@ -25,7 +25,7 @@ void expectRewritten(const std::string &
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 << "\"";
Modified: cfe/trunk/unittests/Tooling/ToolingTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/ToolingTest.cpp?rev=203279&r1=203278&r2=203279&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/ToolingTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/ToolingTest.cpp Fri Mar 7 14:03:18 2014
@@ -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);
}
More information about the cfe-commits
mailing list