diff options
Diffstat (limited to 'deps/lld/lib/Core')
| -rw-r--r-- | deps/lld/lib/Core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | deps/lld/lib/Core/Reproduce.cpp | 66 | ||||
| -rw-r--r-- | deps/lld/lib/Core/Resolver.cpp | 6 | ||||
| -rw-r--r-- | deps/lld/lib/Core/SymbolTable.cpp | 2 | ||||
| -rw-r--r-- | deps/lld/lib/Core/TargetOptionsCommandFlags.cpp | 32 |
5 files changed, 4 insertions, 104 deletions
diff --git a/deps/lld/lib/Core/CMakeLists.txt b/deps/lld/lib/Core/CMakeLists.txt index 85046b93f3..2d4d9ded08 100644 --- a/deps/lld/lib/Core/CMakeLists.txt +++ b/deps/lld/lib/Core/CMakeLists.txt @@ -8,10 +8,8 @@ add_lld_library(lldCore File.cpp LinkingContext.cpp Reader.cpp - Reproduce.cpp Resolver.cpp SymbolTable.cpp - TargetOptionsCommandFlags.cpp Writer.cpp ADDITIONAL_HEADER_DIRS diff --git a/deps/lld/lib/Core/Reproduce.cpp b/deps/lld/lib/Core/Reproduce.cpp deleted file mode 100644 index e3629a93cb..0000000000 --- a/deps/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/deps/lld/lib/Core/Resolver.cpp b/deps/lld/lib/Core/Resolver.cpp index e7cfaaac78..9c51c6cdb1 100644 --- a/deps/lld/lib/Core/Resolver.cpp +++ b/deps/lld/lib/Core/Resolver.cpp @@ -7,13 +7,13 @@ // //===----------------------------------------------------------------------===// -#include "lld/Core/Atom.h" +#include "lld/Core/Resolver.h" +#include "lld/Common/LLVM.h" #include "lld/Core/ArchiveLibraryFile.h" +#include "lld/Core/Atom.h" #include "lld/Core/File.h" #include "lld/Core/Instrumentation.h" -#include "lld/Core/LLVM.h" #include "lld/Core/LinkingContext.h" -#include "lld/Core/Resolver.h" #include "lld/Core/SharedLibraryFile.h" #include "lld/Core/SymbolTable.h" #include "lld/Core/UndefinedAtom.h" diff --git a/deps/lld/lib/Core/SymbolTable.cpp b/deps/lld/lib/Core/SymbolTable.cpp index 583c65acb5..51ae8d1718 100644 --- a/deps/lld/lib/Core/SymbolTable.cpp +++ b/deps/lld/lib/Core/SymbolTable.cpp @@ -8,11 +8,11 @@ //===----------------------------------------------------------------------===// #include "lld/Core/SymbolTable.h" +#include "lld/Common/LLVM.h" #include "lld/Core/AbsoluteAtom.h" #include "lld/Core/Atom.h" #include "lld/Core/DefinedAtom.h" #include "lld/Core/File.h" -#include "lld/Core/LLVM.h" #include "lld/Core/LinkingContext.h" #include "lld/Core/Resolver.h" #include "lld/Core/SharedLibraryAtom.h" diff --git a/deps/lld/lib/Core/TargetOptionsCommandFlags.cpp b/deps/lld/lib/Core/TargetOptionsCommandFlags.cpp deleted file mode 100644 index e0f26761e7..0000000000 --- a/deps/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; -} |
