summaryrefslogtreecommitdiff
path: root/gnu/llvm/tools/lld
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2018-04-06 15:04:13 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2018-04-06 15:04:13 +0000
commitfc8e5da449fb71ee39034ffc2f801aee6783fdac (patch)
tree8684f3fc9686d0191b9a8c44ebda8fabfcab08c8 /gnu/llvm/tools/lld
parent001382570929dd015a4a217b6a5906c8425651d1 (diff)
Tedu files that got removed in LLVM 6.0.0.
Diffstat (limited to 'gnu/llvm/tools/lld')
-rw-r--r--gnu/llvm/tools/lld/COFF/Error.cpp33
-rw-r--r--gnu/llvm/tools/lld/COFF/Error.h38
-rw-r--r--gnu/llvm/tools/lld/COFF/Memory.h52
-rw-r--r--gnu/llvm/tools/lld/ELF/Error.cpp65
-rw-r--r--gnu/llvm/tools/lld/ELF/Error.h61
-rw-r--r--gnu/llvm/tools/lld/ELF/Memory.h67
-rw-r--r--gnu/llvm/tools/lld/ELF/Threads.h90
-rw-r--r--gnu/llvm/tools/lld/include/lld/Config/Version.h51
-rw-r--r--gnu/llvm/tools/lld/include/lld/Config/Version.inc.in5
-rw-r--r--gnu/llvm/tools/lld/include/lld/Core/LLVM.h83
-rw-r--r--gnu/llvm/tools/lld/include/lld/Core/Reproduce.h39
-rw-r--r--gnu/llvm/tools/lld/include/lld/Core/TargetOptionsCommandFlags.h20
-rw-r--r--gnu/llvm/tools/lld/include/lld/Driver/Driver.h32
-rw-r--r--gnu/llvm/tools/lld/lib/Config/CMakeLists.txt9
-rw-r--r--gnu/llvm/tools/lld/lib/Config/Version.cpp57
-rw-r--r--gnu/llvm/tools/lld/lib/Core/Reproduce.cpp66
-rw-r--r--gnu/llvm/tools/lld/lib/Core/TargetOptionsCommandFlags.cpp32
17 files changed, 0 insertions, 800 deletions
diff --git a/gnu/llvm/tools/lld/COFF/Error.cpp b/gnu/llvm/tools/lld/COFF/Error.cpp
deleted file mode 100644
index 602a8544ce2..00000000000
--- a/gnu/llvm/tools/lld/COFF/Error.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===- Error.cpp ----------------------------------------------------------===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Error.h"
-
-#include "llvm/ADT/Twine.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/raw_ostream.h"
-
-namespace lld {
-namespace coff {
-
-void fatal(const Twine &Msg) {
- llvm::errs() << Msg << "\n";
- exit(1);
-}
-
-void fatal(std::error_code EC, const Twine &Msg) {
- fatal(Msg + ": " + EC.message());
-}
-
-void fatal(llvm::Error &Err, const Twine &Msg) {
- fatal(errorToErrorCode(std::move(Err)), Msg);
-}
-
-} // namespace coff
-} // namespace lld
diff --git a/gnu/llvm/tools/lld/COFF/Error.h b/gnu/llvm/tools/lld/COFF/Error.h
deleted file mode 100644
index c9f64c66258..00000000000
--- a/gnu/llvm/tools/lld/COFF/Error.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===- Error.h --------------------------------------------------*- C++ -*-===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_COFF_ERROR_H
-#define LLD_COFF_ERROR_H
-
-#include "lld/Core/LLVM.h"
-#include "llvm/Support/Error.h"
-
-namespace lld {
-namespace coff {
-
-LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg);
-LLVM_ATTRIBUTE_NORETURN void fatal(std::error_code EC, const Twine &Prefix);
-LLVM_ATTRIBUTE_NORETURN void fatal(llvm::Error &Err, const Twine &Prefix);
-
-template <class T> T check(ErrorOr<T> &&V, const Twine &Prefix) {
- if (auto EC = V.getError())
- fatal(EC, Prefix);
- return std::move(*V);
-}
-
-template <class T> T check(Expected<T> E, const Twine &Prefix) {
- if (llvm::Error Err = E.takeError())
- fatal(Err, Prefix);
- return std::move(*E);
-}
-
-} // namespace coff
-} // namespace lld
-
-#endif
diff --git a/gnu/llvm/tools/lld/COFF/Memory.h b/gnu/llvm/tools/lld/COFF/Memory.h
deleted file mode 100644
index 526f11344a0..00000000000
--- a/gnu/llvm/tools/lld/COFF/Memory.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//===- Memory.h -------------------------------------------------*- C++ -*-===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// See ELF/Memory.h
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_COFF_MEMORY_H
-#define LLD_COFF_MEMORY_H
-
-#include "llvm/Support/Allocator.h"
-#include "llvm/Support/StringSaver.h"
-#include <vector>
-
-namespace lld {
-namespace coff {
-
-extern llvm::BumpPtrAllocator BAlloc;
-extern llvm::StringSaver Saver;
-
-struct SpecificAllocBase {
- SpecificAllocBase() { Instances.push_back(this); }
- virtual ~SpecificAllocBase() = default;
- virtual void reset() = 0;
- static std::vector<SpecificAllocBase *> Instances;
-};
-
-template <class T> struct SpecificAlloc : public SpecificAllocBase {
- void reset() override { Alloc.DestroyAll(); }
- llvm::SpecificBumpPtrAllocator<T> Alloc;
-};
-
-template <typename T, typename... U> T *make(U &&... Args) {
- static SpecificAlloc<T> Alloc;
- return new (Alloc.Alloc.Allocate()) T(std::forward<U>(Args)...);
-}
-
-inline void freeArena() {
- for (SpecificAllocBase *Alloc : SpecificAllocBase::Instances)
- Alloc->reset();
- BAlloc.Reset();
-}
-}
-}
-
-#endif
diff --git a/gnu/llvm/tools/lld/ELF/Error.cpp b/gnu/llvm/tools/lld/ELF/Error.cpp
deleted file mode 100644
index 59a49c17b97..00000000000
--- a/gnu/llvm/tools/lld/ELF/Error.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===- Error.cpp ----------------------------------------------------------===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Error.h"
-#include "Config.h"
-
-#include "llvm/ADT/Twine.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/raw_ostream.h"
-
-using namespace llvm;
-
-namespace lld {
-namespace elf {
-
-bool HasError;
-raw_ostream *ErrorOS;
-
-void log(const Twine &Msg) {
- if (Config->Verbose)
- outs() << Msg << "\n";
-}
-
-void warning(const Twine &Msg) {
- if (Config->FatalWarnings)
- error(Msg);
- else
- *ErrorOS << Msg << "\n";
-}
-
-void error(const Twine &Msg) {
- *ErrorOS << Msg << "\n";
- HasError = true;
-}
-
-void error(std::error_code EC, const Twine &Prefix) {
- error(Prefix + ": " + EC.message());
-}
-
-void fatal(const Twine &Msg) {
- *ErrorOS << Msg << "\n";
- exit(1);
-}
-
-void fatal(const Twine &Msg, const Twine &Prefix) {
- fatal(Prefix + ": " + Msg);
-}
-
-void check(std::error_code EC) {
- if (EC)
- fatal(EC.message());
-}
-
-void check(Error Err) {
- check(errorToErrorCode(std::move(Err)));
-}
-
-} // namespace elf
-} // namespace lld
diff --git a/gnu/llvm/tools/lld/ELF/Error.h b/gnu/llvm/tools/lld/ELF/Error.h
deleted file mode 100644
index 552f5049846..00000000000
--- a/gnu/llvm/tools/lld/ELF/Error.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//===- Error.h --------------------------------------------------*- C++ -*-===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_COFF_ERROR_H
-#define LLD_COFF_ERROR_H
-
-#include "lld/Core/LLVM.h"
-
-namespace lld {
-namespace elf {
-
-extern bool HasError;
-extern llvm::raw_ostream *ErrorOS;
-
-void log(const Twine &Msg);
-void warning(const Twine &Msg);
-
-void error(const Twine &Msg);
-void error(std::error_code EC, const Twine &Prefix);
-
-template <typename T> void error(const ErrorOr<T> &V, const Twine &Prefix) {
- error(V.getError(), Prefix);
-}
-
-LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg);
-LLVM_ATTRIBUTE_NORETURN void fatal(const Twine &Msg, const Twine &Prefix);
-
-template <class T> T check(ErrorOr<T> E) {
- if (auto EC = E.getError())
- fatal(EC.message());
- return std::move(*E);
-}
-
-template <class T> T check(Expected<T> E) {
- if (!E)
- fatal(errorToErrorCode(E.takeError()).message());
- return std::move(*E);
-}
-
-template <class T> T check(ErrorOr<T> E, const Twine &Prefix) {
- if (auto EC = E.getError())
- fatal(EC.message(), Prefix);
- return std::move(*E);
-}
-
-template <class T> T check(Expected<T> E, const Twine &Prefix) {
- if (!E)
- fatal(errorToErrorCode(E.takeError()).message(), Prefix);
- return std::move(*E);
-}
-
-} // namespace elf
-} // namespace lld
-
-#endif
diff --git a/gnu/llvm/tools/lld/ELF/Memory.h b/gnu/llvm/tools/lld/ELF/Memory.h
deleted file mode 100644
index e5a04ed1e5a..00000000000
--- a/gnu/llvm/tools/lld/ELF/Memory.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//===- Memory.h -------------------------------------------------*- C++ -*-===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines arena allocators.
-//
-// Almost all large objects, such as files, sections or symbols, are
-// used for the entire lifetime of the linker once they are created.
-// This usage characteristic makes arena allocator an attractive choice
-// where the entire linker is one arena. With an arena, newly created
-// objects belong to the arena and freed all at once when everything is done.
-// Arena allocators are efficient and easy to understand.
-// Most objects are allocated using the arena allocators defined by this file.
-//
-// If you edit this file, please edit COFF/Memory.h too.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_ELF_MEMORY_H
-#define LLD_ELF_MEMORY_H
-
-#include "llvm/Support/Allocator.h"
-#include "llvm/Support/StringSaver.h"
-#include <vector>
-
-namespace lld {
-namespace elf {
-
-// Use this arena if your object doesn't have a destructor.
-extern llvm::BumpPtrAllocator BAlloc;
-extern llvm::StringSaver Saver;
-
-// These two classes are hack to keep track of all
-// SpecificBumpPtrAllocator instances.
-struct SpecificAllocBase {
- SpecificAllocBase() { Instances.push_back(this); }
- virtual ~SpecificAllocBase() = default;
- virtual void reset() = 0;
- static std::vector<SpecificAllocBase *> Instances;
-};
-
-template <class T> struct SpecificAlloc : public SpecificAllocBase {
- void reset() override { Alloc.DestroyAll(); }
- llvm::SpecificBumpPtrAllocator<T> Alloc;
-};
-
-// Use this arena if your object has a destructor.
-// Your destructor will be invoked from freeArena().
-template <typename T, typename... U> T *make(U &&... Args) {
- static SpecificAlloc<T> Alloc;
- return new (Alloc.Alloc.Allocate()) T(std::forward<U>(Args)...);
-}
-
-inline void freeArena() {
- for (SpecificAllocBase *Alloc : SpecificAllocBase::Instances)
- Alloc->reset();
- BAlloc.Reset();
-}
-}
-}
-
-#endif
diff --git a/gnu/llvm/tools/lld/ELF/Threads.h b/gnu/llvm/tools/lld/ELF/Threads.h
deleted file mode 100644
index c03e15253e1..00000000000
--- a/gnu/llvm/tools/lld/ELF/Threads.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//===- Threads.h ------------------------------------------------*- C++ -*-===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// LLD supports threads to distribute workloads to multiple cores. Using
-// multicore is most effective when more than one core are idle. At the
-// last step of a build, it is often the case that a linker is the only
-// active process on a computer. So, we are naturally interested in using
-// threads wisely to reduce latency to deliver results to users.
-//
-// That said, we don't want to do "too clever" things using threads.
-// Complex multi-threaded algorithms are sometimes extremely hard to
-// justify the correctness and can easily mess up the entire design.
-//
-// Fortunately, when a linker links large programs (when the link time is
-// most critical), it spends most of the time to work on massive number of
-// small pieces of data of the same kind, and there are opportunities for
-// large parallelism there. Here are examples:
-//
-// - We have hundreds of thousands of input sections that need to be
-// copied to a result file at the last step of link. Once we fix a file
-// layout, each section can be copied to its destination and its
-// relocations can be applied independently.
-//
-// - We have tens of millions of small strings when constructing a
-// mergeable string section.
-//
-// For the cases such as the former, we can just use parallel_for_each
-// instead of std::for_each (or a plain for loop). Because tasks are
-// completely independent from each other, we can run them in parallel
-// without any coordination between them. That's very easy to understand
-// and justify.
-//
-// For the cases such as the latter, we can use parallel algorithms to
-// deal with massive data. We have to write code for a tailored algorithm
-// for each problem, but the complexity of multi-threading is isolated in
-// a single pass and doesn't affect the linker's overall design.
-//
-// The above approach seems to be working fairly well. As an example, when
-// linking Chromium (output size 1.6 GB), using 4 cores reduces latency to
-// 75% compared to single core (from 12.66 seconds to 9.55 seconds) on my
-// Ivy Bridge Xeon 2.8 GHz machine. Using 40 cores reduces it to 63% (from
-// 12.66 seconds to 7.95 seconds). Because of the Amdahl's law, the
-// speedup is not linear, but as you add more cores, it gets faster.
-//
-// On a final note, if you are trying to optimize, keep the axiom "don't
-// guess, measure!" in mind. Some important passes of the linker are not
-// that slow. For example, resolving all symbols is not a very heavy pass,
-// although it would be very hard to parallelize it. You want to first
-// identify a slow pass and then optimize it.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_ELF_THREADS_H
-#define LLD_ELF_THREADS_H
-
-#include "Config.h"
-
-#include "lld/Core/Parallel.h"
-#include <algorithm>
-#include <functional>
-
-namespace lld {
-namespace elf {
-
-template <class IterTy, class FuncTy>
-void forEach(IterTy Begin, IterTy End, FuncTy Fn) {
- if (Config->Threads)
- parallel_for_each(Begin, End, Fn);
- else
- std::for_each(Begin, End, Fn);
-}
-
-inline void forLoop(size_t Begin, size_t End, std::function<void(size_t)> Fn) {
- if (Config->Threads) {
- parallel_for(Begin, End, Fn);
- } else {
- for (size_t I = Begin; I < End; ++I)
- Fn(I);
- }
-}
-}
-}
-
-#endif
diff --git a/gnu/llvm/tools/lld/include/lld/Config/Version.h b/gnu/llvm/tools/lld/include/lld/Config/Version.h
deleted file mode 100644
index 41433c1175e..00000000000
--- a/gnu/llvm/tools/lld/include/lld/Config/Version.h
+++ /dev/null
@@ -1,51 +0,0 @@
-//===- lld/Config/Version.h - LLD Version Number ----------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// \brief Defines version macros and version-related utility functions
-/// for lld.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_VERSION_H
-#define LLD_VERSION_H
-
-#include "lld/Config/Version.inc"
-#include "llvm/ADT/StringRef.h"
-#include <string>
-
-/// \brief Helper macro for LLD_VERSION_STRING.
-#define LLD_MAKE_VERSION_STRING2(X) #X
-
-/// \brief Helper macro for LLD_VERSION_STRING.
-#define LLD_MAKE_VERSION_STRING(X, Y) LLD_MAKE_VERSION_STRING2(X.Y)
-
-/// \brief A string that describes the lld version number, e.g., "1.0".
-#define LLD_VERSION_STRING \
- LLD_MAKE_VERSION_STRING(LLD_VERSION_MAJOR, LLD_VERSION_MINOR)
-
-namespace lld {
-/// \brief Retrieves the repository path (e.g., Subversion path) that
-/// identifies the particular lld branch, tag, or trunk from which this
-/// lld was built.
-llvm::StringRef getLLDRepositoryPath();
-
-/// \brief Retrieves the repository revision number (or identifer) from which
-/// this lld was built.
-llvm::StringRef getLLDRevision();
-
-/// \brief Retrieves the full repository version that is an amalgamation of
-/// the information in getLLDRepositoryPath() and getLLDRevision().
-std::string getLLDRepositoryVersion();
-
-/// \brief Retrieves a string representing the complete lld version.
-llvm::StringRef getLLDVersion();
-}
-
-#endif // LLD_VERSION_H
diff --git a/gnu/llvm/tools/lld/include/lld/Config/Version.inc.in b/gnu/llvm/tools/lld/include/lld/Config/Version.inc.in
deleted file mode 100644
index c893a56686c..00000000000
--- a/gnu/llvm/tools/lld/include/lld/Config/Version.inc.in
+++ /dev/null
@@ -1,5 +0,0 @@
-#define LLD_VERSION @LLD_VERSION@
-#define LLD_VERSION_MAJOR @LLD_VERSION_MAJOR@
-#define LLD_VERSION_MINOR @LLD_VERSION_MINOR@
-#define LLD_REVISION_STRING "@LLD_REVISION@"
-#define LLD_REPOSITORY_STRING "@LLD_REPOSITORY@"
diff --git a/gnu/llvm/tools/lld/include/lld/Core/LLVM.h b/gnu/llvm/tools/lld/include/lld/Core/LLVM.h
deleted file mode 100644
index ccf08859f4a..00000000000
--- a/gnu/llvm/tools/lld/include/lld/Core/LLVM.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//===--- LLVM.h - Import various common LLVM datatypes ----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file forward declares and imports various common LLVM datatypes that
-// lld wants to use unqualified.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_CORE_LLVM_H
-#define LLD_CORE_LLVM_H
-
-// This should be the only #include, force #includes of all the others on
-// clients.
-#include "llvm/ADT/Hashing.h"
-#include "llvm/Support/Casting.h"
-#include <utility>
-
-namespace llvm {
- // ADT's.
- class Error;
- class StringRef;
- class Twine;
- class MemoryBuffer;
- class MemoryBufferRef;
- template<typename T> class ArrayRef;
- template<unsigned InternalLen> class SmallString;
- template<typename T, unsigned N> class SmallVector;
- template<typename T> class SmallVectorImpl;
-
- template<typename T>
- struct SaveAndRestore;
-
- template<typename T>
- class ErrorOr;
-
- template<typename T>
- class Expected;
-
- class raw_ostream;
- // TODO: DenseMap, ...
-}
-
-namespace lld {
- // Casting operators.
- using llvm::isa;
- using llvm::cast;
- using llvm::dyn_cast;
- using llvm::dyn_cast_or_null;
- using llvm::cast_or_null;
-
- // ADT's.
- using llvm::Error;
- using llvm::StringRef;
- using llvm::Twine;
- using llvm::MemoryBuffer;
- using llvm::MemoryBufferRef;
- using llvm::ArrayRef;
- using llvm::SmallString;
- using llvm::SmallVector;
- using llvm::SmallVectorImpl;
- using llvm::SaveAndRestore;
- using llvm::ErrorOr;
- using llvm::Expected;
-
- using llvm::raw_ostream;
-} // end namespace lld.
-
-namespace std {
-template <> struct hash<llvm::StringRef> {
-public:
- size_t operator()(const llvm::StringRef &s) const {
- return llvm::hash_value(s);
- }
-};
-}
-
-#endif
diff --git a/gnu/llvm/tools/lld/include/lld/Core/Reproduce.h b/gnu/llvm/tools/lld/include/lld/Core/Reproduce.h
deleted file mode 100644
index 6e1d36a5491..00000000000
--- a/gnu/llvm/tools/lld/include/lld/Core/Reproduce.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//===- Reproduce.h - Utilities for creating reproducers ---------*- C++ -*-===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_CORE_REPRODUCE_H
-#define LLD_CORE_REPRODUCE_H
-
-#include "lld/Core/LLVM.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/Error.h"
-
-namespace llvm {
-namespace opt { class Arg; }
-}
-
-namespace lld {
-
-// Makes a given pathname an absolute path first, and then remove
-// beginning /. For example, "../foo.o" is converted to "home/john/foo.o",
-// assuming that the current directory is "/home/john/bar".
-std::string relativeToRoot(StringRef Path);
-
-// Quote a given string if it contains a space character.
-std::string quote(StringRef S);
-
-// Rewrite the given path if a file exists with that pathname, otherwise
-// returns the original path.
-std::string rewritePath(StringRef S);
-
-// Returns the string form of the given argument.
-std::string toString(llvm::opt::Arg *Arg);
-}
-
-#endif
diff --git a/gnu/llvm/tools/lld/include/lld/Core/TargetOptionsCommandFlags.h b/gnu/llvm/tools/lld/include/lld/Core/TargetOptionsCommandFlags.h
deleted file mode 100644
index 9ba99d94b95..00000000000
--- a/gnu/llvm/tools/lld/include/lld/Core/TargetOptionsCommandFlags.h
+++ /dev/null
@@ -1,20 +0,0 @@
-//===-- TargetOptionsCommandFlags.h ----------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Helper to create TargetOptions from command line flags.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/CodeGen.h"
-#include "llvm/Target/TargetOptions.h"
-
-namespace lld {
-llvm::TargetOptions InitTargetOptionsFromCodeGenFlags();
-llvm::CodeModel::Model GetCodeModelFromCMModel();
-}
diff --git a/gnu/llvm/tools/lld/include/lld/Driver/Driver.h b/gnu/llvm/tools/lld/include/lld/Driver/Driver.h
deleted file mode 100644
index 312f4f812b7..00000000000
--- a/gnu/llvm/tools/lld/include/lld/Driver/Driver.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===- lld/Driver/Driver.h - Linker Driver Emulator -----------------------===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_DRIVER_DRIVER_H
-#define LLD_DRIVER_DRIVER_H
-
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/Support/raw_ostream.h"
-
-namespace lld {
-namespace coff {
-bool link(llvm::ArrayRef<const char *> Args);
-}
-
-namespace elf {
-bool link(llvm::ArrayRef<const char *> Args,
- llvm::raw_ostream &Diag = llvm::errs());
-}
-
-namespace mach_o {
-bool link(llvm::ArrayRef<const char *> Args,
- llvm::raw_ostream &Diag = llvm::errs());
-}
-}
-
-#endif
diff --git a/gnu/llvm/tools/lld/lib/Config/CMakeLists.txt b/gnu/llvm/tools/lld/lib/Config/CMakeLists.txt
deleted file mode 100644
index e971b0b7aa6..00000000000
--- a/gnu/llvm/tools/lld/lib/Config/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-add_lld_library(lldConfig
- Version.cpp
-
- ADDITIONAL_HEADER_DIRS
- ${LLD_INCLUDE_DIR}/lld/Config
-
- LINK_LIBS
- LLVMSupport
- )
diff --git a/gnu/llvm/tools/lld/lib/Config/Version.cpp b/gnu/llvm/tools/lld/lib/Config/Version.cpp
deleted file mode 100644
index 60687b9d894..00000000000
--- a/gnu/llvm/tools/lld/lib/Config/Version.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===- lib/Config/Version.cpp - LLD Version Number ---------------*- C++-=====//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines several version-related utility functions for LLD.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lld/Config/Version.h"
-#include "llvm/Support/raw_ostream.h"
-
-using namespace llvm;
-
-namespace lld {
-
-StringRef getLLDRepositoryPath() {
-#ifdef LLD_REPOSITORY_STRING
- return LLD_REPOSITORY_STRING;
-#else
- return "";
-#endif
-}
-
-StringRef getLLDRevision() {
-#ifdef LLD_REVISION_STRING
- return LLD_REVISION_STRING;
-#else
- return "";
-#endif
-}
-
-std::string getLLDRepositoryVersion() {
- std::string S = getLLDRepositoryPath();
- std::string T = getLLDRevision();
- if (S.empty() && T.empty())
- return "";
- if (!S.empty() && !T.empty())
- return "(" + S + " " + T + ")";
- if (!S.empty())
- return "(" + S + ")";
- return "(" + T + ")";
-}
-
-StringRef getLLDVersion() {
-#ifdef LLD_VERSION_STRING
- return LLD_VERSION_STRING;
-#else
- return "";
-#endif
-}
-
-} // end namespace lld
diff --git a/gnu/llvm/tools/lld/lib/Core/Reproduce.cpp b/gnu/llvm/tools/lld/lib/Core/Reproduce.cpp
deleted file mode 100644
index e3629a93cbe..00000000000
--- a/gnu/llvm/tools/lld/lib/Core/Reproduce.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//===- Reproduce.cpp - Utilities for creating reproducers -----------------===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lld/Core/Reproduce.h"
-#include "llvm/Option/Arg.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/Path.h"
-
-using namespace lld;
-using namespace llvm;
-using namespace llvm::sys;
-
-// Makes a given pathname an absolute path first, and then remove
-// beginning /. For example, "../foo.o" is converted to "home/john/foo.o",
-// assuming that the current directory is "/home/john/bar".
-// Returned string is a forward slash separated path even on Windows to avoid
-// a mess with backslash-as-escape and backslash-as-path-separator.
-std::string lld::relativeToRoot(StringRef Path) {
- SmallString<128> Abs = Path;
- if (fs::make_absolute(Abs))
- return Path;
- path::remove_dots(Abs, /*remove_dot_dot=*/true);
-
- // This is Windows specific. root_name() returns a drive letter
- // (e.g. "c:") or a UNC name (//net). We want to keep it as part
- // of the result.
- SmallString<128> Res;
- StringRef Root = path::root_name(Abs);
- if (Root.endswith(":"))
- Res = Root.drop_back();
- else if (Root.startswith("//"))
- Res = Root.substr(2);
-
- path::append(Res, path::relative_path(Abs));
- return path::convert_to_slash(Res);
-}
-
-// Quote a given string if it contains a space character.
-std::string lld::quote(StringRef S) {
- if (S.find(' ') == StringRef::npos)
- return S;
- return ("\"" + S + "\"").str();
-}
-
-std::string lld::rewritePath(StringRef S) {
- if (fs::exists(S))
- return relativeToRoot(S);
- return S;
-}
-
-std::string lld::toString(opt::Arg *Arg) {
- std::string K = Arg->getSpelling();
- if (Arg->getNumValues() == 0)
- return K;
- std::string V = quote(Arg->getValue());
- if (Arg->getOption().getRenderStyle() == opt::Option::RenderJoinedStyle)
- return K + V;
- return K + " " + V;
-}
diff --git a/gnu/llvm/tools/lld/lib/Core/TargetOptionsCommandFlags.cpp b/gnu/llvm/tools/lld/lib/Core/TargetOptionsCommandFlags.cpp
deleted file mode 100644
index e0f26761e70..00000000000
--- a/gnu/llvm/tools/lld/lib/Core/TargetOptionsCommandFlags.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===-- TargetOptionsCommandFlags.cpp ---------------------------*- C++ -*-===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exists as a place for global variables defined in LLVM's
-// CodeGen/CommandFlags.h. By putting the resulting object file in
-// an archive and linking with it, the definitions will automatically be
-// included when needed and skipped when already present.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lld/Core/TargetOptionsCommandFlags.h"
-
-#include "llvm/CodeGen/CommandFlags.h"
-#include "llvm/Target/TargetOptions.h"
-
-// Define an externally visible version of
-// InitTargetOptionsFromCodeGenFlags, so that its functionality can be
-// used without having to include llvm/CodeGen/CommandFlags.h, which
-// would lead to multiple definitions of the command line flags.
-llvm::TargetOptions lld::InitTargetOptionsFromCodeGenFlags() {
- return ::InitTargetOptionsFromCodeGenFlags();
-}
-
-llvm::CodeModel::Model lld::GetCodeModelFromCMModel() {
- return CMModel;
-}