diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 12:45:47 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 12:45:47 +0000 |
| commit | 85ae66bf4883eb295c3f8414c782e2cdce2933e5 (patch) | |
| tree | 77bed37b9d70edfd744f669c72373800c5dfc1c7 /llvm/tools/llvm-ar/ArchiveReader.cpp | |
| parent | 623c90455f468f9f1afcfbcffb59caa7cb21b71d (diff) | |
| download | bcm5719-llvm-85ae66bf4883eb295c3f8414c782e2cdce2933e5.tar.gz bcm5719-llvm-85ae66bf4883eb295c3f8414c782e2cdce2933e5.zip | |
Remove more unused functions.
llvm-svn: 184416
Diffstat (limited to 'llvm/tools/llvm-ar/ArchiveReader.cpp')
| -rw-r--r-- | llvm/tools/llvm-ar/ArchiveReader.cpp | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/llvm/tools/llvm-ar/ArchiveReader.cpp b/llvm/tools/llvm-ar/ArchiveReader.cpp index 5a072f1ea9c..a9df13eca11 100644 --- a/llvm/tools/llvm-ar/ArchiveReader.cpp +++ b/llvm/tools/llvm-ar/ArchiveReader.cpp @@ -275,29 +275,6 @@ Archive::OpenAndLoad(StringRef File, LLVMContext& C, return result.take(); } -// Get all the bitcode modules from the archive -bool -Archive::getAllModules(std::vector<Module*>& Modules, - std::string* ErrMessage) { - - for (iterator I=begin(), E=end(); I != E; ++I) { - if (I->isBitcode()) { - std::string FullMemberName = archPath + "(" + I->getPath().str() + ")"; - MemoryBuffer *Buffer = - MemoryBuffer::getMemBufferCopy(StringRef(I->getData(), I->getSize()), - FullMemberName.c_str()); - - Module *M = ParseBitcodeFile(Buffer, Context, ErrMessage); - delete Buffer; - if (!M) - return true; - - Modules.push_back(M); - } - } - return false; -} - // Load just the symbol table from the archive file bool Archive::loadSymbolTable(std::string* ErrorMsg) { @@ -361,43 +338,3 @@ Archive::loadSymbolTable(std::string* ErrorMsg) { firstFileOffset = FirstFile - base; return true; } - -bool Archive::isBitcodeArchive() { - // Make sure the symTab has been loaded. In most cases this should have been - // done when the archive was constructed, but still, this is just in case. - if (symTab.empty()) - if (!loadSymbolTable(0)) - return false; - - // Now that we know it's been loaded, return true - // if it has a size - if (symTab.size()) return true; - - // We still can't be sure it isn't a bitcode archive - if (!loadArchive(0)) - return false; - - std::vector<Module *> Modules; - std::string ErrorMessage; - - // Scan the archive, trying to load a bitcode member. We only load one to - // see if this works. - for (iterator I = begin(), E = end(); I != E; ++I) { - if (!I->isBitcode()) - continue; - - std::string FullMemberName = archPath + "(" + I->getPath().str() + ")"; - - MemoryBuffer *Buffer = - MemoryBuffer::getMemBufferCopy(StringRef(I->getData(), I->getSize()), - FullMemberName.c_str()); - Module *M = ParseBitcodeFile(Buffer, Context); - delete Buffer; - if (!M) - return false; // Couldn't parse bitcode, not a bitcode archive. - delete M; - return true; - } - - return false; -} |

