From c5eddd922d7c0ee5c02bce302d8db2cea403b19d Mon Sep 17 00:00:00 2001 From: LC Date: Fri, 17 Jul 2026 01:47:30 -0400 Subject: [PATCH] FEXCore: Resolve missing prototype warnings Makes sure we mark everything internally linked as necessary, or make declarations visible to their implementation. --- FEXCore/Source/Interface/Config/Config.cpp | 5 +++-- FEXCore/Source/Interface/Core/CPUBackend.cpp | 4 ---- FEXCore/Source/Interface/Core/CPUID.cpp | 4 ++-- FEXCore/Source/Interface/IR/Passes/IRValidation.cpp | 1 + .../IR/Passes/RedundantFlagCalculationElimination.cpp | 1 + .../Source/Interface/IR/Passes/x87StackOptimizationPass.cpp | 1 + FEXCore/Source/Utils/Allocator.cpp | 6 +++--- FEXCore/Source/Utils/ForcedAssert.cpp | 2 ++ 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/FEXCore/Source/Interface/Config/Config.cpp b/FEXCore/Source/Interface/Config/Config.cpp index be169803f..56ce0196b 100644 --- a/FEXCore/Source/Interface/Config/Config.cpp +++ b/FEXCore/Source/Interface/Config/Config.cpp @@ -1,9 +1,10 @@ // SPDX-License-Identifier: MIT #include "Common/StringConv.h" -#include "FEXCore/Utils/EnumUtils.h" +#include "Utils/Config.h" #include #include +#include #include #include #include @@ -252,7 +253,7 @@ void Load() { } } -fextl::string ExpandPath(const fextl::string& ContainerPrefix, const fextl::string& PathName) { +static fextl::string ExpandPath(const fextl::string& ContainerPrefix, const fextl::string& PathName) { if (PathName.empty()) { return {}; } diff --git a/FEXCore/Source/Interface/Core/CPUBackend.cpp b/FEXCore/Source/Interface/Core/CPUBackend.cpp index ba17aa288..fe67faa97 100644 --- a/FEXCore/Source/Interface/Core/CPUBackend.cpp +++ b/FEXCore/Source/Interface/Core/CPUBackend.cpp @@ -346,10 +346,6 @@ namespace CPU { return nullptr; } - GuestToHostMap& GetLookupCache(const CodeBuffer& Buffer) { - return *Buffer.LookupCache; - } - CodeBuffer::CodeBuffer(size_t Size) : AllocatedSize(Size) { Ptr = static_cast(FEXCore::Allocator::VirtualAlloc(Size, true)); diff --git a/FEXCore/Source/Interface/Core/CPUID.cpp b/FEXCore/Source/Interface/Core/CPUID.cpp index 74d6f61bb..194419658 100644 --- a/FEXCore/Source/Interface/Core/CPUID.cpp +++ b/FEXCore/Source/Interface/Core/CPUID.cpp @@ -100,7 +100,7 @@ namespace ProductNames { #endif } // namespace ProductNames -uint32_t GetCPUID_Syscall() { +static uint32_t GetCPUID_Syscall() { uint32_t CPU {}; FHU::Syscalls::getcpu(&CPU, nullptr); return CPU; @@ -148,7 +148,7 @@ uint64_t GetCycleCounterFrequency() { return Result; } -uint32_t GetCPUID_TPIDRRO() { +static uint32_t GetCPUID_TPIDRRO() { uint64_t Result {}; __asm("mrs %[Res], TPIDRRO_EL0" : [Res] "=r"(Result)); return Result; diff --git a/FEXCore/Source/Interface/IR/Passes/IRValidation.cpp b/FEXCore/Source/Interface/IR/Passes/IRValidation.cpp index 1d32618f5..f16044ef7 100644 --- a/FEXCore/Source/Interface/IR/Passes/IRValidation.cpp +++ b/FEXCore/Source/Interface/IR/Passes/IRValidation.cpp @@ -10,6 +10,7 @@ $end_info$ #include "Interface/IR/IREmitter.h" #include "Interface/IR/PassManager.h" #include "Interface/IR/RegisterAllocationData.h" +#include "Interface/IR/Passes.h" #include "Interface/IR/Passes/IRValidation.h" #include "Interface/IR/Passes/RegisterAllocationPass.h" diff --git a/FEXCore/Source/Interface/IR/Passes/RedundantFlagCalculationElimination.cpp b/FEXCore/Source/Interface/IR/Passes/RedundantFlagCalculationElimination.cpp index 2883f0d73..dc44f1606 100644 --- a/FEXCore/Source/Interface/IR/Passes/RedundantFlagCalculationElimination.cpp +++ b/FEXCore/Source/Interface/IR/Passes/RedundantFlagCalculationElimination.cpp @@ -7,6 +7,7 @@ $end_info$ #include "Interface/IR/IR.h" #include "Interface/IR/IREmitter.h" +#include "Interface/IR/Passes.h" #include "Interface/IR/PassManager.h" #include diff --git a/FEXCore/Source/Interface/IR/Passes/x87StackOptimizationPass.cpp b/FEXCore/Source/Interface/IR/Passes/x87StackOptimizationPass.cpp index 23607baac..5a49a822a 100644 --- a/FEXCore/Source/Interface/IR/Passes/x87StackOptimizationPass.cpp +++ b/FEXCore/Source/Interface/IR/Passes/x87StackOptimizationPass.cpp @@ -3,6 +3,7 @@ #include "Interface/Core/Interpreter/Fallbacks/FallbackOpHandler.h" #include "Interface/IR/IR.h" #include "Interface/IR/IREmitter.h" +#include "Interface/IR/Passes.h" #include "Interface/IR/PassManager.h" #include "FEXCore/IR/IR.h" #include "FEXCore/Utils/Profiler.h" diff --git a/FEXCore/Source/Utils/Allocator.cpp b/FEXCore/Source/Utils/Allocator.cpp index 296dc2bff..2060f269c 100644 --- a/FEXCore/Source/Utils/Allocator.cpp +++ b/FEXCore/Source/Utils/Allocator.cpp @@ -42,9 +42,9 @@ using GLIBC_MALLOC_Hook = void* (*)(size_t, const void* caller); using GLIBC_REALLOC_Hook = void* (*)(void*, size_t, const void* caller); using GLIBC_FREE_Hook = void (*)(void*, const void* caller); -fextl::unique_ptr Alloc64 {}; +static fextl::unique_ptr Alloc64 {}; -void* FEX_mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset) { +static void* FEX_mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset) { void* Result = Alloc64->Mmap(addr, length, prot, flags, fd, offset); if (Result >= (void*)-4096) { errno = -(uint64_t)Result; @@ -68,7 +68,7 @@ void VirtualName(const char* Name, void* Ptr, size_t Size) { } } -int FEX_munmap(void* addr, size_t length) { +static int FEX_munmap(void* addr, size_t length) { int Result = Alloc64->Munmap(addr, length); if (Result != 0) { diff --git a/FEXCore/Source/Utils/ForcedAssert.cpp b/FEXCore/Source/Utils/ForcedAssert.cpp index f03c2fab6..201122fa5 100644 --- a/FEXCore/Source/Utils/ForcedAssert.cpp +++ b/FEXCore/Source/Utils/ForcedAssert.cpp @@ -1,4 +1,6 @@ // SPDX-License-Identifier: MIT +#include + namespace FEXCore::Assert { // This function can not be inlined [[noreturn]]