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 | OPTTABLE_STR_TABLE_CODE |
#define | OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__), |
#define | OPTTABLE_PREFIXES_TABLE_CODE |
#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 46 of file LibDriver.cpp.
#define OPTION | ( | ... | ) | LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), |
Definition at line 46 of file LibDriver.cpp.
#define OPTTABLE_PREFIXES_TABLE_CODE |
Definition at line 51 of file LibDriver.cpp.
#define OPTTABLE_STR_TABLE_CODE |
Definition at line 40 of file LibDriver.cpp.
|
static |
Definition at line 222 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 131 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 122 of file LibDriver.cpp.
References llvm::errs(), llvm::handleAllErrors(), and llvm::ErrorInfoBase::message().
Referenced by appendFile(), doList(), and llvm::libDriverMain().
Definition at line 112 of file LibDriver.cpp.
References llvm::sys::path::append(), and llvm::sys::fs::exists().
Referenced by llvm::libDriverMain().
|
static |
Definition at line 182 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 165 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 70 of file LibDriver.cpp.
References llvm::NewArchiveMember::Buf, and llvm::sys::path::replace_extension().
Referenced by llvm::libDriverMain().
|
static |
Definition at line 76 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 204 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 100 of file LibDriver.cpp.
References llvm::errs(), llvm::ErrorOr< T >::getError(), and llvm::MemoryBuffer::getFile().
Referenced by llvm::libDriverMain().