#include "ResourceFileWriter.h"
#include "ResourceScriptCppFilter.h"
#include "ResourceScriptParser.h"
#include "ResourceScriptStmt.h"
#include "ResourceScriptToken.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Object/WindowsResource.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptTable.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/LLVMDriver.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/StringSaver.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <system_error>
usingnamespacellvm;
usingnamespacellvm::rc;
usingnamespacellvm::opt;
namespace {
enum ID { … };
namespace rc_opt {
#define PREFIX …
#include "Opts.inc"
#undef PREFIX
static constexpr opt::OptTable::Info InfoTable[] = …;
}
class RcOptTable : public opt::GenericOptTable { … };
enum Windres_ID { … };
namespace windres_opt {
#define PREFIX …
#include "WindresOpts.inc"
#undef PREFIX
static constexpr opt::OptTable::Info InfoTable[] = …;
}
class WindresOptTable : public opt::GenericOptTable { … };
static ExitOnError ExitOnErr;
static FileRemover TempPreprocFile;
static FileRemover TempResFile;
[[noreturn]] static void fatalError(const Twine &Message) { … }
std::string createTempFile(const Twine &Prefix, StringRef Suffix) { … }
ErrorOr<std::string> findClang(const char *Argv0, StringRef Triple) { … }
bool isUsableArch(Triple::ArchType Arch) { … }
Triple::ArchType getDefaultFallbackArch() { … }
std::string getClangClTriple() { … }
std::string getMingwTriple() { … }
enum Format { … };
struct RcOptions { … };
void preprocess(StringRef Src, StringRef Dst, const RcOptions &Opts,
const char *Argv0) { … }
static std::pair<bool, std::string> isWindres(llvm::StringRef Argv0) { … }
Format parseFormat(StringRef S) { … }
void deduceFormat(Format &Dest, StringRef File) { … }
std::string unescape(StringRef S) { … }
RcOptions parseWindresOptions(ArrayRef<const char *> ArgsArr,
ArrayRef<const char *> InputArgsArray,
std::string Prefix) { … }
RcOptions parseRcOptions(ArrayRef<const char *> ArgsArr,
ArrayRef<const char *> InputArgsArray) { … }
RcOptions getOptions(const char *Argv0, ArrayRef<const char *> ArgsArr,
ArrayRef<const char *> InputArgs) { … }
void doRc(std::string Src, std::string Dest, RcOptions &Opts,
const char *Argv0) { … }
void doCvtres(std::string Src, std::string Dest, std::string TargetTriple) { … }
}
int llvm_rc_main(int Argc, char **Argv, const llvm::ToolContext &) { … }