Path: blob/main/contrib/llvm-project/llvm/lib/ExecutionEngine/Orc/COFF.cpp
213799 views
//===------------------ COFF.cpp - COFF format utilities ------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "llvm/ExecutionEngine/Orc/COFF.h"9#include "llvm/Object/Binary.h"1011#define DEBUG_TYPE "orc"1213namespace llvm::orc {1415Expected<bool> COFFImportFileScanner::operator()(object::Archive &A,16MemoryBufferRef MemberBuf,17size_t Index) const {18// Try to build a binary for the member.19auto Bin = object::createBinary(MemberBuf);20if (!Bin) {21// If we can't then consume the error and return false (i.e. not loadable).22consumeError(Bin.takeError());23return false;24}2526// If this is a COFF import file then handle it and return false (not27// loadable).28if ((*Bin)->isCOFFImportFile()) {29ImportedDynamicLibraries.insert((*Bin)->getFileName().str());30return false;31}3233// Otherwise the member is loadable (at least as far as COFFImportFileScanner34// is concerned), so return true;35return true;36}3738} // namespace llvm::orc394041