diff options
author | Andy Gibbs <andyg1001@hotmail.co.uk> | 2013-04-12 10:56:28 +0000 |
---|---|---|
committer | Andy Gibbs <andyg1001@hotmail.co.uk> | 2013-04-12 10:56:28 +0000 |
commit | 95777550a977f970c0a9b92a5428c988f2f7db36 (patch) | |
tree | 4758ee8daa4394aabaa4d7af932dd3fc0cce9a85 /llvm/tools/llvm-link/llvm-link.cpp | |
parent | 92a31305099285290f11bed8b444d121c3fbfee3 (diff) | |
download | bcm5719-llvm-95777550a977f970c0a9b92a5428c988f2f7db36.tar.gz bcm5719-llvm-95777550a977f970c0a9b92a5428c988f2f7db36.zip |
Replace uses of the deprecated std::auto_ptr with OwningPtr.
llvm-svn: 179373
Diffstat (limited to 'llvm/tools/llvm-link/llvm-link.cpp')
-rw-r--r-- | llvm/tools/llvm-link/llvm-link.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp index 83665cc1758..b195ca88de7 100644 --- a/llvm/tools/llvm-link/llvm-link.cpp +++ b/llvm/tools/llvm-link/llvm-link.cpp @@ -53,13 +53,13 @@ DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden); // LoadFile - Read the specified bitcode file in and return it. This routine // searches the link path for the specified file to try to find it... // -static inline std::auto_ptr<Module> LoadFile(const char *argv0, - const std::string &FN, - LLVMContext& Context) { +static inline OwningPtr<Module> LoadFile(const char *argv0, + const std::string &FN, + LLVMContext& Context) { sys::Path Filename; if (!Filename.set(FN)) { errs() << "Invalid file name: '" << FN << "'\n"; - return std::auto_ptr<Module>(); + return OwningPtr<Module>(); } SMDiagnostic Err; @@ -68,10 +68,10 @@ static inline std::auto_ptr<Module> LoadFile(const char *argv0, const std::string &FNStr = Filename.str(); Result = ParseIRFile(FNStr, Err, Context); - if (Result) return std::auto_ptr<Module>(Result); // Load successful! + if (Result) return OwningPtr<Module>(Result); // Load successful! Err.print(argv0, errs()); - return std::auto_ptr<Module>(); + return OwningPtr<Module>(); } int main(int argc, char **argv) { @@ -86,8 +86,8 @@ int main(int argc, char **argv) { unsigned BaseArg = 0; std::string ErrorMessage; - std::auto_ptr<Module> Composite(LoadFile(argv[0], - InputFilenames[BaseArg], Context)); + OwningPtr<Module> Composite(LoadFile(argv[0], + InputFilenames[BaseArg], Context)); if (Composite.get() == 0) { errs() << argv[0] << ": error loading file '" << InputFilenames[BaseArg] << "'\n"; @@ -95,8 +95,7 @@ int main(int argc, char **argv) { } for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) { - std::auto_ptr<Module> M(LoadFile(argv[0], - InputFilenames[i], Context)); + OwningPtr<Module> M(LoadFile(argv[0], InputFilenames[i], Context)); if (M.get() == 0) { errs() << argv[0] << ": error loading file '" <<InputFilenames[i]<< "'\n"; return 1; |