#include "Driver.h"
#include "Config.h"
#include "ICF.h"
#include "InputFiles.h"
#include "LTO.h"
#include "MarkLive.h"
#include "ObjC.h"
#include "OutputSection.h"
#include "OutputSegment.h"
#include "SectionPriorities.h"
#include "SymbolTable.h"
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
#include "UnwindInfoSection.h"
#include "Writer.h"
#include "lld/Common/Args.h"
#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/Driver.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/LLVM.h"
#include "lld/Common/Memory.h"
#include "lld/Common/Reproduce.h"
#include "lld/Common/Version.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/CGData/CodeGenDataWriter.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/LTO/LTO.h"
#include "llvm/Object/Archive.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TarWriter.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TextAPI/Architecture.h"
#include "llvm/TextAPI/PackedVersion.h"
#include <algorithm>
usingnamespacellvm;
usingnamespacellvm::MachO;
usingnamespacellvm::object;
usingnamespacellvm::opt;
usingnamespacellvm::sys;
usingnamespacelld;
usingnamespacelld::macho;
std::unique_ptr<Configuration> macho::config;
std::unique_ptr<DependencyTracker> macho::depTracker;
static HeaderFileType getOutputType(const InputArgList &args) { … }
static DenseMap<CachedHashStringRef, StringRef> resolvedLibraries;
static std::optional<StringRef> findLibrary(StringRef name) { … }
static DenseMap<CachedHashStringRef, StringRef> resolvedFrameworks;
static std::optional<StringRef> findFramework(StringRef name) { … }
static bool warnIfNotDirectory(StringRef option, StringRef path) { … }
static std::vector<StringRef>
getSearchPaths(unsigned optionCode, InputArgList &args,
const std::vector<StringRef> &roots,
const SmallVector<StringRef, 2> &systemPaths) { … }
static std::vector<StringRef> getSystemLibraryRoots(InputArgList &args) { … }
static std::vector<StringRef>
getLibrarySearchPaths(InputArgList &args, const std::vector<StringRef> &roots) { … }
static std::vector<StringRef>
getFrameworkSearchPaths(InputArgList &args,
const std::vector<StringRef> &roots) { … }
static llvm::CachePruningPolicy getLTOCachePolicy(InputArgList &args) { … }
enum class LoadType { … };
struct ArchiveFileInfo { … };
static DenseMap<StringRef, ArchiveFileInfo> loadedArchives;
static void saveThinArchiveToRepro(ArchiveFile const *file) { … }
static InputFile *addFile(StringRef path, LoadType loadType,
bool isLazy = false, bool isExplicit = true,
bool isBundleLoader = false,
bool isForceHidden = false) { … }
static std::vector<StringRef> missingAutolinkWarnings;
static void addLibrary(StringRef name, bool isNeeded, bool isWeak,
bool isReexport, bool isHidden, bool isExplicit,
LoadType loadType) { … }
static DenseSet<StringRef> loadedObjectFrameworks;
static void addFramework(StringRef name, bool isNeeded, bool isWeak,
bool isReexport, bool isExplicit, LoadType loadType) { … }
void macho::parseLCLinkerOption(
llvm::SmallVectorImpl<StringRef> &LCLinkerOptions, InputFile *f,
unsigned argc, StringRef data) { … }
void macho::resolveLCLinkerOptions() { … }
static void addFileList(StringRef path, bool isLazy) { … }
static bool markReexport(StringRef searchName, ArrayRef<StringRef> extensions) { … }
static void initLLVM() { … }
static bool compileBitcodeFiles() { … }
static void replaceCommonSymbols() { … }
static void initializeSectionRenameMap() { … }
static inline char toLowerDash(char x) { … }
static std::string lowerDash(StringRef s) { … }
struct PlatformVersion { … };
static PlatformVersion parsePlatformVersion(const Arg *arg) { … }
static void setPlatformVersions(StringRef archName, const ArgList &args) { … }
static TargetInfo *createTargetInfo(InputArgList &args) { … }
static UndefinedSymbolTreatment
getUndefinedSymbolTreatment(const ArgList &args) { … }
static ICFLevel getICFLevel(const ArgList &args) { … }
static ObjCStubsMode getObjCStubsMode(const ArgList &args) { … }
static void warnIfDeprecatedOption(const Option &opt) { … }
static void warnIfUnimplementedOption(const Option &opt) { … }
static const char *getReproduceOption(InputArgList &args) { … }
static std::pair<StringRef, StringRef> getOldNewOptions(opt::InputArgList &args,
unsigned id) { … }
static std::tuple<StringRef, StringRef, StringRef>
getOldNewOptionsExtra(opt::InputArgList &args, unsigned id) { … }
static void parseClangOption(StringRef opt, const Twine &msg) { … }
static uint32_t parseDylibVersion(const ArgList &args, unsigned id) { … }
static uint32_t parseProtection(StringRef protStr) { … }
static std::vector<SectionAlign> parseSectAlign(const opt::InputArgList &args) { … }
PlatformType macho::removeSimulator(PlatformType platform) { … }
static bool supportsNoPie() { … }
static bool shouldAdhocSignByDefault(Architecture arch, PlatformType platform) { … }
MinVersions;
template <std::size_t N>
static bool greaterEqMinVersion(const MinVersions<N> &minVersions,
bool ignoreSimulator) { … }
static bool dataConstDefault(const InputArgList &args) { … }
static bool shouldEmitChainedFixups(const InputArgList &args) { … }
static bool shouldEmitRelativeMethodLists(const InputArgList &args) { … }
void SymbolPatterns::clear() { … }
void SymbolPatterns::insert(StringRef symbolName) { … }
bool SymbolPatterns::matchLiteral(StringRef symbolName) const { … }
bool SymbolPatterns::matchGlob(StringRef symbolName) const { … }
bool SymbolPatterns::match(StringRef symbolName) const { … }
static void parseSymbolPatternsFile(const Arg *arg,
SymbolPatterns &symbolPatterns) { … }
static void handleSymbolPatterns(InputArgList &args,
SymbolPatterns &symbolPatterns,
unsigned singleOptionCode,
unsigned listFileOptionCode) { … }
static void createFiles(const InputArgList &args) { … }
static void gatherInputSections() { … }
static void codegenDataGenerate() { … }
static void foldIdenticalLiterals() { … }
static void addSynthenticMethnames() { … }
static void referenceStubBinder() { … }
static void createAliases() { … }
static void handleExplicitExports() { … }
static void eraseInitializerSymbols() { … }
static SmallVector<StringRef, 0> getRuntimePaths(opt::InputArgList &args) { … }
namespace lld {
namespace macho {
bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
llvm::raw_ostream &stderrOS, bool exitEarly, bool disableOutput) { … }
}
}