move an llvmc-specific function out of the bcreader into llvmc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34021 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-02-07 23:48:32 +00:00
parent c6d0b16429
commit 7cf7c2b703
3 changed files with 17 additions and 28 deletions

View File

@ -81,18 +81,6 @@ Module* ParseBytecodeBuffer(
std::string *ErrMsg = 0 ///< Optional place to return an error message
);
/// This function will read only the necessary parts of a bytecode file in order
/// to determine the list of dependent libraries encoded within it. The \p
/// deplibs parameter will contain a vector of strings of the bytecode module's
/// dependent libraries.
/// @returns true on error, false otherwise
/// @brief Get the list of dependent libraries from a bytecode file.
bool GetBytecodeDependentLibraries(
const std::string &fileName, ///< File name to read bytecode from
Module::LibraryListType& deplibs, ///< List of dependent libraries extracted
BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
std::string* ErrMsg = 0 ///< Optional error message holder
);
/// This function will read only the necessary parts of a bytecode file in order
/// to obtain a list of externally visible global symbols that the bytecode

View File

@ -256,22 +256,6 @@ Module *llvm::ParseBytecodeFile(const std::string &Filename,
}
bool llvm::GetBytecodeDependentLibraries(const std::string &fname,
Module::LibraryListType& deplibs,
BCDecompressor_t *BCDC,
std::string* ErrMsg) {
ModuleProvider* MP = getBytecodeModuleProvider(fname, BCDC, ErrMsg);
if (!MP) {
deplibs.clear();
return true;
}
Module* M = MP->releaseModule(ErrMsg);
deplibs = M->getLibraries();
delete M;
delete MP;
return false;
}
static void getSymbols(Module*M, std::vector<std::string>& symbols) {
// Loop over global variables
for (Module::global_iterator GI = M->global_begin(), GE=M->global_end(); GI != GE; ++GI)

View File

@ -62,6 +62,23 @@ void DumpConfigData(CompilerDriver::ConfigData* cd, const std::string& type ){
DumpAction(&cd->Linker);
}
static bool GetBytecodeDependentLibraries(const std::string &fname,
Module::LibraryListType& deplibs,
BCDecompressor_t *BCDC,
std::string* ErrMsg) {
ModuleProvider* MP = getBytecodeModuleProvider(fname, BCDC, ErrMsg);
if (!MP) {
deplibs.clear();
return true;
}
Module* M = MP->releaseModule(ErrMsg);
deplibs = M->getLibraries();
delete M;
delete MP;
return false;
}
class CompilerDriverImpl : public CompilerDriver {
/// @name Constructors
/// @{