mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-01-10 15:50:18 +00:00
Thunks/gen: Move definition of GenerateThunkLibsAction into gen.cpp
This commit is contained in:
parent
a583ebe590
commit
56460b220c
@ -394,6 +394,20 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
GenerateThunkLibsAction::GenerateThunkLibsAction(const std::string& libname_, const OutputFilenames& output_filenames_)
|
||||
: libfilename(libname_), libname(libname_), output_filenames(output_filenames_) {
|
||||
for (auto& c : libname) {
|
||||
@ -738,3 +752,7 @@ void GenerateThunkLibsAction::EndSourceFileAction() {
|
||||
std::unique_ptr<clang::ASTConsumer> GenerateThunkLibsAction::CreateASTConsumer(clang::CompilerInstance&, clang::StringRef) {
|
||||
return std::make_unique<ASTConsumer>();
|
||||
}
|
||||
|
||||
std::unique_ptr<clang::FrontendAction> GenerateThunkLibsActionFactory::create() {
|
||||
return std::make_unique<GenerateThunkLibsAction>(libname, output_filenames);
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <clang/Frontend/FrontendAction.h>
|
||||
#include <clang/Tooling/Tooling.h>
|
||||
|
||||
#include <optional>
|
||||
@ -9,29 +8,13 @@ struct OutputFilenames {
|
||||
std::string guest;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
class GenerateThunkLibsActionFactory : public clang::tooling::FrontendActionFactory {
|
||||
public:
|
||||
GenerateThunkLibsActionFactory(std::string_view libname_, OutputFilenames output_filenames_)
|
||||
: libname(std::move(libname_)), output_filenames(std::move(output_filenames_)) {
|
||||
}
|
||||
|
||||
std::unique_ptr<clang::FrontendAction> create() override {
|
||||
return std::make_unique<GenerateThunkLibsAction>(libname, output_filenames);
|
||||
}
|
||||
std::unique_ptr<clang::FrontendAction> create() override;
|
||||
|
||||
private:
|
||||
std::string libname;
|
||||
|
Loading…
Reference in New Issue
Block a user