diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-16 06:40:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-16 06:40:54 +0000 |
commit | a4d0c6fb94003609d1e00a96887c9db12d6f1936 (patch) | |
tree | 740c5fc96f0f4eaf3e873b0b680c1e9c9de2e035 /lib | |
parent | 90c18c5c69d9c451e5fdca1e4b4b95e8ed13291a (diff) | |
download | external_llvm-a4d0c6fb94003609d1e00a96887c9db12d6f1936.zip external_llvm-a4d0c6fb94003609d1e00a96887c9db12d6f1936.tar.gz external_llvm-a4d0c6fb94003609d1e00a96887c9db12d6f1936.tar.bz2 |
use an autoptr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17875 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Linker/LinkArchives.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Linker/LinkArchives.cpp b/lib/Linker/LinkArchives.cpp index 11d242a..2cccc98 100644 --- a/lib/Linker/LinkArchives.cpp +++ b/lib/Linker/LinkArchives.cpp @@ -195,18 +195,14 @@ bool llvm::LinkInArchive(Module *M, for (std::set<ModuleProvider*>::iterator I=Modules.begin(), E=Modules.end(); I != E; ++I) { // Get the module we must link in. - Module* aModule = (*I)->releaseModule(); + std::auto_ptr<Module> aModule((*I)->releaseModule()); - // Link it in - if (LinkModules(M, aModule, ErrorMessage)) { + // Link it in. + if (LinkModules(M, aModule.get(), ErrorMessage)) { // don't create a memory leak - delete aModule; delete arch; return true; // Couldn't link in the right object file... } - - // Since we have linked in this object, throw it away now. - delete aModule; } // We have linked in a set of modules determined by the archive to satisfy |