diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 13:00:30 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-20 13:00:30 +0000 |
commit | 6f2c88a08b30e9e22d71ed7d7abb89bbcc9d1629 (patch) | |
tree | cb9c4a3c46ec16fda8286aee56c13443f08efcad /tools/llvm-ar/Archive.cpp | |
parent | e9ff273acaea782259429068fc73abf2ed2684c2 (diff) | |
download | llvm-6f2c88a08b30e9e22d71ed7d7abb89bbcc9d1629.tar.gz llvm-6f2c88a08b30e9e22d71ed7d7abb89bbcc9d1629.tar.bz2 llvm-6f2c88a08b30e9e22d71ed7d7abb89bbcc9d1629.tar.xz |
Remove remaining bits of the old LLVM specific symtab handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184418 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar/Archive.cpp')
-rw-r--r-- | tools/llvm-ar/Archive.cpp | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/tools/llvm-ar/Archive.cpp b/tools/llvm-ar/Archive.cpp index dcb640198e..cac65cf770 100644 --- a/tools/llvm-ar/Archive.cpp +++ b/tools/llvm-ar/Archive.cpp @@ -141,8 +141,8 @@ bool ArchiveMember::replaceWith(StringRef newFile, std::string* ErrMsg) { // Archive class. Everything else (default,copy) is deprecated. This just // initializes and maps the file into memory, if requested. Archive::Archive(StringRef filename, LLVMContext &C) - : archPath(filename), members(), mapfile(0), base(0), symTab(), strtab(), - symTabSize(0), firstFileOffset(0), modules(), foreignST(0), Context(C) {} + : archPath(filename), members(), mapfile(0), base(0), strtab(), + firstFileOffset(0), modules(), Context(C) {} bool Archive::mapToMemory(std::string* ErrMsg) { @@ -163,18 +163,8 @@ void Archive::cleanUpMemory() { mapfile = 0; base = 0; - // Forget the entire symbol table - symTab.clear(); - symTabSize = 0; - firstFileOffset = 0; - // Free the foreign symbol table member - if (foreignST) { - delete foreignST; - foreignST = 0; - } - // Delete any Modules and ArchiveMember's we've allocated as a result of // symbol table searches. for (ModuleMap::iterator I=modules.begin(), E=modules.end(); I != E; ++I ) { @@ -188,47 +178,3 @@ Archive::~Archive() { cleanUpMemory(); } - - -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->hasLocalLinkage()) - 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->hasLocalLinkage()) - if (!FI->getName().empty()) - symbols.push_back(FI->getName()); - - // Loop over aliases - for (Module::alias_iterator AI = M->alias_begin(), AE = M->alias_end(); - AI != AE; ++AI) { - if (AI->hasName()) - symbols.push_back(AI->getName()); - } -} - -Module* -llvm::GetBitcodeSymbols(const char *BufPtr, unsigned Length, - const std::string& ModuleID, - LLVMContext& Context, - std::vector<std::string>& symbols, - std::string* ErrMsg) { - // Get the module. - OwningPtr<MemoryBuffer> Buffer( - MemoryBuffer::getMemBufferCopy(StringRef(BufPtr, Length),ModuleID.c_str())); - - Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg); - if (!M) - return 0; - - // Get the symbols - getSymbols(M, symbols); - - // Done with the module. Note that it's the caller's responsibility to delete - // the Module. - return M; -} |