summaryrefslogtreecommitdiff
path: root/lib/Core
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Core')
-rw-r--r--lib/Core/CMakeLists.txt3
-rw-r--r--lib/Core/Reader.cpp6
-rw-r--r--lib/Core/SymbolTable.cpp2
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/Core/CMakeLists.txt b/lib/Core/CMakeLists.txt
index f2bf90509295..85046b93f34f 100644
--- a/lib/Core/CMakeLists.txt
+++ b/lib/Core/CMakeLists.txt
@@ -18,9 +18,10 @@ add_lld_library(lldCore
${LLD_INCLUDE_DIR}/lld/Core
LINK_COMPONENTS
+ BinaryFormat
MC
Support
-
+
LINK_LIBS
${LLVM_PTHREAD_LIB}
diff --git a/lib/Core/Reader.cpp b/lib/Core/Reader.cpp
index 24652abec688..5d8bbbbfe4d7 100644
--- a/lib/Core/Reader.cpp
+++ b/lib/Core/Reader.cpp
@@ -11,12 +11,16 @@
#include "lld/Core/File.h"
#include "lld/Core/Reference.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/BinaryFormat/Magic.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include <algorithm>
#include <memory>
+using llvm::file_magic;
+using llvm::identify_magic;
+
namespace lld {
YamlIOTaggedDocumentHandler::~YamlIOTaggedDocumentHandler() = default;
@@ -33,7 +37,7 @@ ErrorOr<std::unique_ptr<File>>
Registry::loadFile(std::unique_ptr<MemoryBuffer> mb) const {
// Get file magic.
StringRef content(mb->getBufferStart(), mb->getBufferSize());
- llvm::sys::fs::file_magic fileType = llvm::sys::fs::identify_magic(content);
+ file_magic fileType = identify_magic(content);
// Ask each registered reader if it can handle this file type or extension.
for (const std::unique_ptr<Reader> &reader : _readers) {
diff --git a/lib/Core/SymbolTable.cpp b/lib/Core/SymbolTable.cpp
index cacea5f30847..583c65acb5d3 100644
--- a/lib/Core/SymbolTable.cpp
+++ b/lib/Core/SymbolTable.cpp
@@ -161,7 +161,7 @@ bool SymbolTable::addByName(const Atom &newAtom) {
llvm::errs() << "Size mismatch: "
<< existing->name() << " (" << existingSize << ") "
<< newAtom.name() << " (" << newSize << ")\n";
- // fallthrough
+ LLVM_FALLTHROUGH;
}
case MCR_Error:
llvm::errs() << "Duplicate symbols: "