#include "llvm/ADT/StringRef.h"
#include "llvm/CGData/CodeGenDataReader.h"
#include "llvm/CGData/CodeGenDataWriter.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/Binary.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/LLVMDriver.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
usingnamespacellvm;
usingnamespacellvm::object;
enum CGDataFormat { … };
enum CGDataAction { … };
namespace {
enum ID { … };
#define PREFIX …
#include "Opts.inc"
#undef PREFIX
usingnamespacellvm::opt;
static constexpr opt::OptTable::Info InfoTable[] = …;
class CGDataOptTable : public opt::GenericOptTable { … };
}
static StringRef ToolName;
static StringRef OutputFilename = …;
static StringRef Filename;
static bool ShowCGDataVersion;
static CGDataAction Action;
static std::optional<CGDataFormat> OutputFormat;
static std::vector<std::string> InputFilenames;
static void exitWithError(Twine Message, std::string Whence = "",
std::string Hint = "") { … }
static void exitWithError(Error E, StringRef Whence = "") { … }
static void exitWithErrorCode(std::error_code EC, StringRef Whence = "") { … }
static int convert_main(int argc, const char *argv[]) { … }
static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
OutlinedHashTreeRecord &GlobalOutlineRecord);
static bool handleArchive(StringRef Filename, Archive &Arch,
OutlinedHashTreeRecord &GlobalOutlineRecord) { … }
static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
OutlinedHashTreeRecord &GlobalOutlineRecord) { … }
static bool handleFile(StringRef Filename,
OutlinedHashTreeRecord &GlobalOutlineRecord) { … }
static int merge_main(int argc, const char *argv[]) { … }
static int show_main(int argc, const char *argv[]) { … }
static void parseArgs(int argc, char **argv) { … }
int llvm_cgdata_main(int argc, char **argvNonConst, const llvm::ToolContext &) { … }