#include "dsymutil.h"
#include "BinaryHolder.h"
#include "CFBundle.h"
#include "DebugMap.h"
#include "DwarfLinkerForBinary.h"
#include "LinkUtils.h"
#include "MachOUtils.h"
#include "Reproducer.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/DIContext.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/DWARF/DWARFVerifier.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/MachO.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Support/FileCollector.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/LLVMDriver.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/ThreadPool.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/thread.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <cstdint>
#include <cstdlib>
#include <string>
#include <system_error>
usingnamespacellvm;
usingnamespacellvm::dsymutil;
usingnamespaceobject;
usingnamespacellvm::dwarf_linker;
namespace {
enum ID { … };
#define PREFIX …
#include "Options.inc"
#undef PREFIX
usingnamespacellvm::opt;
static constexpr opt::OptTable::Info InfoTable[] = …;
class DsymutilOptTable : public opt::GenericOptTable { … };
}
enum class DWARFVerify : uint8_t { … };
inline bool flagIsSet(DWARFVerify Flags, DWARFVerify SingleFlag) { … }
struct DsymutilOptions { … };
static Expected<std::vector<std::string>> getInputs(opt::InputArgList &Args,
bool DsymAsInput) { … }
static Error verifyOptions(const DsymutilOptions &Options) { … }
static Expected<DsymutilAccelTableKind>
getAccelTableKind(opt::InputArgList &Args) { … }
static Expected<DsymutilDWARFLinkerType>
getDWARFLinkerType(opt::InputArgList &Args) { … }
static Expected<ReproducerMode> getReproducerMode(opt::InputArgList &Args) { … }
static Expected<DWARFVerify> getVerifyKind(opt::InputArgList &Args) { … }
static Expected<DsymutilOptions> getOptions(opt::InputArgList &Args) { … }
static Error createPlistFile(StringRef Bin, StringRef BundleRoot,
StringRef Toolchain) { … }
static Error createBundleDir(StringRef BundleBase) { … }
static bool verifyOutput(StringRef OutputFile, StringRef Arch,
DsymutilOptions Options, std::mutex &Mutex) { … }
namespace {
struct OutputLocation { … };
}
static Expected<OutputLocation>
getOutputFileName(StringRef InputFile, const DsymutilOptions &Options) { … }
int dsymutil_main(int argc, char **argv, const llvm::ToolContext &) { … }