#include "ErrorCollector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/InterfaceStub/ELFObjHandler.h"
#include "llvm/InterfaceStub/IFSHandler.h"
#include "llvm/InterfaceStub/IFSStub.h"
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileOutputBuffer.h"
#include "llvm/Support/LLVMDriver.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/VersionTuple.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Triple.h"
#include "llvm/TextAPI/InterfaceFile.h"
#include "llvm/TextAPI/TextAPIReader.h"
#include "llvm/TextAPI/TextAPIWriter.h"
#include <optional>
#include <set>
#include <string>
#include <vector>
usingnamespacellvm;
usingnamespacellvm::yaml;
usingnamespacellvm::MachO;
usingnamespacellvm::ifs;
#define DEBUG_TYPE …
namespace {
const VersionTuple IfsVersionCurrent(3, 0);
enum class FileFormat { … };
}
usingnamespacellvm::opt;
enum ID { … };
#define PREFIX …
#include "Opts.inc"
#undef PREFIX
static constexpr opt::OptTable::Info InfoTable[] = …;
class IFSOptTable : public opt::GenericOptTable { … };
struct DriverConfig { … };
static std::string getTypeName(IFSSymbolType Type) { … }
static Expected<std::unique_ptr<IFSStub>>
readInputFile(std::optional<FileFormat> &InputFormat, StringRef FilePath) { … }
static int writeTbdStub(const Triple &T, const std::vector<IFSSymbol> &Symbols,
const StringRef Format, raw_ostream &Out) { … }
static void fatalError(Error Err) { … }
static void fatalError(Twine T) { … }
static Error writeIFS(StringRef FilePath, IFSStub &Stub, bool WriteIfChanged) { … }
static DriverConfig parseArgs(int argc, char *const *argv) { … }
int llvm_ifs_main(int argc, char **argv, const llvm::ToolContext &) { … }