mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 18:00:17 +02:00
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#include <clang/Frontend/FrontendAction.h>
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
struct OutputFilenames {
|
|
// Host
|
|
std::string function_unpacks;
|
|
std::string tab_function_unpacks;
|
|
std::string ldr;
|
|
std::string ldr_ptrs;
|
|
|
|
// Guest
|
|
std::string thunks;
|
|
std::string function_packs;
|
|
std::string function_packs_public;
|
|
std::string callback_unpacks_header_init;
|
|
|
|
// Guest + Host
|
|
std::string callback_structs;
|
|
std::string callback_typedefs;
|
|
std::string callback_unpacks_header;
|
|
std::string callback_unpacks;
|
|
|
|
std::string symbol_list;
|
|
};
|
|
|
|
class GenerateThunkLibsAction : public clang::ASTFrontendAction {
|
|
public:
|
|
GenerateThunkLibsAction(const std::string& libname, const OutputFilenames&);
|
|
|
|
void EndSourceFileAction() override;
|
|
|
|
std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(clang::CompilerInstance&, clang::StringRef /*file*/) override;
|
|
|
|
private:
|
|
const std::string& libfilename;
|
|
std::string libname; // sanitized filename, usable as part of emitted function names
|
|
const OutputFilenames& output_filenames;
|
|
};
|