LLVM
22.0.0git
lib
ExecutionEngine
Orc
COFF.cpp
Go to the documentation of this file.
1
//===------------------ COFF.cpp - COFF format utilities ------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "
llvm/ExecutionEngine/Orc/COFF.h
"
10
#include "
llvm/Object/Binary.h
"
11
12
#define DEBUG_TYPE "orc"
13
14
namespace
llvm::orc
{
15
16
Expected<bool>
COFFImportFileScanner::operator()
(
object::Archive
&
A
,
17
MemoryBufferRef
MemberBuf,
18
size_t
Index)
const
{
19
// Try to build a binary for the member.
20
auto
Bin
=
object::createBinary
(MemberBuf);
21
if
(!
Bin
) {
22
// If we can't then consume the error and return false (i.e. not loadable).
23
consumeError
(
Bin
.takeError());
24
return
false
;
25
}
26
27
// If this is a COFF import file then handle it and return false (not
28
// loadable).
29
if
((*Bin)->isCOFFImportFile()) {
30
ImportedDynamicLibraries.insert((*Bin)->getFileName().str());
31
return
false
;
32
}
33
34
// Otherwise the member is loadable (at least as far as COFFImportFileScanner
35
// is concerned), so return true;
36
return
true
;
37
}
38
39
}
// namespace llvm::orc
Binary.h
A
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
COFF.h
llvm::Expected
Tagged union holding either a T or a Error.
Definition
Error.h:485
llvm::MemoryBufferRef
Definition
MemoryBufferRef.h:23
llvm::object::Archive
Definition
Archive.h:159
llvm::orc::COFFImportFileScanner::operator()
LLVM_ABI Expected< bool > operator()(object::Archive &A, MemoryBufferRef MemberBuf, size_t Index) const
Definition
COFF.cpp:16
llvm::object::createBinary
LLVM_ABI Expected< std::unique_ptr< Binary > > createBinary(MemoryBufferRef Source, LLVMContext *Context=nullptr, bool InitContent=true)
Create a Binary from Source, autodetecting the file type.
Definition
Binary.cpp:45
llvm::orc
Definition
AbsoluteSymbols.h:19
llvm::SubDirectoryType::Bin
@ Bin
Definition
MSVCPaths.h:26
llvm::consumeError
void consumeError(Error Err)
Consume a Error without doing anything.
Definition
Error.h:1083
Generated on
for LLVM by
1.14.0