diff options
author | Rui Ueyama <ruiu@google.com> | 2016-02-28 21:22:40 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-02-28 21:22:40 +0000 |
commit | 701c3250e57a428ca3b0d6fca7760f5810230e89 (patch) | |
tree | 407ae7518c0e572cc17cd592158cf96ae2b4a501 | |
parent | 3b9388f45667fd32d379f0c49027f8ce680f6d68 (diff) | |
download | bcm5719-llvm-701c3250e57a428ca3b0d6fca7760f5810230e89.tar.gz bcm5719-llvm-701c3250e57a428ca3b0d6fca7760f5810230e89.zip |
Remove remaining code for COFF.
llvm-svn: 262193
-rw-r--r-- | lld/include/lld/Core/Alias.h | 100 | ||||
-rw-r--r-- | lld/include/lld/Core/ArchiveLibraryFile.h | 6 | ||||
-rw-r--r-- | lld/include/lld/Core/DefinedAtom.h | 5 | ||||
-rw-r--r-- | lld/include/lld/Core/LinkingContext.h | 6 | ||||
-rw-r--r-- | lld/include/lld/Core/SharedLibraryAtom.h | 2 | ||||
-rw-r--r-- | lld/lib/Core/LinkingContext.cpp | 22 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/FileArchive.cpp | 9 |
7 files changed, 0 insertions, 150 deletions
diff --git a/lld/include/lld/Core/Alias.h b/lld/include/lld/Core/Alias.h deleted file mode 100644 index fa999292fbd..00000000000 --- a/lld/include/lld/Core/Alias.h +++ /dev/null @@ -1,100 +0,0 @@ -//===- lld/Core/Alias.h - Alias atoms -------------------------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Provide alias atoms. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLD_CORE_ALIAS_H -#define LLD_CORE_ALIAS_H - -#include "lld/Core/LLVM.h" -#include "lld/Core/Simple.h" -#include "llvm/ADT/Optional.h" -#include <string> - -namespace lld { - -// An AliasAtom is a zero-size atom representing an alias for other atom. It has -// a LayoutAfter reference to the target atom, so that this atom and the target -// atom will be laid out at the same location in the final result. Initially -// the target atom is an undefined atom. Resolver will replace it with a defined -// one. -// -// It does not have attributes itself. Most member function calls are forwarded -// to the target atom. -class AliasAtom : public SimpleDefinedAtom { -public: - AliasAtom(const File &file, StringRef name) - : SimpleDefinedAtom(file), _name(name) {} - - StringRef name() const override { return _name; } - uint64_t size() const override { return 0; } - ArrayRef<uint8_t> rawContent() const override { return ArrayRef<uint8_t>(); } - - Scope scope() const override { - getTarget(); - return _target ? _target->scope() : scopeLinkageUnit; - } - - Merge merge() const override { - if (_merge.hasValue()) - return _merge.getValue(); - getTarget(); - return _target ? _target->merge() : mergeNo; - } - - void setMerge(Merge val) { _merge = val; } - - ContentType contentType() const override { - getTarget(); - return _target ? _target->contentType() : typeUnknown; - } - - Interposable interposable() const override { - getTarget(); - return _target ? _target->interposable() : interposeNo; - } - - SectionChoice sectionChoice() const override { - getTarget(); - return _target ? _target->sectionChoice() : sectionBasedOnContent; - } - - StringRef customSectionName() const override { - getTarget(); - return _target ? _target->customSectionName() : StringRef(""); - } - - DeadStripKind deadStrip() const override { return _deadStrip; } - void setDeadStrip(DeadStripKind val) { _deadStrip = val; } - -private: - void getTarget() const { - if (_target) - return; - for (const Reference *r : *this) { - if (r->kindNamespace() == lld::Reference::KindNamespace::all && - r->kindValue() == lld::Reference::kindLayoutAfter) { - _target = dyn_cast<DefinedAtom>(r->target()); - return; - } - } - } - - std::string _name; - mutable const DefinedAtom *_target = nullptr; - llvm::Optional<Merge> _merge = DefinedAtom::mergeNo; - DeadStripKind _deadStrip = DefinedAtom::deadStripNormal; -}; - -} // end namespace lld - -#endif diff --git a/lld/include/lld/Core/ArchiveLibraryFile.h b/lld/include/lld/Core/ArchiveLibraryFile.h index ff379d4f3ec..dfb862e7a78 100644 --- a/lld/include/lld/Core/ArchiveLibraryFile.h +++ b/lld/include/lld/Core/ArchiveLibraryFile.h @@ -44,12 +44,6 @@ public: // function doesn't affect correctness. virtual void preload(TaskGroup &group, StringRef symbolName) {} - /// Returns a set of all defined symbols in the archive, i.e. all - /// resolvable symbol using this file. - virtual std::set<StringRef> getDefinedSymbols() { - return std::set<StringRef>(); - } - protected: /// only subclasses of ArchiveLibraryFile can be instantiated ArchiveLibraryFile(StringRef path) : File(path, kindArchiveLibrary) {} diff --git a/lld/include/lld/Core/DefinedAtom.h b/lld/include/lld/Core/DefinedAtom.h index e3ab133e515..1a2f5259607 100644 --- a/lld/include/lld/Core/DefinedAtom.h +++ b/lld/include/lld/Core/DefinedAtom.h @@ -216,11 +216,6 @@ public: /// /// This is used by the linker to order the layout of Atoms so that the /// resulting image is stable and reproducible. - /// - /// Note that this should not be confused with ordinals of exported symbols in - /// Windows DLLs. In Windows terminology, ordinals are symbols' export table - /// indices (small integers) which can be used instead of symbol names to - /// refer items in a DLL. virtual uint64_t ordinal() const = 0; /// \brief the number of bytes of space this atom's content will occupy in the diff --git a/lld/include/lld/Core/LinkingContext.h b/lld/include/lld/Core/LinkingContext.h index c54ab88607e..bd13961f5f3 100644 --- a/lld/include/lld/Core/LinkingContext.h +++ b/lld/include/lld/Core/LinkingContext.h @@ -203,11 +203,6 @@ public: void appendLLVMOption(const char *opt) { _llvmOptions.push_back(opt); } - void addAlias(StringRef from, StringRef to) { _aliasSymbols[from] = to; } - const std::map<std::string, std::string> &getAliases() const { - return _aliasSymbols; - } - std::vector<std::unique_ptr<Node>> &getNodes() { return _nodes; } const std::vector<std::unique_ptr<Node>> &getNodes() const { return _nodes; } @@ -349,7 +344,6 @@ protected: bool _allowShlibUndefines; OutputFileType _outputFileType; std::vector<StringRef> _deadStripRoots; - std::map<std::string, std::string> _aliasSymbols; std::vector<const char *> _llvmOptions; StringRefVector _initialUndefinedSymbols; std::vector<std::unique_ptr<Node>> _nodes; diff --git a/lld/include/lld/Core/SharedLibraryAtom.h b/lld/include/lld/Core/SharedLibraryAtom.h index 1b0c37c4113..0f4648fa357 100644 --- a/lld/include/lld/Core/SharedLibraryAtom.h +++ b/lld/include/lld/Core/SharedLibraryAtom.h @@ -25,9 +25,7 @@ public: }; /// Returns shared library name used to load it at runtime. - /// On linux that is the DT_NEEDED name. /// On Darwin it is the LC_DYLIB_LOAD dylib name. - /// On Windows it is the DLL name that to be referred from .idata section. virtual StringRef loadName() const = 0; /// Returns if shared library symbol can be missing at runtime and if diff --git a/lld/lib/Core/LinkingContext.cpp b/lld/lib/Core/LinkingContext.cpp index 567f15dfe19..54d2c51f39a 100644 --- a/lld/lib/Core/LinkingContext.cpp +++ b/lld/lib/Core/LinkingContext.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -#include "lld/Core/Alias.h" #include "lld/Core/LinkingContext.h" #include "lld/Core/Resolver.h" #include "lld/Core/Simple.h" @@ -73,33 +72,12 @@ LinkingContext::createUndefinedSymbolFile(StringRef filename) const { return std::move(undefinedSymFile); } -std::unique_ptr<File> LinkingContext::createAliasSymbolFile() const { - if (getAliases().empty()) - return nullptr; - std::unique_ptr<SimpleFile> file( - new SimpleFile("<alias>", File::kindUndefinedSymsObject)); - for (const auto &i : getAliases()) { - StringRef from = i.first; - StringRef to = i.second; - SimpleDefinedAtom *fromAtom = new (_allocator) AliasAtom(*file, from); - UndefinedAtom *toAtom = new (_allocator) SimpleUndefinedAtom(*file, to); - fromAtom->addReference(Reference::KindNamespace::all, - Reference::KindArch::all, Reference::kindLayoutAfter, - 0, toAtom, 0); - file->addAtom(*fromAtom); - file->addAtom(*toAtom); - } - return std::move(file); -} - void LinkingContext::createInternalFiles( std::vector<std::unique_ptr<File> > &result) const { if (std::unique_ptr<File> file = createEntrySymbolFile()) result.push_back(std::move(file)); if (std::unique_ptr<File> file = createUndefinedSymbolFile()) result.push_back(std::move(file)); - if (std::unique_ptr<File> file = createAliasSymbolFile()) - result.push_back(std::move(file)); } void LinkingContext::addPasses(PassManager &pm) {} diff --git a/lld/lib/ReaderWriter/FileArchive.cpp b/lld/lib/ReaderWriter/FileArchive.cpp index a09923f57d0..7786d11dced 100644 --- a/lld/lib/ReaderWriter/FileArchive.cpp +++ b/lld/lib/ReaderWriter/FileArchive.cpp @@ -149,15 +149,6 @@ public: return _noAbsoluteAtoms; } - /// Returns a set of all defined symbols in the archive. - std::set<StringRef> getDefinedSymbols() override { - parse(); - std::set<StringRef> ret; - for (const auto &e : _symbolMemberMap) - ret.insert(e.first); - return ret; - } - protected: std::error_code doParse() override { // Make Archive object which will be owned by FileArchive object. |