mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-24 06:27:56 +00:00
move an llvmc-specific function out of the bcreader into llvmc.
llvm-svn: 34021
This commit is contained in:
parent
c5f3b3b01b
commit
1c17d65878
@ -81,18 +81,6 @@ Module* ParseBytecodeBuffer(
|
|||||||
std::string *ErrMsg = 0 ///< Optional place to return an error message
|
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
|
/// 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
|
/// to obtain a list of externally visible global symbols that the bytecode
|
||||||
|
@ -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) {
|
static void getSymbols(Module*M, std::vector<std::string>& symbols) {
|
||||||
// Loop over global variables
|
// Loop over global variables
|
||||||
for (Module::global_iterator GI = M->global_begin(), GE=M->global_end(); GI != GE; ++GI)
|
for (Module::global_iterator GI = M->global_begin(), GE=M->global_end(); GI != GE; ++GI)
|
||||||
|
@ -62,6 +62,23 @@ void DumpConfigData(CompilerDriver::ConfigData* cd, const std::string& type ){
|
|||||||
DumpAction(&cd->Linker);
|
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 {
|
class CompilerDriverImpl : public CompilerDriver {
|
||||||
/// @name Constructors
|
/// @name Constructors
|
||||||
/// @{
|
/// @{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user