From b844bb1268ec1443b93726c5c1bd193cd32dc8a0 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 22 Dec 2023 20:41:59 +1000 Subject: [PATCH] Misc: Simplify platform/compiler macros --- common/Pcsx2Defs.h | 113 ++++++------------ pcsx2/GS/GSBlock.h | 16 +-- pcsx2/GS/GSClut.cpp | 2 +- pcsx2/GS/GSLocalMemoryMultiISA.cpp | 14 +-- pcsx2/GS/GSRegs.h | 2 +- pcsx2/GS/GSState.cpp | 28 ++--- pcsx2/GS/GSVector4.h | 10 +- pcsx2/GS/GSVector8.h | 10 +- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 4 +- .../GS/Renderers/HW/GSRendererHWMultiISA.cpp | 4 +- pcsx2/GS/Renderers/SW/GSDrawScanline.cpp | 4 +- pcsx2/GS/Renderers/SW/GSRasterizer.cpp | 2 +- pcsx2/GS/Renderers/SW/GSRendererSW.cpp | 4 +- pcsx2/SPU2/Dma.cpp | 3 + 14 files changed, 92 insertions(+), 124 deletions(-) diff --git a/common/Pcsx2Defs.h b/common/Pcsx2Defs.h index c8c783d49f..372c153906 100644 --- a/common/Pcsx2Defs.h +++ b/common/Pcsx2Defs.h @@ -17,9 +17,9 @@ // make sure __POSIX__ is defined for all systems where we assume POSIX compliance #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) - #ifndef __POSIX__ - #define __POSIX__ 1 - #endif +#ifndef __POSIX__ +#define __POSIX__ 1 +#endif #endif #include "Pcsx2Types.h" @@ -35,21 +35,16 @@ // -------------------------------------------------------------------------------------- // Dev / Debug conditionals - Consts for using if() statements instead of uglier #ifdef. // -------------------------------------------------------------------------------------- -// Note: Using if() optimizes nicely in Devel and Release builds, but will generate extra -// code overhead in debug builds (since debug neither inlines, nor optimizes out const- -// level conditionals). Normally not a concern, but if you stick if( IsDevbuild ) in -// some tight loops it will likely make debug builds unusably slow. -// #ifdef PCSX2_DEVBUILD - static constexpr bool IsDevBuild = true; +static constexpr bool IsDevBuild = true; #else - static constexpr bool IsDevBuild = false; +static constexpr bool IsDevBuild = false; #endif #ifdef PCSX2_DEBUG - static constexpr bool IsDebugBuild = true; +static constexpr bool IsDebugBuild = true; #else - static constexpr bool IsDebugBuild = false; +static constexpr bool IsDebugBuild = false; #endif // Defines the memory page size for the target platform at compilation. All supported platforms @@ -63,38 +58,40 @@ static constexpr unsigned int __pagemask = __pagesize - 1; // -------------------------------------------------------------------------------------- #ifdef _MSC_VER - #define __noinline __declspec(noinline) - #define __noreturn __declspec(noreturn) +#define __noinline __declspec(noinline) +#define __noreturn __declspec(noreturn) + +#define RESTRICT __restrict +#define ASSUME(x) __assume(x) #else // -------------------------------------------------------------------------------------- -// GCC / Intel Compilers Section +// GCC / Clang Compilers Section // -------------------------------------------------------------------------------------- - #define __assume(cond) do { if (!(cond)) __builtin_unreachable(); } while(0) +// SysV ABI passes vector parameters through registers unconditionally. +#ifndef _WIN32 +#define __vectorcall +#endif - // SysV ABI passes vector parameters through registers unconditionally. - #ifndef _WIN32 - #define __vectorcall - #endif +// Inlining note: GCC needs ((unused)) attributes defined on inlined functions to suppress +// warnings when a static inlined function isn't used in the scope of a single file (which +// happens *by design* like all the friggen time >_<) - // Inlining note: GCC needs ((unused)) attributes defined on inlined functions to suppress - // warnings when a static inlined function isn't used in the scope of a single file (which - // happens *by design* like all the friggen time >_<) +#define __forceinline __attribute__((always_inline, unused)) +#define __noinline __attribute__((noinline)) +#define __noreturn __attribute__((noreturn)) + +#define RESTRICT __restrict__ + +#define ASSUME(x) \ + do \ + { \ + if (!(x)) \ + __builtin_unreachable(); \ + } while (0) - #define _inline __inline__ __attribute__((unused)) - #ifdef NDEBUG - #define __forceinline __attribute__((always_inline, unused)) - #else - #define __forceinline __attribute__((unused)) - #endif - #ifndef __noinline - #define __noinline __attribute__((noinline)) - #endif - #ifndef __noreturn - #define __noreturn __attribute__((noreturn)) - #endif #endif // -------------------------------------------------------------------------------------- @@ -110,50 +107,18 @@ static constexpr unsigned int __pagemask = __pagesize - 1; // #define __fi __forceinline #ifdef PCSX2_DEVBUILD - #define __ri +#define __ri #else - #define __ri __fi -#endif - -#ifndef RESTRICT - #if defined(_MSC_VER) - #define RESTRICT __restrict - #elif defined(__GNUC__) - #define RESTRICT __restrict__ - #else - #define RESTRICT - #endif -#endif - -// __assume, potentially enables optimization. -#ifdef _MSC_VER -#define ASSUME(x) __assume(x) -#else -#define ASSUME(x) \ - do \ - { \ - if (!(x)) \ - __builtin_unreachable(); \ - } while (0) +#define __ri __fi #endif ////////////////////////////////////////////////////////////////////////////////////////// // Safe deallocation macros -- checks pointer validity (non-null) when needed, and sets // pointer to null after deallocation. -#define safe_delete(ptr) \ - ((void)(delete (ptr)), (ptr) = NULL) - -#define safe_delete_array(ptr) \ - ((void)(delete[](ptr)), (ptr) = NULL) - -// No checks for NULL. -#define safe_free(ptr) \ - ((void)(free(ptr), !!0), (ptr) = NULL) -//((void) (( ( (ptr) != NULL ) && (free( ptr ), !!0) ), (ptr) = NULL)) - -#define safe_fclose(ptr) \ - ((void)((((ptr) != NULL) && (fclose(ptr), !!0)), (ptr) = NULL)) +#define safe_delete(ptr) (delete (ptr), (ptr) = nullptr) +#define safe_delete_array(ptr) (delete[] (ptr), (ptr) = nullptr) +#define safe_free(ptr) (std::free(ptr), (ptr) = nullptr) // -------------------------------------------------------------------------------------- // ImplementEnumOperators (macro) @@ -257,6 +222,6 @@ static constexpr s64 _4gb = _1gb * 4; // Disable some spammy warnings which wx appeared to disable. // We probably should fix these at some point. #ifdef _MSC_VER -#pragma warning(disable: 4244) // warning C4244: 'initializing': conversion from 'uptr' to 'uint', possible loss of data -#pragma warning(disable: 4267) // warning C4267: 'initializing': conversion from 'size_t' to 'uint', possible loss of data +#pragma warning(disable : 4244) // warning C4244: 'initializing': conversion from 'uptr' to 'uint', possible loss of data +#pragma warning(disable : 4267) // warning C4267: 'initializing': conversion from 'size_t' to 'uint', possible loss of data #endif diff --git a/pcsx2/GS/GSBlock.h b/pcsx2/GS/GSBlock.h index de9f3cb816..60847c098b 100644 --- a/pcsx2/GS/GSBlock.h +++ b/pcsx2/GS/GSBlock.h @@ -319,7 +319,7 @@ public: case 1: WriteColumn32<1, alignment, mask>(dst, src, srcpitch); break; case 2: WriteColumn32<2, alignment, mask>(dst, src, srcpitch); break; case 3: WriteColumn32<3, alignment, mask>(dst, src, srcpitch); break; - default: __assume(0); + default: ASSUME(0); } } @@ -332,7 +332,7 @@ public: case 1: WriteColumn16<1, alignment>(dst, src, srcpitch); break; case 2: WriteColumn16<2, alignment>(dst, src, srcpitch); break; case 3: WriteColumn16<3, alignment>(dst, src, srcpitch); break; - default: __assume(0); + default: ASSUME(0); } } @@ -345,7 +345,7 @@ public: case 1: WriteColumn8<1, alignment>(dst, src, srcpitch); break; case 2: WriteColumn8<2, alignment>(dst, src, srcpitch); break; case 3: WriteColumn8<3, alignment>(dst, src, srcpitch); break; - default: __assume(0); + default: ASSUME(0); } } @@ -358,7 +358,7 @@ public: case 1: WriteColumn4<1, alignment>(dst, src, srcpitch); break; case 2: WriteColumn4<2, alignment>(dst, src, srcpitch); break; case 3: WriteColumn4<3, alignment>(dst, src, srcpitch); break; - default: __assume(0); + default: ASSUME(0); } } @@ -640,7 +640,7 @@ public: case 1: ReadColumn32<1>(src, dst, dstpitch); break; case 2: ReadColumn32<2>(src, dst, dstpitch); break; case 3: ReadColumn32<3>(src, dst, dstpitch); break; - default: __assume(0); + default: ASSUME(0); } } @@ -652,7 +652,7 @@ public: case 1: ReadColumn16<1>(src, dst, dstpitch); break; case 2: ReadColumn16<2>(src, dst, dstpitch); break; case 3: ReadColumn16<3>(src, dst, dstpitch); break; - default: __assume(0); + default: ASSUME(0); } } @@ -664,7 +664,7 @@ public: case 1: ReadColumn8<1>(src, dst, dstpitch); break; case 2: ReadColumn8<2>(src, dst, dstpitch); break; case 3: ReadColumn8<3>(src, dst, dstpitch); break; - default: __assume(0); + default: ASSUME(0); } } @@ -676,7 +676,7 @@ public: case 1: ReadColumn4<1>(src, dst, dstpitch); break; case 2: ReadColumn4<2>(src, dst, dstpitch); break; case 3: ReadColumn4<3>(src, dst, dstpitch); break; - default: __assume(0); + default: ASSUME(0); } } diff --git a/pcsx2/GS/GSClut.cpp b/pcsx2/GS/GSClut.cpp index 2e75174167..4f6ba6ee8f 100644 --- a/pcsx2/GS/GSClut.cpp +++ b/pcsx2/GS/GSClut.cpp @@ -202,7 +202,7 @@ bool GSClut::CanLoadCLUT(const GIFRegTEX0& TEX0, const bool update_CBP) m_CBP[1] = TEX0.CBP; break; default: - __assume(0); + ASSUME(0); } return true; diff --git a/pcsx2/GS/GSLocalMemoryMultiISA.cpp b/pcsx2/GS/GSLocalMemoryMultiISA.cpp index c9c5962b47..3f57872eae 100644 --- a/pcsx2/GS/GSLocalMemoryMultiISA.cpp +++ b/pcsx2/GS/GSLocalMemoryMultiISA.cpp @@ -235,7 +235,7 @@ void GSLocalMemoryFunctions::WriteImageColumn(GSLocalMemory& mem, int l, int r, case PSMZ16: GSBlock::WriteColumn16(y, mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break; case PSMZ16S: GSBlock::WriteColumn16(y, mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break; // TODO - default: __assume(0); + default: ASSUME(0); } } } @@ -262,7 +262,7 @@ void GSLocalMemoryFunctions::WriteImageBlock(GSLocalMemory& mem, int l, int r, i case PSMZ16: GSBlock::WriteBlock16(mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break; case PSMZ16S: GSBlock::WriteBlock16(mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break; // TODO - default: __assume(0); + default: ASSUME(0); } } } @@ -289,7 +289,7 @@ void GSLocalMemoryFunctions::WriteImageLeftRight(GSLocalMemory& mem, int l, int case PSMZ16: mem.WritePixel16Z(x, y, *(u16*)&src[x * 2], bp, bw); break; case PSMZ16S: mem.WritePixel16SZ(x, y, *(u16*)&src[x * 2], bp, bw); break; // TODO - default: __assume(0); + default: ASSUME(0); } } } @@ -328,7 +328,7 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int case PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break; case PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break; // TODO - default: __assume(0); + default: ASSUME(0); } switch (psm) @@ -361,7 +361,7 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int break; // TODO default: - __assume(0); + ASSUME(0); } } @@ -421,7 +421,7 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int case PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break; case PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break; // TODO - default: __assume(0); + default: ASSUME(0); } switch (psm) @@ -454,7 +454,7 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int break; // TODO default: - __assume(0); + ASSUME(0); } } } diff --git a/pcsx2/GS/GSRegs.h b/pcsx2/GS/GSRegs.h index 649744258d..227ddfd275 100644 --- a/pcsx2/GS/GSRegs.h +++ b/pcsx2/GS/GSRegs.h @@ -1219,7 +1219,7 @@ struct alignas(32) GIFPath case 16: break; default: - __assume(0); + ASSUME(0); } } } diff --git a/pcsx2/GS/GSState.cpp b/pcsx2/GS/GSState.cpp index b964917f0b..64c3b6049e 100644 --- a/pcsx2/GS/GSState.cpp +++ b/pcsx2/GS/GSState.cpp @@ -364,7 +364,7 @@ GSVideoMode GSState::GetVideoMode() return GSVideoMode::Unknown; } - __assume(0); // unreachable + ASSUME(0); // unreachable } float GSState::GetTvRefreshRate() @@ -388,7 +388,7 @@ float GSState::GetTvRefreshRate() return 0; } - __assume(0); // unreachable + ASSUME(0); // unreachable } const char* GSState::GetFlushReasonString(GSFlushReason reason) @@ -1658,7 +1658,7 @@ void GSState::FlushPrim() case GS_INVALID: break; default: - __assume(0); + ASSUME(0); } pxAssert((int)unused < GSUtil::GetVertexCount(PRIM->PRIM)); @@ -2427,7 +2427,7 @@ void GSState::Transfer(const u8* mem, u32 size) break; default: - __assume(0); + ASSUME(0); } path.nloop = 0; @@ -2494,7 +2494,7 @@ void GSState::Transfer(const u8* mem, u32 size) break; } default: - __assume(0); + ASSUME(0); } } @@ -3477,7 +3477,7 @@ __forceinline void GSState::VertexKick(u32 skip) GrowVertexBuffer(); // in case too many vertices were skipped break; default: - __assume(0); + ASSUME(0); } return; @@ -3576,7 +3576,7 @@ __forceinline void GSState::VertexKick(u32 skip) m_vertex.tail = head; return; default: - __assume(0); + ASSUME(0); } // Update rectangle for the current draw. We can use the re-integer coordinates from min/max here. @@ -3678,7 +3678,7 @@ GSState::TextureMinMaxResult GSState::GetTextureMinMax(GIFRegTEX0 TEX0, GIFRegCL vr.z = (maxu | minu) + 1; break; default: - __assume(0); + ASSUME(0); } switch (wmt) @@ -3696,7 +3696,7 @@ GSState::TextureMinMaxResult GSState::GetTextureMinMax(GIFRegTEX0 TEX0, GIFRegCL vr.w = (maxv | minv) + 1; break; default: - __assume(0); + ASSUME(0); } // Software renderer fixes TEX0 so that TW/TH contain MAXU/MAXV. @@ -3925,7 +3925,7 @@ void GSState::CalcAlphaMinMax(const int tex_alpha_min, const int tex_alpha_max) m_mem.m_clut.GetAlphaMinMax32(a.y, a.w); break; default: - __assume(0); + ASSUME(0); } switch (context->TEX0.TFX) @@ -3955,7 +3955,7 @@ void GSState::CalcAlphaMinMax(const int tex_alpha_min, const int tex_alpha_max) a.z = a.w; break; default: - __assume(0); + ASSUME(0); } } min = a.x; @@ -3995,7 +3995,7 @@ bool GSState::TryAlphaTest(u32& fm, u32& zm) return true; break; default: - __assume(0); + ASSUME(0); } bool pass = true; @@ -4069,7 +4069,7 @@ bool GSState::TryAlphaTest(u32& fm, u32& zm) return false; break; default: - __assume(0); + ASSUME(0); } } @@ -4091,7 +4091,7 @@ bool GSState::TryAlphaTest(u32& fm, u32& zm) zm = 0xffffffff; break; default: - __assume(0); + ASSUME(0); } } diff --git a/pcsx2/GS/GSVector4.h b/pcsx2/GS/GSVector4.h index c1fcdbcfb7..4c93bc1051 100644 --- a/pcsx2/GS/GSVector4.h +++ b/pcsx2/GS/GSVector4.h @@ -553,7 +553,7 @@ public: case 1: return yyyy(v).zxzw(*this); case 2: return yyzz(v).zxzw(*this); case 3: return yyww(v).zxzw(*this); - default: __assume(0); + default: ASSUME(0); } break; case 1: @@ -563,7 +563,7 @@ public: case 1: return xxyy(v).xzzw(*this); case 2: return xxzz(v).xzzw(*this); case 3: return xxww(v).xzzw(*this); - default: __assume(0); + default: ASSUME(0); } break; case 2: @@ -573,7 +573,7 @@ public: case 1: return xyzx(wwyy(v)); case 2: return xyzx(wwzz(v)); case 3: return xyzx(wwww(v)); - default: __assume(0); + default: ASSUME(0); } break; case 3: @@ -583,11 +583,11 @@ public: case 1: return xyxz(zzyy(v)); case 2: return xyxz(zzzz(v)); case 3: return xyxz(zzww(v)); - default: __assume(0); + default: ASSUME(0); } break; default: - __assume(0); + ASSUME(0); } #endif diff --git a/pcsx2/GS/GSVector8.h b/pcsx2/GS/GSVector8.h index 21ccb5566a..7be526dc25 100644 --- a/pcsx2/GS/GSVector8.h +++ b/pcsx2/GS/GSVector8.h @@ -512,7 +512,7 @@ public: case 1: return yyyy(v).zxzw(*this); case 2: return yyzz(v).zxzw(*this); case 3: return yyww(v).zxzw(*this); - default: __assume(0); + default: ASSUME(0); } break; case 1: @@ -522,7 +522,7 @@ public: case 1: return xxyy(v).xzzw(*this); case 2: return xxzz(v).xzzw(*this); case 3: return xxww(v).xzzw(*this); - default: __assume(0); + default: ASSUME(0); } break; case 2: @@ -532,7 +532,7 @@ public: case 1: return xyzx(wwyy(v)); case 2: return xyzx(wwzz(v)); case 3: return xyzx(wwww(v)); - default: __assume(0); + default: ASSUME(0); } break; case 3: @@ -542,11 +542,11 @@ public: case 1: return xyxz(zzyy(v)); case 2: return xyxz(zzzz(v)); case 3: return xyxz(zzww(v)); - default: __assume(0); + default: ASSUME(0); } break; default: - __assume(0); + ASSUME(0); } return *this; diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index d8ae65bf80..5b633f1510 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -3107,7 +3107,7 @@ void GSRendererHW::SetupIA(float target_scale, float sx, float sy) break; default: - __assume(0); + ASSUME(0); } m_conf.verts = m_vertex.buff; @@ -5376,7 +5376,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta case AFAIL_FB_ONLY: z = false; break; // rgba case AFAIL_ZB_ONLY: r = g = b = a = false; break; // z case AFAIL_RGB_ONLY: z = a = false; break; // rgb - default: __assume(0); + default: ASSUME(0); } // Depth test should be disabled when depth writes are masked and similarly, Alpha test must be disabled diff --git a/pcsx2/GS/Renderers/HW/GSRendererHWMultiISA.cpp b/pcsx2/GS/Renderers/HW/GSRendererHWMultiISA.cpp index ea8a1c923e..0b171bf6b7 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHWMultiISA.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHWMultiISA.cpp @@ -365,7 +365,7 @@ bool GSRendererHWFunctions::SwPrimRender(GSRendererHW& hw, bool invalidate_tc, b gd.t.mask.U32[0] = 0xffffffff; break; default: - __assume(0); + ASSUME(0); } switch (context->CLAMP.WMT) @@ -393,7 +393,7 @@ bool GSRendererHWFunctions::SwPrimRender(GSRendererHW& hw, bool invalidate_tc, b gd.t.mask.U32[2] = 0xffffffff; break; default: - __assume(0); + ASSUME(0); } gd.t.min = gd.t.min.xxxxlh(); diff --git a/pcsx2/GS/Renderers/SW/GSDrawScanline.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanline.cpp index f9132e9c86..84d5f2dbed 100644 --- a/pcsx2/GS/Renderers/SW/GSDrawScanline.cpp +++ b/pcsx2/GS/Renderers/SW/GSDrawScanline.cpp @@ -395,7 +395,7 @@ __ri static bool TestAlpha(T& test, T& fm, T& zm, const T& ga, const GSScanlineG break; default: - __assume(0); + ASSUME(0); } switch (sel.afail) @@ -420,7 +420,7 @@ __ri static bool TestAlpha(T& test, T& fm, T& zm, const T& ga, const GSScanlineG break; default: - __assume(0); + ASSUME(0); } return true; diff --git a/pcsx2/GS/Renderers/SW/GSRasterizer.cpp b/pcsx2/GS/Renderers/SW/GSRasterizer.cpp index 1eb057d91f..7311e3ec60 100644 --- a/pcsx2/GS/Renderers/SW/GSRasterizer.cpp +++ b/pcsx2/GS/Renderers/SW/GSRasterizer.cpp @@ -246,7 +246,7 @@ void GSRasterizer::Draw(GSRasterizerData& data) break; default: - __assume(0); + ASSUME(0); } #if _M_SSE >= 0x501 diff --git a/pcsx2/GS/Renderers/SW/GSRendererSW.cpp b/pcsx2/GS/Renderers/SW/GSRendererSW.cpp index 918da2547a..47cec53e94 100644 --- a/pcsx2/GS/Renderers/SW/GSRendererSW.cpp +++ b/pcsx2/GS/Renderers/SW/GSRendererSW.cpp @@ -1241,7 +1241,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data) gd.t.mask.U32[0] = 0xffffffff; break; default: - __assume(0); + ASSUME(0); } switch (context->CLAMP.WMT) @@ -1270,7 +1270,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data) gd.t.mask.U32[2] = 0xffffffff; break; default: - __assume(0); + ASSUME(0); } gd.t.min = gd.t.min.xxxxlh(); diff --git a/pcsx2/SPU2/Dma.cpp b/pcsx2/SPU2/Dma.cpp index 9bd32fd2b4..12af33abba 100644 --- a/pcsx2/SPU2/Dma.cpp +++ b/pcsx2/SPU2/Dma.cpp @@ -23,6 +23,9 @@ #ifdef PCSX2_DEVBUILD +#define safe_fclose(ptr) \ + ((void)((((ptr) != nullptr) && (std::fclose(ptr), !!0)), (ptr) = nullptr)) + static FILE* DMA4LogFile = nullptr; static FILE* DMA7LogFile = nullptr; static FILE* ADMA4LogFile = nullptr;