From c7c47681f6895ce617501dbec0ffbc39134c0a25 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 9 May 2014 16:47:20 +0000 Subject: Revert "temporary commit." This reverts accidental commit r208427. llvm-svn: 208433 --- .../PECOFF/LinkerGeneratedSymbolFile.h | 61 ---------------------- 1 file changed, 61 deletions(-) (limited to 'lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h') diff --git a/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h b/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h index e24d86dfa7e..5ff8bc647bd 100644 --- a/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h +++ b/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h @@ -13,9 +13,6 @@ #include "lld/ReaderWriter/PECOFFLinkingContext.h" #include "lld/ReaderWriter/Simple.h" #include "llvm/Support/Allocator.h" -#include "llvm/Support/Debug.h" - -#include namespace lld { namespace pecoff { @@ -89,18 +86,6 @@ private: atom_collection_vector _absoluteAtoms; }; -class SymbolRenameFile : public SimpleFile { -public: - SymbolRenameFile(StringRef from, StringRef to) - : SimpleFile(""), _to(*this, to), _from(*this, from, &_to) { - addAtom(_from); - }; - -private: - COFFUndefinedAtom _to; - COFFUndefinedAtom _from; -}; - } // anonymous namespace // A virtual file containing absolute symbol __ImageBase. __ImageBase (or @@ -156,51 +141,5 @@ private: mutable llvm::BumpPtrAllocator _alloc; }; -class ExportedSymbolRenameFile : public VirtualArchiveLibraryFile { -public: - ExportedSymbolRenameFile(const PECOFFLinkingContext &ctx) - : VirtualArchiveLibraryFile("") { - for (const PECOFFLinkingContext::ExportDesc &desc : ctx.getDllExports()) - _exportedSyms.insert(desc.name); - } - - void addResolvableSymbols(ArchiveLibraryFile *archive) { - std::lock_guard lock(_mutex); - if (_seen.count(archive) > 0) - return; - _seen.insert(archive); - for (const std::string &sym : archive->getDefinedSymbols()) - _resolvableSyms.insert(sym); - } - - const File *find(StringRef sym, bool dataSymbolOnly) const override { - if (_exportedSyms.count(sym) == 0) - return nullptr; - std::string expsym = sym; - expsym.append("@"); - auto it = _resolvableSyms.lower_bound(expsym); - for (auto e = _resolvableSyms.end(); it != e; ++it) { - if (!StringRef(*it).startswith(expsym)) - return nullptr; - if (it->size() == expsym.size()) - continue; - StringRef suffix = it->substr(expsym.size()); - bool digitSuffix = - suffix.find_first_not_of("0123456789") == StringRef::npos; - if (digitSuffix) { - return new (_alloc) SymbolRenameFile(sym, *it); - } - } - return nullptr; - } - -private: - std::set _exportedSyms; - std::set _resolvableSyms; - std::set _seen; - mutable std::mutex _mutex; - mutable llvm::BumpPtrAllocator _alloc; -}; - } // end namespace pecoff } // end namespace lld -- cgit v1.2.3