file_magic went into its own header file.
This commit is contained in:
parent
628c1fbc86
commit
1a35776759
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user