file_magic went into its own header file.

This commit is contained in:
Vassil Vassilev 2017-10-06 09:40:00 +02:00 committed by sftnight
parent 628c1fbc86
commit 1a35776759
2 changed files with 6 additions and 5 deletions

View File

@ -14,8 +14,8 @@
#include "cling/Utils/Platform.h"
#include "cling/Utils/Output.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include <system_error>
@ -64,7 +64,7 @@ namespace cling {
DynamicLibraryManager::~DynamicLibraryManager() {}
static bool isSharedLib(llvm::StringRef LibName, bool* exists = 0) {
using namespace llvm::sys::fs;
using namespace llvm;
file_magic Magic;
const std::error_code Error = identify_magic(LibName, Magic);
if (exists)

View File

@ -22,6 +22,7 @@
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/Support/Path.h"
#include <fcntl.h>
@ -378,9 +379,9 @@ namespace cling {
// heuristic unreliable.
if (!in.fail() && readMagic >= 300) {
llvm::StringRef magicStr(magic,in.gcount());
llvm::sys::fs::file_magic fileType
= llvm::sys::fs::identify_magic(magicStr);
if (fileType != llvm::sys::fs::file_magic::unknown)
llvm::file_magic fileType
= llvm::identify_magic(magicStr);
if (fileType != llvm::file_magic::unknown)
return reportIOErr(filename, "read from binary");
unsigned printable = 0;