diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-11-27 09:55:56 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-11-27 09:55:56 +0000 |
commit | efd08d413c077956478fbde90fd65aa6f179bb39 (patch) | |
tree | 0cdc57bc794b7e0e6d54a9d147188b980b053d27 /lib | |
parent | 1db3152ddee056c2433ec29e3286e625ff6ae6f5 (diff) |
Remove the dependent libraries feature.
The dependent libraries feature was never used and has bit-rotted. Remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AsmParser/LLLexer.cpp | 1 | ||||
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 26 | ||||
-rw-r--r-- | lib/AsmParser/LLParser.h | 1 | ||||
-rw-r--r-- | lib/AsmParser/LLToken.h | 1 | ||||
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 7 | ||||
-rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 4 | ||||
-rw-r--r-- | lib/Linker/LinkItems.cpp | 25 | ||||
-rw-r--r-- | lib/Linker/LinkModules.cpp | 13 | ||||
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Utils/CloneModule.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 15 | ||||
-rw-r--r-- | lib/VMCore/Module.cpp | 18 |
12 files changed, 0 insertions, 123 deletions
diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index eb176aefcb..c498da7352 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -486,7 +486,6 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(target); KEYWORD(triple); KEYWORD(unwind); - KEYWORD(deplibs); KEYWORD(datalayout); KEYWORD(volatile); KEYWORD(atomic); diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 65f4245062..8a9f951908 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -168,7 +168,6 @@ bool LLParser::ParseTopLevelEntities() { case lltok::kw_define: if (ParseDefine()) return true; break; case lltok::kw_module: if (ParseModuleAsm()) return true; break; case lltok::kw_target: if (ParseTargetDefinition()) return true; break; - case lltok::kw_deplibs: if (ParseDepLibs()) return true; break; case lltok::LocalVarID: if (ParseUnnamedType()) return true; break; case lltok::LocalVar: if (ParseNamedType()) return true; break; case lltok::GlobalID: if (ParseUnnamedGlobal()) return true; break; @@ -264,31 +263,6 @@ bool LLParser::ParseTargetDefinition() { } } -/// toplevelentity -/// ::= 'deplibs' '=' '[' ']' -/// ::= 'deplibs' '=' '[' STRINGCONSTANT (',' STRINGCONSTANT)* ']' -bool LLParser::ParseDepLibs() { - assert(Lex.getKind() == lltok::kw_deplibs); - Lex.Lex(); - if (ParseToken(lltok::equal, "expected '=' after deplibs") || - ParseToken(lltok::lsquare, "expected '=' after deplibs")) - return true; - - if (EatIfPresent(lltok::rsquare)) - return false; - - std::string Str; - if (ParseStringConstant(Str)) return true; - M->addLibrary(Str); - - while (EatIfPresent(lltok::comma)) { - if (ParseStringConstant(Str)) return true; - M->addLibrary(Str); - } - - return ParseToken(lltok::rsquare, "expected ']' at end of list"); -} - /// ParseUnnamedType: /// ::= LocalVarID '=' 'type' type bool LLParser::ParseUnnamedType() { diff --git a/lib/AsmParser/LLParser.h b/lib/AsmParser/LLParser.h index 8e04705a7b..5cebd974f3 100644 --- a/lib/AsmParser/LLParser.h +++ b/lib/AsmParser/LLParser.h @@ -216,7 +216,6 @@ namespace llvm { bool ParseTopLevelEntities(); bool ValidateEndOfModule(); bool ParseTargetDefinition(); - bool ParseDepLibs(); bool ParseModuleAsm(); bool ParseUnnamedType(); bool ParseNamedType(); diff --git a/lib/AsmParser/LLToken.h b/lib/AsmParser/LLToken.h index 1ec1b1e126..d102d91b3b 100644 --- a/lib/AsmParser/LLToken.h +++ b/lib/AsmParser/LLToken.h @@ -54,7 +54,6 @@ namespace lltok { kw_target, kw_triple, kw_unwind, - kw_deplibs, kw_datalayout, kw_volatile, kw_atomic, diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 944a3255cd..dcbd68aee2 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1564,13 +1564,6 @@ bool BitcodeReader::ParseModule(bool Resume) { TheModule->setModuleInlineAsm(S); break; } - case bitc::MODULE_CODE_DEPLIB: { // DEPLIB: [strchr x N] - std::string S; - if (ConvertToString(Record, 0, S)) - return Error("Invalid MODULE_CODE_DEPLIB record"); - TheModule->addLibrary(S); - break; - } case bitc::MODULE_CODE_SECTIONNAME: { // SECTIONNAME: [strchr x N] std::string S; if (ConvertToString(Record, 0, S)) diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 6206479b8d..d9493afca7 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -392,10 +392,6 @@ static unsigned getEncodedThreadLocalMode(const GlobalVariable *GV) { // descriptors for global variables, and function prototype info. static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, BitstreamWriter &Stream) { - // Emit the list of dependent libraries for the Module. - for (Module::lib_iterator I = M->lib_begin(), E = M->lib_end(); I != E; ++I) - WriteStringRecord(bitc::MODULE_CODE_DEPLIB, *I, 0/*TODO*/, Stream); - // Emit various pieces of data attached to a module. if (!M->getTargetTriple().empty()) WriteStringRecord(bitc::MODULE_CODE_TRIPLE, M->getTargetTriple(), diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp index 52a0d175a5..e4fecebc38 100644 --- a/lib/Linker/LinkItems.cpp +++ b/lib/Linker/LinkItems.cpp @@ -51,20 +51,6 @@ Linker::LinkInItems(const ItemList& Items, ItemList& NativeItems) { } } - // At this point we have processed all the link items provided to us. Since - // we have an aggregated module at this point, the dependent libraries in - // that module should also be aggregated with duplicates eliminated. This is - // now the time to process the dependent libraries to resolve any remaining - // symbols. - bool is_native; - for (Module::lib_iterator I = Composite->lib_begin(), - E = Composite->lib_end(); I != E; ++I) { - if(LinkInLibrary(*I, is_native)) - return true; - if (is_native) - NativeItems.push_back(std::make_pair(*I, true)); - } - return false; } @@ -128,17 +114,6 @@ bool Linker::LinkInLibraries(const std::vector<std::string> &Libraries) { if (LinkInLibrary(Libraries[i], is_native)) return true; - // At this point we have processed all the libraries provided to us. Since - // we have an aggregated module at this point, the dependent libraries in - // that module should also be aggregated with duplicates eliminated. This is - // now the time to process the dependent libraries to resolve any remaining - // symbols. - const Module::LibraryListType& DepLibs = Composite->getLibraries(); - for (Module::LibraryListType::const_iterator I = DepLibs.begin(), - E = DepLibs.end(); I != E; ++I) - if (LinkInLibrary(*I, is_native)) - return true; - return false; } diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index a6599bfe4f..62f9d19314 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1187,19 +1187,6 @@ bool ModuleLinker::run() { SrcM->getModuleInlineAsm()); } - // Update the destination module's dependent libraries list with the libraries - // from the source module. There's no opportunity for duplicates here as the - // Module ensures that duplicate insertions are discarded. - for (Module::lib_iterator SI = SrcM->lib_begin(), SE = SrcM->lib_end(); - SI != SE; ++SI) - DstM->addLibrary(*SI); - - // If the source library's module id is in the dependent library list of the - // destination library, remove it since that module is now linked in. - StringRef ModuleId = SrcM->getModuleIdentifier(); - if (!ModuleId.empty()) - DstM->removeLibrary(sys::path::stem(ModuleId)); - // Loop over all of the linked values to compute type mappings. computeTypeMapping(); diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 5c909903f9..b5a20373bb 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -1941,14 +1941,6 @@ void CppWriter::printModule(const std::string& fname, } nl(Out); - // Loop over the dependent libraries and emit them. - Module::lib_iterator LI = TheModule->lib_begin(); - Module::lib_iterator LE = TheModule->lib_end(); - while (LI != LE) { - Out << "mod->addLibrary(\"" << *LI << "\");"; - nl(Out); - ++LI; - } printModuleBody(); nl(Out) << "return mod;"; nl(Out,-1) << "}"; diff --git a/lib/Transforms/Utils/CloneModule.cpp b/lib/Transforms/Utils/CloneModule.cpp index 1dac6b5b8b..22a8e4bc2d 100644 --- a/lib/Transforms/Utils/CloneModule.cpp +++ b/lib/Transforms/Utils/CloneModule.cpp @@ -38,10 +38,6 @@ Module *llvm::CloneModule(const Module *M, ValueToValueMapTy &VMap) { New->setTargetTriple(M->getTargetTriple()); New->setModuleInlineAsm(M->getModuleInlineAsm()); - // Copy all of the dependent libraries over. - for (Module::lib_iterator I = M->lib_begin(), E = M->lib_end(); I != E; ++I) - New->addLibrary(*I); - // Loop over all of the global variables, making corresponding globals in the // new module. Here we add them to the VMap and to the new Module. We // don't worry about attributes or initializers, they will come later. diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 433f3e011d..aa70498c07 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1303,21 +1303,6 @@ void AssemblyWriter::printModule(const Module *M) { } } - // Loop over the dependent libraries and emit them. - Module::lib_iterator LI = M->lib_begin(); - Module::lib_iterator LE = M->lib_end(); - if (LI != LE) { - Out << '\n'; - Out << "deplibs = [ "; - while (LI != LE) { - Out << '"' << *LI << '"'; - ++LI; - if (LI != LE) - Out << ", "; - } - Out << " ]"; - } - printTypeIdentities(); // Output all globals. diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 5b5176b3c7..3602a7a8f3 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -55,7 +55,6 @@ Module::~Module() { GlobalList.clear(); FunctionList.clear(); AliasList.clear(); - LibraryList.clear(); NamedMDList.clear(); delete ValSymTab; delete static_cast<StringMap<NamedMDNode *> *>(NamedMDSymTab); @@ -450,20 +449,3 @@ void Module::dropAllReferences() { for(Module::alias_iterator I = alias_begin(), E = alias_end(); I != E; ++I) I->dropAllReferences(); } - -void Module::addLibrary(StringRef Lib) { - for (Module::lib_iterator I = lib_begin(), E = lib_end(); I != E; ++I) - if (*I == Lib) - return; - LibraryList.push_back(Lib); -} - -void Module::removeLibrary(StringRef Lib) { - LibraryListType::iterator I = LibraryList.begin(); - LibraryListType::iterator E = LibraryList.end(); - for (;I != E; ++I) - if (*I == Lib) { - LibraryList.erase(I); - return; - } -} |