LLVM 20.0.0git
|
#include "llvm/ToolDrivers/llvm-lib/LibDriver.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/Object/ArchiveWriter.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/COFFModuleDefinition.h"
#include "llvm/Object/WindowsMachineFlag.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptTable.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/StringSaver.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include "Options.inc"
Go to the source code of this file.
Macros | |
#define | OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__), |
#define | PREFIX(NAME, VALUE) |
#define | OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), |
Functions | |
static std::string | getDefaultOutputPath (const NewArchiveMember &FirstMember) |
static std::vector< StringRef > | getSearchPaths (opt::InputArgList *Args, StringSaver &Saver) |
std::unique_ptr< MemoryBuffer > | openFile (const Twine &Path) |
static std::string | findInputFile (StringRef File, ArrayRef< StringRef > Paths) |
static void | fatalOpenError (llvm::Error E, Twine File) |
static void | doList (opt::InputArgList &Args) |
static Expected< COFF::MachineTypes > | getCOFFFileMachine (MemoryBufferRef MB) |
static Expected< COFF::MachineTypes > | getBitcodeFileMachine (MemoryBufferRef MB) |
static bool | machineMatches (COFF::MachineTypes LibMachine, COFF::MachineTypes FileMachine) |
static void | appendFile (std::vector< NewArchiveMember > &Members, COFF::MachineTypes &LibMachine, std::string &LibMachineSource, MemoryBufferRef MB) |
#define OPTION | ( | ... | ) | LLVM_MAKE_OPT_ID(__VA_ARGS__), |
Definition at line 42 of file LibDriver.cpp.
#define OPTION | ( | ... | ) | LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), |
Definition at line 42 of file LibDriver.cpp.
#define PREFIX | ( | NAME, | |
VALUE | |||
) |
Definition at line 47 of file LibDriver.cpp.
|
static |
Definition at line 219 of file LibDriver.cpp.
References appendFile(), llvm::file_magic::archive, llvm::file_magic::bitcode, llvm::CallingConv::C, llvm::object::Archive::children(), llvm::file_magic::coff_import_library, llvm::file_magic::coff_object, llvm::errs(), fatalOpenError(), getBitcodeFileMachine(), llvm::MemoryBufferRef::getBuffer(), llvm::MemoryBufferRef::getBufferIdentifier(), getCOFFFileMachine(), llvm::handleAllErrors(), llvm::identify_magic(), llvm::COFF::IMAGE_FILE_MACHINE_ARM64EC, llvm::COFF::IMAGE_FILE_MACHINE_UNKNOWN, machineMatches(), llvm::machineToStr(), llvm::Error::success(), llvm::Expected< T >::takeError(), and llvm::file_magic::windows_resource.
Referenced by appendFile(), and llvm::libDriverMain().
|
static |
Definition at line 128 of file LibDriver.cpp.
References llvm::file_magic::archive, B, llvm::CallingConv::C, llvm::object::Archive::children(), llvm::errorCodeToError(), fatalOpenError(), llvm::Expected< T >::get(), llvm::ErrorOr< T >::get(), llvm::ErrorOr< T >::getError(), llvm::MemoryBuffer::getFile(), llvm::opt::Arg::getValue(), llvm::identify_magic(), Name, llvm::outs(), llvm::reverse(), llvm::Error::success(), and llvm::Expected< T >::takeError().
Referenced by llvm::libDriverMain().
|
static |
Definition at line 119 of file LibDriver.cpp.
References llvm::errs(), llvm::handleAllErrors(), and llvm::ErrorInfoBase::message().
Referenced by appendFile(), doList(), and llvm::libDriverMain().
Definition at line 109 of file LibDriver.cpp.
References llvm::sys::path::append(), and llvm::sys::fs::exists().
Referenced by llvm::libDriverMain().
|
static |
Definition at line 179 of file LibDriver.cpp.
References llvm::Triple::aarch64, llvm::Triple::arm, llvm::createStringError(), llvm::getBitcodeTargetTriple(), llvm::COFF::IMAGE_FILE_MACHINE_AMD64, llvm::COFF::IMAGE_FILE_MACHINE_ARM64, llvm::COFF::IMAGE_FILE_MACHINE_ARM64EC, llvm::COFF::IMAGE_FILE_MACHINE_ARMNT, llvm::COFF::IMAGE_FILE_MACHINE_I386, llvm::inconvertibleErrorCode(), llvm::Expected< T >::takeError(), llvm::Triple::x86, and llvm::Triple::x86_64.
Referenced by appendFile().
|
static |
Definition at line 162 of file LibDriver.cpp.
References llvm::object::COFFObjectFile::create(), llvm::createStringError(), llvm::COFF::IMAGE_FILE_MACHINE_AMD64, llvm::COFF::IMAGE_FILE_MACHINE_ARMNT, llvm::COFF::IMAGE_FILE_MACHINE_I386, llvm::inconvertibleErrorCode(), llvm::COFF::isAnyArm64(), and Machine.
Referenced by appendFile().
|
static |
Definition at line 67 of file LibDriver.cpp.
References llvm::NewArchiveMember::Buf, and llvm::sys::path::replace_extension().
Referenced by llvm::libDriverMain().
|
static |
Definition at line 73 of file LibDriver.cpp.
References llvm::StringRef::empty(), llvm::sys::Process::GetEnv(), llvm::opt::Arg::getValue(), llvm::StringSaver::save(), and llvm::StringRef::split().
Referenced by llvm::libDriverMain().
|
static |
Definition at line 201 of file LibDriver.cpp.
References llvm::COFF::IMAGE_FILE_MACHINE_AMD64, llvm::COFF::IMAGE_FILE_MACHINE_ARM64, llvm::COFF::IMAGE_FILE_MACHINE_ARM64EC, llvm::COFF::IMAGE_FILE_MACHINE_ARM64X, and llvm::COFF::isAnyArm64().
Referenced by appendFile().
std::unique_ptr< MemoryBuffer > openFile | ( | const Twine & | Path | ) |
Definition at line 97 of file LibDriver.cpp.
References llvm::errs(), llvm::ErrorOr< T >::getError(), and llvm::MemoryBuffer::getFile().
Referenced by llvm::libDriverMain().