Files
FEX-Emu--FEX/Source/Tests/IRLoader/Loader.cpp
T
Lioncash 75b2f226f6 General: Migrate over to fmt where possible
Migrates lingering instances of the old logger over to fmt where
applicable. This allows removing some of the old defines and functions.

The only remaining usages of the printf-based variant of the logger is
in Tests/LinuxSyscalls/Syscalls.cpp for the strace handling.
2021-11-23 12:51:57 -05:00

32 lines
772 B
C++

#include "IRLoader/Loader.h"
#include <FEXCore/Utils/LogManager.h>
#include <FEXCore/IR/IR.h>
#include <FEXCore/IR/IREmitter.h>
#include <fstream>
#include <stdio.h>
namespace FEX::IRLoader {
Loader::Loader(std::string const &Filename, std::string const &ConfigFilename) {
Config.Init(ConfigFilename);
std::fstream fp(Filename, std::fstream::binary | std::fstream::in);
if (!fp.is_open()) {
LogMan::Msg::EFmt("Couldn't open IR file '{}'", Filename);
return;
}
ParsedCode = FEXCore::IR::Parse(&fp);
if (ParsedCode) {
auto NewIR = ParsedCode->ViewIR();
EntryRIP = 0x40000;
std::stringstream out;
FEXCore::IR::Dump(&out, &NewIR, nullptr);
fmt::print("IR:\n{}\n@@@@@\n", out.str());
}
}
}