aboutsummaryrefslogtreecommitdiffstats
path: root/COFF
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:49 +0000
commit2079716dfb3fb7e4e24b8b2e85eb6780b981a0af (patch)
tree3b0c58e50948b450b50b20ae5a38c005128edfb5 /COFF
parentb9a1baec33e911ca24f51abf882d454e62047ea6 (diff)
downloadsrc-2079716dfb3fb7e4e24b8b2e85eb6780b981a0af.tar.gz
src-2079716dfb3fb7e4e24b8b2e85eb6780b981a0af.zip
Vendor import of lld trunk r305145:vendor/lld/lld-trunk-r305145
Notes
Notes: svn path=/vendor/lld/dist/; revision=319788 svn path=/vendor/lld/lld-trunk-r305145/; revision=319789; tag=vendor/lld/lld-trunk-r305145
Diffstat (limited to 'COFF')
-rw-r--r--COFF/CMakeLists.txt1
-rw-r--r--COFF/Chunks.cpp2
-rw-r--r--COFF/Driver.cpp13
-rw-r--r--COFF/InputFiles.cpp2
4 files changed, 6 insertions, 12 deletions
diff --git a/COFF/CMakeLists.txt b/COFF/CMakeLists.txt
index 14f553e540d9..e56593497000 100644
--- a/COFF/CMakeLists.txt
+++ b/COFF/CMakeLists.txt
@@ -25,6 +25,7 @@ add_lld_library(lldCOFF
LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
+ BinaryFormat
BitReader
Core
DebugInfoCodeView
diff --git a/COFF/Chunks.cpp b/COFF/Chunks.cpp
index 791d96ee92a5..359dbe69559f 100644
--- a/COFF/Chunks.cpp
+++ b/COFF/Chunks.cpp
@@ -12,8 +12,8 @@
#include "InputFiles.h"
#include "Symbols.h"
#include "llvm/ADT/Twine.h"
+#include "llvm/BinaryFormat/COFF.h"
#include "llvm/Object/COFF.h"
-#include "llvm/Support/COFF.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/raw_ostream.h"
diff --git a/COFF/Driver.cpp b/COFF/Driver.cpp
index 96c328b30518..27b1c48ce3e5 100644
--- a/COFF/Driver.cpp
+++ b/COFF/Driver.cpp
@@ -18,6 +18,7 @@
#include "lld/Driver/Driver.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/BinaryFormat/Magic.h"
#include "llvm/Object/ArchiveWriter.h"
#include "llvm/Object/COFFImportFile.h"
#include "llvm/Object/COFFModuleDefinition.h"
@@ -40,8 +41,6 @@ using namespace llvm;
using namespace llvm::object;
using namespace llvm::COFF;
using llvm::sys::Process;
-using llvm::sys::fs::file_magic;
-using llvm::sys::fs::identify_magic;
namespace lld {
namespace coff {
@@ -457,17 +456,11 @@ static void createImportLibrary() {
static void parseModuleDefs(StringRef Path) {
std::unique_ptr<MemoryBuffer> MB = check(
MemoryBuffer::getFile(Path, -1, false, true), "could not open " + Path);
- MemoryBufferRef MBRef = MB->getMemBufferRef();
-
- Expected<COFFModuleDefinition> Def =
- parseCOFFModuleDefinition(MBRef, Config->Machine);
- if (!Def)
- fatal(errorToErrorCode(Def.takeError()).message());
+ COFFModuleDefinition M =
+ check(parseCOFFModuleDefinition(MB->getMemBufferRef(), Config->Machine));
- COFFModuleDefinition &M = *Def;
if (Config->OutputFile.empty())
Config->OutputFile = Saver.save(M.OutputFile);
-
if (M.ImageBase)
Config->ImageBase = M.ImageBase;
if (M.StackReserve)
diff --git a/COFF/InputFiles.cpp b/COFF/InputFiles.cpp
index 258d9fd74b4d..58e8dd329f1f 100644
--- a/COFF/InputFiles.cpp
+++ b/COFF/InputFiles.cpp
@@ -19,9 +19,9 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
+#include "llvm/BinaryFormat/COFF.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/COFF.h"
-#include "llvm/Support/COFF.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"