LLVM 17.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/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(_1, _2, ID, _4, _5, _6, _7, _8, _9, _10, _11, _12)   OPT_##ID,
 
#define PREFIX(NAME, VALUE)
 
#define OPTION(X1, X2, ID, KIND, GROUP, ALIAS, X7, X8, X9, X10, X11, X12)
 

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 (   _1,
  _2,
  ID,
  _4,
  _5,
  _6,
  _7,
  _8,
  _9,
  _10,
  _11,
  _12 
)    OPT_##ID,

Definition at line 41 of file LibDriver.cpp.

◆ OPTION [2/2]

#define OPTION (   X1,
  X2,
  ID,
  KIND,
  GROUP,
  ALIAS,
  X7,
  X8,
  X9,
  X10,
  X11,
  X12 
)
Value:
{X1, X2, X10, X11, OPT_##ID, opt::Option::KIND##Class, \
X9, X8, OPT_##GROUP, OPT_##ALIAS, X7, X12},
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24

Definition at line 41 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:851

Definition at line 46 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(), llvm::sys::fs::exists(), and Paths.

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

◆ 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)