Changes necessary to enable linking of archives without LLVM symbol tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17811 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Bytecode/Reader/ReaderWrappers.cpp b/lib/Bytecode/Reader/ReaderWrappers.cpp
index de2fd03..7cdcf64 100644
--- a/lib/Bytecode/Reader/ReaderWrappers.cpp
+++ b/lib/Bytecode/Reader/ReaderWrappers.cpp
@@ -391,26 +391,27 @@
   }
 }
 
-bool llvm::GetBytecodeSymbols(const unsigned char*Buffer, unsigned Length,
+ModuleProvider* 
+llvm::GetBytecodeSymbols(const unsigned char*Buffer, unsigned Length,
                               const std::string& ModuleID,
                               std::vector<std::string>& symbols) {
 
   try {
-    std::auto_ptr<ModuleProvider>
-      AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID));
+    ModuleProvider* MP = 
+      getBytecodeBufferModuleProvider(Buffer, Length, ModuleID);
 
     // Get the module from the provider
-    Module* M = AMP->releaseModule();
+    Module* M = MP->materializeModule();
 
     // Get the symbols
     getSymbols(M, symbols);
 
     // Done with the module
-    delete M;
-    return true;
+    return MP;
 
   } catch (...) {
-    return false;
+    // Fall through
   }
+  return 0;
 }
 // vim: sw=2 ai