From 2c1bbf5a992af96df3f8c2630504c01a4f54fe5d Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 15 Nov 2023 07:12:06 -0500 Subject: [PATCH] AK+LibIDL: Put IDL dbgln statement behind a debug flag This is a bit spammy now that we are performing some overload resolution at build time. The fallback to an interface has generally worked fine on the types it warns about (BufferSource, Module, etc.) so let's not warn about it for every build. --- AK/Debug.h.in | 4 ++++ Meta/CMake/all_the_debug_macros.cmake | 1 + Meta/gn/secondary/AK/BUILD.gn | 1 + Userland/Libraries/LibIDL/Types.cpp | 3 ++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/AK/Debug.h.in b/AK/Debug.h.in index d252d5ef947..a554a917eb9 100644 --- a/AK/Debug.h.in +++ b/AK/Debug.h.in @@ -210,6 +210,10 @@ # cmakedefine01 ICO_DEBUG #endif +#ifndef IDL_DEBUG +# cmakedefine01 IDL_DEBUG +#endif + #ifndef ILBM_DEBUG # cmakedefine01 ILBM_DEBUG #endif diff --git a/Meta/CMake/all_the_debug_macros.cmake b/Meta/CMake/all_the_debug_macros.cmake index 0cbfaac6bad..4d064bca47c 100644 --- a/Meta/CMake/all_the_debug_macros.cmake +++ b/Meta/CMake/all_the_debug_macros.cmake @@ -73,6 +73,7 @@ set(HTTPJOB_DEBUG ON) set(HUNKS_DEBUG ON) set(ICMP_DEBUG ON) set(ICO_DEBUG ON) +set(IDL_DEBUG ON) set(ILBM_DEBUG ON) set(IMAGE_DECODER_DEBUG ON) set(IMAGE_LOADER_DEBUG ON) diff --git a/Meta/gn/secondary/AK/BUILD.gn b/Meta/gn/secondary/AK/BUILD.gn index 9322c92694f..6e2cfdffc12 100644 --- a/Meta/gn/secondary/AK/BUILD.gn +++ b/Meta/gn/secondary/AK/BUILD.gn @@ -288,6 +288,7 @@ write_cmake_config("ak_debug_gen") { "HTTPJOB_DEBUG=", "HUNKS_DEBUG=", "ICO_DEBUG=", + "IDL_DEBUG=", "ILBM_DEBUG=", "IMAGE_DECODER_DEBUG=", "IMAGE_LOADER_DEBUG=", diff --git a/Userland/Libraries/LibIDL/Types.cpp b/Userland/Libraries/LibIDL/Types.cpp index cf1c6a1af08..0176977ba62 100644 --- a/Userland/Libraries/LibIDL/Types.cpp +++ b/Userland/Libraries/LibIDL/Types.cpp @@ -5,6 +5,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include namespace IDL { @@ -175,7 +176,7 @@ bool Type::is_distinguishable_from(IDL::Interface const& interface, IDL::Type co return DistinguishabilityCategory::SequenceLike; // FIXME: For lack of a better way of determining if something is an interface type, this just assumes anything we don't recognise is one. - dbgln("Unable to determine category for type named '{}', assuming it's an interface type.", type.name()); + dbgln_if(IDL_DEBUG, "Unable to determine category for type named '{}', assuming it's an interface type.", type.name()); return DistinguishabilityCategory::InterfaceLike; };