#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/Driver.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TargetParser/Triple.h"
#include <cstdlib>
usingnamespacelld;
usingnamespacellvm;
usingnamespacellvm::sys;
static void err(const Twine &s) { … }
static Flavor getFlavor(StringRef s) { … }
static cl::TokenizerCallback getDefaultQuotingStyle() { … }
static bool isPETargetName(StringRef s) { … }
static std::optional<bool> isPETarget(llvm::ArrayRef<const char *> args) { … }
static Flavor parseProgname(StringRef progname) { … }
static Flavor
parseFlavorWithoutMinGW(llvm::SmallVectorImpl<const char *> &argsV) { … }
static Flavor parseFlavor(llvm::SmallVectorImpl<const char *> &argsV) { … }
static Driver whichDriver(llvm::SmallVectorImpl<const char *> &argsV,
llvm::ArrayRef<DriverDef> drivers) { … }
namespace lld {
bool inTestOutputDisabled = …;
int unsafeLldMain(llvm::ArrayRef<const char *> args,
llvm::raw_ostream &stdoutOS, llvm::raw_ostream &stderrOS,
llvm::ArrayRef<DriverDef> drivers, bool exitEarly) { … }
}
Result lld::lldMain(llvm::ArrayRef<const char *> args,
llvm::raw_ostream &stdoutOS, llvm::raw_ostream &stderrOS,
llvm::ArrayRef<DriverDef> drivers) { … }