#include "COFFLinkerContext.h"
#include "Driver.h"
#include "Symbols.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/IR/Mangler.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/WindowsResource.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/WindowsManifest/WindowsManifestMerger.h"
#include <limits>
#include <memory>
#include <optional>
usingnamespacellvm::COFF;
usingnamespacellvm::object;
usingnamespacellvm::opt;
usingnamespacellvm;
Process;
namespace lld {
namespace coff {
namespace {
const uint16_t SUBLANG_ENGLISH_US = …;
const uint16_t RT_MANIFEST = …;
class Executor { … };
}
void LinkerDriver::parseNumbers(StringRef arg, uint64_t *addr, uint64_t *size) { … }
void LinkerDriver::parseVersion(StringRef arg, uint32_t *major,
uint32_t *minor) { … }
void LinkerDriver::parseGuard(StringRef fullArg) { … }
void LinkerDriver::parseSubsystem(StringRef arg, WindowsSubsystem *sys,
uint32_t *major, uint32_t *minor,
bool *gotVersion) { … }
void LinkerDriver::parseAlternateName(StringRef s) { … }
void LinkerDriver::parseMerge(StringRef s) { … }
void LinkerDriver::parsePDBPageSize(StringRef s) { … }
static uint32_t parseSectionAttributes(StringRef s) { … }
void LinkerDriver::parseSection(StringRef s) { … }
void LinkerDriver::parseAligncomm(StringRef s) { … }
void LinkerDriver::parseFunctionPadMin(llvm::opt::Arg *a) { … }
void LinkerDriver::parseDependentLoadFlags(llvm::opt::Arg *a) { … }
void LinkerDriver::parseManifest(StringRef arg) { … }
void LinkerDriver::parseManifestUAC(StringRef arg) { … }
void LinkerDriver::parseSwaprun(StringRef arg) { … }
namespace {
class TemporaryFile { … };
}
std::string LinkerDriver::createDefaultXml() { … }
std::string
LinkerDriver::createManifestXmlWithInternalMt(StringRef defaultXml) { … }
std::string
LinkerDriver::createManifestXmlWithExternalMt(StringRef defaultXml) { … }
std::string LinkerDriver::createManifestXml() { … }
std::unique_ptr<WritableMemoryBuffer>
LinkerDriver::createMemoryBufferForManifestRes(size_t manifestSize) { … }
static void writeResFileHeader(char *&buf) { … }
static void writeResEntryHeader(char *&buf, size_t manifestSize,
int manifestID) { … }
std::unique_ptr<MemoryBuffer> LinkerDriver::createManifestRes() { … }
void LinkerDriver::createSideBySideManifest() { … }
Export LinkerDriver::parseExport(StringRef arg) { … }
static StringRef killAt(StringRef sym, bool prefix) { … }
static StringRef exportSourceName(ExportSource s) { … }
void LinkerDriver::fixupExports() { … }
void LinkerDriver::assignExportOrdinals() { … }
void LinkerDriver::checkFailIfMismatch(StringRef arg, InputFile *source) { … }
MemoryBufferRef LinkerDriver::convertResToCOFF(ArrayRef<MemoryBufferRef> mbs,
ArrayRef<ObjFile *> objs) { … }
#define PREFIX …
#include "Options.inc"
#undef PREFIX
static constexpr llvm::opt::OptTable::Info infoTable[] = …;
COFFOptTable::COFFOptTable() : … { … }
static void handleColorDiagnostics(opt::InputArgList &args) { … }
static cl::TokenizerCallback getQuotingStyle(opt::InputArgList &args) { … }
ArgParser::ArgParser(COFFLinkerContext &c) : … { … }
opt::InputArgList ArgParser::parse(ArrayRef<const char *> argv) { … }
ParsedDirectives ArgParser::parseDirectives(StringRef s) { … }
void ArgParser::addLINK(SmallVector<const char *, 256> &argv) { … }
std::vector<const char *> ArgParser::tokenize(StringRef s) { … }
void LinkerDriver::printHelp(const char *argv0) { … }
}
}