summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-20 12:45:47 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-20 12:45:47 +0000
commite9ff273acaea782259429068fc73abf2ed2684c2 (patch)
tree08b01a35b9e04c5657b1f9c7fc8c0f80236f8214 /tools
parentf0436b82fd6153d41f8ca30ec9cb8ea2a8dabda3 (diff)
downloadllvm-e9ff273acaea782259429068fc73abf2ed2684c2.tar.gz
llvm-e9ff273acaea782259429068fc73abf2ed2684c2.tar.bz2
llvm-e9ff273acaea782259429068fc73abf2ed2684c2.tar.xz
Remove more unused functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184416 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-ar/Archive.h18
-rw-r--r--tools/llvm-ar/ArchiveReader.cpp63
2 files changed, 0 insertions, 81 deletions
diff --git a/tools/llvm-ar/Archive.h b/tools/llvm-ar/Archive.h
index 52fb0effb3..33a12c0c90 100644
--- a/tools/llvm-ar/Archive.h
+++ b/tools/llvm-ar/Archive.h
@@ -323,24 +323,6 @@ class Archive {
/// @brief Get the offset to the first "real" file member in the archive.
unsigned getFirstFileOffset() { return firstFileOffset; }
- /// This method will scan the archive for bitcode modules, interpret them
- /// and return a vector of the instantiated modules in \p Modules. If an
- /// error occurs, this method will return true. If \p ErrMessage is not null
- /// and an error occurs, \p *ErrMessage will be set to a string explaining
- /// the error that occurred.
- /// @returns true if an error occurred
- /// @brief Instantiate all the bitcode modules located in the archive
- bool getAllModules(std::vector<Module*>& Modules, std::string* ErrMessage);
-
- /// This method determines whether the archive is a properly formed llvm
- /// bitcode archive. It first makes sure the symbol table has been loaded
- /// and has a non-zero size. If it does, then it is an archive. If not,
- /// then it tries to load all the bitcode modules of the archive. Finally,
- /// it returns whether it was successful.
- /// @returns true if the archive is a proper llvm bitcode archive
- /// @brief Determine whether the archive is a proper llvm bitcode archive.
- bool isBitcodeArchive();
-
/// @}
/// @name Mutators
/// @{
diff --git a/tools/llvm-ar/ArchiveReader.cpp b/tools/llvm-ar/ArchiveReader.cpp
index 5a072f1ea9..a9df13eca1 100644
--- a/tools/llvm-ar/ArchiveReader.cpp
+++ b/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;
-}