LLVM 19.0.0git
Macros | Functions
LibDriver.cpp File Reference
#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< StringRefgetSearchPaths (opt::InputArgList *Args, StringSaver &Saver)
 
std::unique_ptr< MemoryBufferopenFile (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::MachineTypesgetCOFFFileMachine (MemoryBufferRef MB)
 
static Expected< COFF::MachineTypesgetBitcodeFileMachine (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)
 

Macro Definition Documentation

◆ OPTION [1/2]

#define OPTION (   ...)    LLVM_MAKE_OPT_ID(__VA_ARGS__),

Definition at line 42 of file LibDriver.cpp.

◆ OPTION [2/2]

#define OPTION (   ...)    LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__),

Definition at line 42 of file LibDriver.cpp.

◆ PREFIX

#define PREFIX (   NAME,
  VALUE 
)
Value:
static constexpr StringLiteral NAME##_init[] = VALUE; \
static constexpr ArrayRef<StringLiteral> NAME(NAME##_init, \
std::size(NAME##_init) - 1);
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition: StringRef.h:849

Definition at line 47 of file LibDriver.cpp.

Function Documentation

◆ appendFile()

static void appendFile ( std::vector< NewArchiveMember > &  Members,
COFF::MachineTypes LibMachine,
std::string &  LibMachineSource,
MemoryBufferRef  MB 
)
static

◆ doList()

static void doList ( opt::InputArgList Args)
static

◆ fatalOpenError()

static void fatalOpenError ( llvm::Error  E,
Twine  File 
)
static

◆ findInputFile()

static std::string findInputFile ( StringRef  File,
ArrayRef< StringRef Paths 
)
static

Definition at line 108 of file LibDriver.cpp.

References llvm::sys::path::append(), and llvm::sys::fs::exists().

Referenced by llvm::libDriverMain().

◆ getBitcodeFileMachine()

static Expected< COFF::MachineTypes > getBitcodeFileMachine ( MemoryBufferRef  MB)
static

◆ getCOFFFileMachine()

static Expected< COFF::MachineTypes > getCOFFFileMachine ( MemoryBufferRef  MB)
static

◆ getDefaultOutputPath()

static std::string getDefaultOutputPath ( const NewArchiveMember FirstMember)
static

Definition at line 67 of file LibDriver.cpp.

References llvm::NewArchiveMember::Buf, and llvm::sys::path::replace_extension().

Referenced by llvm::libDriverMain().

◆ getSearchPaths()

static std::vector< StringRef > getSearchPaths ( opt::InputArgList Args,
StringSaver Saver 
)
static

◆ machineMatches()

static bool machineMatches ( COFF::MachineTypes  LibMachine,
COFF::MachineTypes  FileMachine 
)
static

◆ openFile()

std::unique_ptr< MemoryBuffer > openFile ( const Twine Path)