aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-07 23:53:17 +0000
committerChris Lattner <sabre@nondot.org>2007-02-07 23:53:17 +0000
commitf36c7b860de5cae1ffc817fce430210e942a0bf7 (patch)
tree54e6e949ae1bab5397a3060cbc674a448847bf2d /lib/Bytecode/Reader
parent7cf7c2b703e648cdf1184d406bd53a65050be212 (diff)
move archive-specific stuff out of bcreader into archive library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader')
-rw-r--r--lib/Bytecode/Reader/ReaderWrappers.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/lib/Bytecode/Reader/ReaderWrappers.cpp b/lib/Bytecode/Reader/ReaderWrappers.cpp
index 63b5fe9b67..ea1495ecc5 100644
--- a/lib/Bytecode/Reader/ReaderWrappers.cpp
+++ b/lib/Bytecode/Reader/ReaderWrappers.cpp
@@ -254,70 +254,3 @@ Module *llvm::ParseBytecodeFile(const std::string &Filename,
delete MP;
return M;
}
-
-
-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)
- if (!GI->isDeclaration() && !GI->hasInternalLinkage())
- if (!GI->getName().empty())
- symbols.push_back(GI->getName());
-
- // Loop over functions.
- for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
- if (!FI->isDeclaration() && !FI->hasInternalLinkage())
- if (!FI->getName().empty())
- symbols.push_back(FI->getName());
-}
-
-// Get just the externally visible defined symbols from the bytecode
-bool llvm::GetBytecodeSymbols(const sys::Path& fName,
- std::vector<std::string>& symbols,
- BCDecompressor_t *BCDC,
- std::string* ErrMsg) {
- ModuleProvider *MP = getBytecodeModuleProvider(fName.toString(), BCDC,ErrMsg);
- if (!MP)
- return true;
-
- // Get the module from the provider
- Module* M = MP->materializeModule();
- if (M == 0) {
- delete MP;
- return true;
- }
-
- // Get the symbols
- getSymbols(M, symbols);
-
- // Done with the module.
- delete MP;
- return true;
-}
-
-ModuleProvider*
-llvm::GetBytecodeSymbols(const unsigned char*Buffer, unsigned Length,
- const std::string& ModuleID,
- std::vector<std::string>& symbols,
- BCDecompressor_t *BCDC,
- std::string* ErrMsg) {
- // Get the module provider
- ModuleProvider* MP =
- getBytecodeBufferModuleProvider(Buffer, Length, ModuleID, BCDC, ErrMsg, 0);
- if (!MP)
- return 0;
-
- // Get the module from the provider
- Module* M = MP->materializeModule();
- if (M == 0) {
- delete MP;
- return 0;
- }
-
- // Get the symbols
- getSymbols(M, symbols);
-
- // Done with the module. Note that ModuleProvider will delete the
- // Module when it is deleted. Also note that its the caller's responsibility
- // to delete the ModuleProvider.
- return MP;
-}