#include "DebugInfoLinker.h"
#include "Error.h"
#include "Options.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/DWARF/DWARFVerifier.h"
#include "llvm/MC/MCTargetOptionsCommandFlags.h"
#include "llvm/ObjCopy/CommonConfig.h"
#include "llvm/ObjCopy/ConfigManager.h"
#include "llvm/ObjCopy/ObjCopy.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CRC.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/TargetSelect.h"
usingnamespacellvm;
usingnamespaceobject;
namespace {
enum ID { … };
#define PREFIX …
#include "Options.inc"
#undef PREFIX
usingnamespacellvm::opt;
static constexpr opt::OptTable::Info InfoTable[] = …;
class DwarfutilOptTable : public opt::GenericOptTable { … };
}
namespace llvm {
namespace dwarfutil {
std::string ToolName;
static mc::RegisterMCTargetOptionsFlags MOF;
static Error validateAndSetOptions(opt::InputArgList &Args, Options &Options) { … }
static Error setConfigToAddNewDebugSections(objcopy::ConfigManager &Config,
ObjectFile &ObjFile) { … }
static Error verifyOutput(const Options &Opts) { … }
class raw_crc_ostream : public raw_ostream { … };
static Expected<uint32_t> saveSeparateDebugInfo(const Options &Opts,
ObjectFile &InputFile) { … }
static Error saveNonDebugInfo(const Options &Opts, ObjectFile &InputFile,
uint32_t GnuDebugLinkCRC32) { … }
static Error splitDebugIntoSeparateFile(const Options &Opts,
ObjectFile &InputFile) { … }
DebugInfoBits;
static Error addSectionsFromLinkedData(objcopy::ConfigManager &Config,
ObjectFile &InputFile,
DebugInfoBits &LinkedDebugInfoBits) { … }
static Expected<uint32_t>
saveSeparateLinkedDebugInfo(const Options &Opts, ObjectFile &InputFile,
DebugInfoBits LinkedDebugInfoBits) { … }
static Error saveSingleLinkedDebugInfo(const Options &Opts,
ObjectFile &InputFile,
DebugInfoBits LinkedDebugInfoBits) { … }
static Error saveLinkedDebugInfo(const Options &Opts, ObjectFile &InputFile,
DebugInfoBits LinkedDebugInfoBits) { … }
static Error saveCopyOfFile(const Options &Opts, ObjectFile &InputFile) { … }
static Error applyCLOptions(const struct Options &Opts, ObjectFile &InputFile) { … }
}
}
int main(int Argc, char const *Argv[]) { … }