From 2d1ee6c0d5e92a2dd1b464382725bb9204313a5e Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 24 Aug 2004 22:46:20 +0000 Subject: [PATCH] Add a wrapper for extraction of the dependent libraries from a bytecode file. llvm-svn: 16037 --- lib/Bytecode/Reader/ReaderWrappers.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/Bytecode/Reader/ReaderWrappers.cpp b/lib/Bytecode/Reader/ReaderWrappers.cpp index 7a37d3966e1..2930a42c63d 100644 --- a/lib/Bytecode/Reader/ReaderWrappers.cpp +++ b/lib/Bytecode/Reader/ReaderWrappers.cpp @@ -331,4 +331,18 @@ Module* llvm::AnalyzeBytecodeBuffer( } } +bool llvm::GetBytecodeDependentLibraries(const std::string &fname, + std::vector& deplibs) { + try { + std::auto_ptr AMP( getBytecodeModuleProvider(fname)); + Module* M = AMP->releaseModule(); + deplibs = M->getLibraries(); + delete M; + return true; + } catch (...) { + deplibs.clear(); + return false; + } +} + // vim: sw=2 ai