Skip to content

Commit

Permalink
externals: Update fmt to 8.1.1
Browse files Browse the repository at this point in the history
Brings along a bunch of enhancements and ensures we always build against
the latest version.

Also fixes up a few issues that arose due to changes in fmt
  • Loading branch information
lioncash committed Jan 13, 2022
1 parent 0a8717d commit 2296126
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
8 changes: 4 additions & 4 deletions External/FEXCore/Source/Common/JitSymbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@ namespace FEXCore {

// Linux perf format is very straightforward
// `<HostPtr> <Size> <Name>\n`
fmt::print(fp.get(), "{:x} {:x} JIT_0x{:x}_{:x}\n", HostAddr, CodeSize, GuestAddr, HostAddr);
fmt::print(fp.get(), "{} {:x} JIT_0x{:x}_{}\n", HostAddr, CodeSize, GuestAddr, HostAddr);
}

void JITSymbols::Register(const void *HostAddr, uint32_t CodeSize, std::string_view Name) {
if (!fp) return;

// Linux perf format is very straightforward
// `<HostPtr> <Size> <Name>\n`
fmt::print(fp.get(), "{:x} {:x} {}_{:x}\n", HostAddr, CodeSize, Name, HostAddr);
fmt::print(fp.get(), "{} {:x} {}_{}\n", HostAddr, CodeSize, Name, HostAddr);
}

void JITSymbols::RegisterNamedRegion(const void *HostAddr, uint32_t CodeSize, std::string_view Name) {
if (!fp) return;

// Linux perf format is very straightforward
// `<HostPtr> <Size> <Name>\n`
fmt::print(fp.get(), "{:x} {:x} {}\n", HostAddr, CodeSize, Name);
fmt::print(fp.get(), "{} {:x} {}\n", HostAddr, CodeSize, Name);
}

void JITSymbols::RegisterJITSpace(const void *HostAddr, uint32_t CodeSize) {
if (!fp) return;

// Linux perf format is very straightforward
// `<HostPtr> <Size> <Name>\n`
fmt::print(fp.get(), "{:x} {:x} FEXJIT\n", HostAddr, CodeSize);
fmt::print(fp.get(), "{} {:x} FEXJIT\n", HostAddr, CodeSize);
}

} // namespace FEXCore
10 changes: 10 additions & 0 deletions External/FEXCore/include/FEXCore/Debug/X86Tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <cstring>
#include <type_traits>

#include <fmt/format.h>

namespace FEXCore::IR {
///< Forward declaration of OpDispatchBuilder
class OpDispatchBuilder;
Expand Down Expand Up @@ -513,3 +515,11 @@ extern FEX_DEFAULT_VISIBILITY std::array<X86InstInfo, MAX_XOP_GROUP_TABLE_SIZE>
// EVEX
extern FEX_DEFAULT_VISIBILITY std::array<X86InstInfo, MAX_EVEX_TABLE_SIZE> EVEXTableOps;
}

template <>
struct fmt::formatter<FEXCore::X86Tables::DecodedOperand::OpType> : formatter<uint32_t> {
template <typename FormatContext>
auto format(FEXCore::X86Tables::DecodedOperand::OpType type, FormatContext& ctx) const {
return fmt::formatter<uint32_t>::format(static_cast<uint32_t>(type), ctx);
}
};
2 changes: 1 addition & 1 deletion External/fmt
Submodule fmt updated 107 files
5 changes: 5 additions & 0 deletions Source/Common/SocketLogging.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#pragma once

#include <FEXCore/Utils/Event.h>
#include <FEXCore/Utils/LogManager.h>

#include <functional>
#include <memory>
#include <string>

namespace FEX::SocketLogging {
// Client side
namespace Client {
Expand Down
4 changes: 2 additions & 2 deletions Source/Tests/IRLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ void MsgHandler(LogMan::DebugLevels Level, char const *Message)
break;
}

fmt::format("[{}] {}\n", CharLevel, Message);
fmt::print("[{}] {}\n", CharLevel, Message);
fflush(stdout);
}

void AssertHandler(char const *Message)
{
fmt::format("[ASSERT] {}\n", Message);
fmt::print("[ASSERT] {}\n", Message);
fflush(stdout);
}

Expand Down

0 comments on commit 2296126

Please sign in to comment.