diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index f73dac77ae..28bbe47690 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -41749,7 +41749,6 @@ ORIGIN: ../../../flutter/fml/build_config.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/closure.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/command_line.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/command_line.h + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/fml/compiler_specific.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/concurrent_message_loop.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/concurrent_message_loop.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/fml/concurrent_message_loop_factory.cc + ../../../flutter/LICENSE @@ -44634,7 +44633,6 @@ FILE: ../../../flutter/fml/build_config.h FILE: ../../../flutter/fml/closure.h FILE: ../../../flutter/fml/command_line.cc FILE: ../../../flutter/fml/command_line.h -FILE: ../../../flutter/fml/compiler_specific.h FILE: ../../../flutter/fml/concurrent_message_loop.cc FILE: ../../../flutter/fml/concurrent_message_loop.h FILE: ../../../flutter/fml/concurrent_message_loop_factory.cc diff --git a/engine/src/flutter/flow/layers/layer.h b/engine/src/flutter/flow/layers/layer.h index b912207d00..c64f69633d 100644 --- a/engine/src/flutter/flow/layers/layer.h +++ b/engine/src/flutter/flow/layers/layer.h @@ -19,7 +19,6 @@ #include "flutter/flow/raster_cache.h" #include "flutter/flow/stopwatch.h" #include "flutter/fml/build_config.h" -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/logging.h" #include "flutter/fml/macros.h" #include "flutter/fml/trace_event.h" diff --git a/engine/src/flutter/fml/BUILD.gn b/engine/src/flutter/fml/BUILD.gn index f7c271401c..ab3a6ba9ee 100644 --- a/engine/src/flutter/fml/BUILD.gn +++ b/engine/src/flutter/fml/BUILD.gn @@ -18,7 +18,6 @@ source_set("fml") { "base32.h", "build_config.h", "closure.h", - "compiler_specific.h", "concurrent_message_loop.cc", "concurrent_message_loop.h", "container.h", diff --git a/engine/src/flutter/fml/compiler_specific.h b/engine/src/flutter/fml/compiler_specific.h deleted file mode 100644 index 52c9e6c9a4..0000000000 --- a/engine/src/flutter/fml/compiler_specific.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLUTTER_FML_COMPILER_SPECIFIC_H_ -#define FLUTTER_FML_COMPILER_SPECIFIC_H_ - -#if !defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER) -#error Unsupported compiler. -#endif - -// Annotate a variable indicating it's ok if the variable is not used. -// (Typically used to silence a compiler warning when the assignment -// is important for some other reason.) -// Use like: -// int x = ...; -// FML_ALLOW_UNUSED_LOCAL(x); -#define FML_ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0 - -// Annotate a typedef or function indicating it's ok if it's not used. -// Use like: -// typedef Foo Bar ALLOW_UNUSED_TYPE; -#if defined(__GNUC__) || defined(__clang__) -#define FML_ALLOW_UNUSED_TYPE __attribute__((unused)) -#else -#define FML_ALLOW_UNUSED_TYPE -#endif - -#endif // FLUTTER_FML_COMPILER_SPECIFIC_H_ diff --git a/engine/src/flutter/fml/platform/darwin/scoped_block.h b/engine/src/flutter/fml/platform/darwin/scoped_block.h index 031266af0d..2e7cc91cc2 100644 --- a/engine/src/flutter/fml/platform/darwin/scoped_block.h +++ b/engine/src/flutter/fml/platform/darwin/scoped_block.h @@ -7,7 +7,6 @@ #include -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/platform/darwin/scoped_typeref.h" #if defined(__has_feature) && __has_feature(objc_arc) diff --git a/engine/src/flutter/fml/platform/darwin/scoped_nsobject.h b/engine/src/flutter/fml/platform/darwin/scoped_nsobject.h index 86dd16481b..b6540c4a94 100644 --- a/engine/src/flutter/fml/platform/darwin/scoped_nsobject.h +++ b/engine/src/flutter/fml/platform/darwin/scoped_nsobject.h @@ -13,7 +13,6 @@ // singled out because it is most typically included from other header files. #import -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" #include "flutter/fml/platform/darwin/scoped_typeref.h" diff --git a/engine/src/flutter/fml/platform/darwin/scoped_typeref.h b/engine/src/flutter/fml/platform/darwin/scoped_typeref.h index e4728d43cd..bed7994487 100644 --- a/engine/src/flutter/fml/platform/darwin/scoped_typeref.h +++ b/engine/src/flutter/fml/platform/darwin/scoped_typeref.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_FML_PLATFORM_DARWIN_SCOPED_TYPEREF_H_ #define FLUTTER_FML_PLATFORM_DARWIN_SCOPED_TYPEREF_H_ -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/platform/darwin/scoped_policy.h" namespace fml { diff --git a/engine/src/flutter/fml/platform/darwin/weak_nsobject.h b/engine/src/flutter/fml/platform/darwin/weak_nsobject.h index cf657d0b5d..92120e18eb 100644 --- a/engine/src/flutter/fml/platform/darwin/weak_nsobject.h +++ b/engine/src/flutter/fml/platform/darwin/weak_nsobject.h @@ -11,7 +11,7 @@ #include #include -#include "flutter/fml/compiler_specific.h" + #include "flutter/fml/logging.h" #include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/memory/ref_ptr.h" diff --git a/engine/src/flutter/fml/synchronization/semaphore.h b/engine/src/flutter/fml/synchronization/semaphore.h index 1207f59a6f..0bb1760286 100644 --- a/engine/src/flutter/fml/synchronization/semaphore.h +++ b/engine/src/flutter/fml/synchronization/semaphore.h @@ -7,7 +7,6 @@ #include -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" namespace fml { diff --git a/engine/src/flutter/fml/unique_object.h b/engine/src/flutter/fml/unique_object.h index 8e119699f5..2e44ecb853 100644 --- a/engine/src/flutter/fml/unique_object.h +++ b/engine/src/flutter/fml/unique_object.h @@ -7,7 +7,6 @@ #include -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/logging.h" #include "flutter/fml/macros.h" diff --git a/engine/src/flutter/impeller/base/base_unittests.cc b/engine/src/flutter/impeller/base/base_unittests.cc index 6a865a9eac..7c2d8365e6 100644 --- a/engine/src/flutter/impeller/base/base_unittests.cc +++ b/engine/src/flutter/impeller/base/base_unittests.cc @@ -59,8 +59,7 @@ TEST(ThreadTest, CanCreateRWMutex) { f.mtx.UnlockWriter(); // int b = f.a; <--- Static analysis error. f.mtx.LockReader(); - int b = f.a; // NOLINT(clang-analyzer-deadcode.DeadStores) - FML_ALLOW_UNUSED_LOCAL(b); + [[maybe_unused]] int b = f.a; // NOLINT(clang-analyzer-deadcode.DeadStores) f.mtx.UnlockReader(); } @@ -76,8 +75,7 @@ TEST(ThreadTest, CanCreateRWMutexLock) { // int b = f.a; <--- Static analysis error. { auto read_lock = ReaderLock(f.mtx); - int b = f.a; // NOLINT(clang-analyzer-deadcode.DeadStores) - FML_ALLOW_UNUSED_LOCAL(b); + [[maybe_unused]] int b = f.a; // NOLINT(clang-analyzer-deadcode.DeadStores) } // f.mtx.UnlockReader(); <--- Static analysis error. diff --git a/engine/src/flutter/runtime/dart_isolate.h b/engine/src/flutter/runtime/dart_isolate.h index e8facb468e..e22a0132c5 100644 --- a/engine/src/flutter/runtime/dart_isolate.h +++ b/engine/src/flutter/runtime/dart_isolate.h @@ -12,7 +12,6 @@ #include #include "flutter/common/task_runners.h" -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" #include "flutter/fml/mapping.h" #include "flutter/lib/ui/io_manager.h" diff --git a/engine/src/flutter/runtime/dart_service_isolate.h b/engine/src/flutter/runtime/dart_service_isolate.h index 5078c28a78..a6fc32d429 100644 --- a/engine/src/flutter/runtime/dart_service_isolate.h +++ b/engine/src/flutter/runtime/dart_service_isolate.h @@ -10,7 +10,6 @@ #include #include -#include "flutter/fml/compiler_specific.h" #include "third_party/dart/runtime/include/dart_api.h" namespace flutter { diff --git a/engine/src/flutter/runtime/dart_vm.cc b/engine/src/flutter/runtime/dart_vm.cc index 955aaefe63..8461bf9e74 100644 --- a/engine/src/flutter/runtime/dart_vm.cc +++ b/engine/src/flutter/runtime/dart_vm.cc @@ -10,7 +10,6 @@ #include #include "flutter/common/settings.h" -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/cpu_affinity.h" #include "flutter/fml/logging.h" #include "flutter/fml/mapping.h" @@ -71,12 +70,12 @@ static const char* kSerialGCArgs[] = { // clang-format on }; -FML_ALLOW_UNUSED_TYPE +[[maybe_unused]] static const char* kDartWriteProtectCodeArgs[] = { "--no_write_protect_code", }; -FML_ALLOW_UNUSED_TYPE +[[maybe_unused]] static const char* kDartDisableIntegerDivisionArgs[] = { "--no_use_integer_division", }; @@ -105,7 +104,7 @@ static std::string DartFileRecorderArgs(const std::string& path) { return oss.str(); } -FML_ALLOW_UNUSED_TYPE +[[maybe_unused]] static const char* kDartDefaultTraceStreamsArgs[]{ "--timeline_streams=Dart,Embedder,GC", }; diff --git a/engine/src/flutter/runtime/service_protocol.h b/engine/src/flutter/runtime/service_protocol.h index e3e9ffae08..4e8ddb467a 100644 --- a/engine/src/flutter/runtime/service_protocol.h +++ b/engine/src/flutter/runtime/service_protocol.h @@ -10,7 +10,6 @@ #include #include -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" #include "flutter/fml/synchronization/atomic_object.h" #include "flutter/fml/synchronization/shared_mutex.h" diff --git a/engine/src/flutter/vulkan/vulkan_backbuffer.cc b/engine/src/flutter/vulkan/vulkan_backbuffer.cc index dc404d4d29..eae1c055d3 100644 --- a/engine/src/flutter/vulkan/vulkan_backbuffer.cc +++ b/engine/src/flutter/vulkan/vulkan_backbuffer.cc @@ -39,7 +39,7 @@ VulkanBackbuffer::VulkanBackbuffer(const VulkanProcTable& p_vk, } VulkanBackbuffer::~VulkanBackbuffer() { - FML_ALLOW_UNUSED_LOCAL(WaitFences()); + [[maybe_unused]] auto result = WaitFences(); } bool VulkanBackbuffer::IsValid() const { diff --git a/engine/src/flutter/vulkan/vulkan_backbuffer.h b/engine/src/flutter/vulkan/vulkan_backbuffer.h index e1585623cf..d27b76a318 100644 --- a/engine/src/flutter/vulkan/vulkan_backbuffer.h +++ b/engine/src/flutter/vulkan/vulkan_backbuffer.h @@ -7,7 +7,6 @@ #include -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" #include "flutter/vulkan/procs/vulkan_handle.h" #include "third_party/skia/include/core/SkSize.h" diff --git a/engine/src/flutter/vulkan/vulkan_command_buffer.h b/engine/src/flutter/vulkan/vulkan_command_buffer.h index b19f485b90..cafe210a09 100644 --- a/engine/src/flutter/vulkan/vulkan_command_buffer.h +++ b/engine/src/flutter/vulkan/vulkan_command_buffer.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_VULKAN_VULKAN_COMMAND_BUFFER_H_ #define FLUTTER_VULKAN_VULKAN_COMMAND_BUFFER_H_ -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" #include "flutter/vulkan/procs/vulkan_handle.h" diff --git a/engine/src/flutter/vulkan/vulkan_debug_report.cc b/engine/src/flutter/vulkan/vulkan_debug_report.cc index 4f18f4a19a..71a18a5bf0 100644 --- a/engine/src/flutter/vulkan/vulkan_debug_report.cc +++ b/engine/src/flutter/vulkan/vulkan_debug_report.cc @@ -8,16 +8,17 @@ #include #include -#include "flutter/fml/compiler_specific.h" #include "vulkan_utilities.h" namespace vulkan { -static const VkDebugReportFlagsEXT kVulkanErrorFlags FML_ALLOW_UNUSED_TYPE = +[[maybe_unused]] +static const VkDebugReportFlagsEXT kVulkanErrorFlags = VK_DEBUG_REPORT_WARNING_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT | VK_DEBUG_REPORT_ERROR_BIT_EXT; -static const VkDebugReportFlagsEXT kVulkanInfoFlags FML_ALLOW_UNUSED_TYPE = +[[maybe_unused]] +static const VkDebugReportFlagsEXT kVulkanInfoFlags = VK_DEBUG_REPORT_INFORMATION_BIT_EXT | VK_DEBUG_REPORT_DEBUG_BIT_EXT; std::string VulkanDebugReport::DebugExtensionName() { diff --git a/engine/src/flutter/vulkan/vulkan_device.cc b/engine/src/flutter/vulkan/vulkan_device.cc index d350438fdf..383778dba6 100644 --- a/engine/src/flutter/vulkan/vulkan_device.cc +++ b/engine/src/flutter/vulkan/vulkan_device.cc @@ -174,7 +174,7 @@ bool VulkanDevice::InitializeCommandPool() { } VulkanDevice::~VulkanDevice() { - FML_ALLOW_UNUSED_LOCAL(WaitIdle()); + [[maybe_unused]] auto result = WaitIdle(); } bool VulkanDevice::IsValid() const { diff --git a/engine/src/flutter/vulkan/vulkan_device.h b/engine/src/flutter/vulkan/vulkan_device.h index 18065a05bc..fb5b157305 100644 --- a/engine/src/flutter/vulkan/vulkan_device.h +++ b/engine/src/flutter/vulkan/vulkan_device.h @@ -7,7 +7,6 @@ #include -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" #include "flutter/vulkan/procs/vulkan_handle.h" diff --git a/engine/src/flutter/vulkan/vulkan_image.h b/engine/src/flutter/vulkan/vulkan_image.h index 21d4997018..93087e47ab 100644 --- a/engine/src/flutter/vulkan/vulkan_image.h +++ b/engine/src/flutter/vulkan/vulkan_image.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_VULKAN_VULKAN_IMAGE_H_ #define FLUTTER_VULKAN_VULKAN_IMAGE_H_ -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" #include "flutter/vulkan/procs/vulkan_handle.h" diff --git a/engine/src/flutter/vulkan/vulkan_swapchain.cc b/engine/src/flutter/vulkan/vulkan_swapchain.cc index 20e32121c3..08627fff4c 100644 --- a/engine/src/flutter/vulkan/vulkan_swapchain.cc +++ b/engine/src/flutter/vulkan/vulkan_swapchain.cc @@ -155,7 +155,7 @@ VulkanSwapchain::VulkanSwapchain(const VulkanProcTable& p_vk, swapchain_ = VulkanHandle{ swapchain, [this](VkSwapchainKHR swapchain) { - FML_ALLOW_UNUSED_LOCAL(device_.WaitIdle()); + [[maybe_unused]] auto result = device_.WaitIdle(); vk.DestroySwapchainKHR(device_.GetHandle(), swapchain, nullptr); }}; diff --git a/engine/src/flutter/vulkan/vulkan_swapchain.h b/engine/src/flutter/vulkan/vulkan_swapchain.h index 5a16747665..4d832c9b01 100644 --- a/engine/src/flutter/vulkan/vulkan_swapchain.h +++ b/engine/src/flutter/vulkan/vulkan_swapchain.h @@ -9,7 +9,6 @@ #include #include -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" #include "flutter/vulkan/procs/vulkan_handle.h" #include "third_party/skia/include/core/SkSize.h" diff --git a/engine/src/flutter/vulkan/vulkan_window.h b/engine/src/flutter/vulkan/vulkan_window.h index 7495af323d..d4d3c9cecd 100644 --- a/engine/src/flutter/vulkan/vulkan_window.h +++ b/engine/src/flutter/vulkan/vulkan_window.h @@ -10,7 +10,6 @@ #include #include -#include "flutter/fml/compiler_specific.h" #include "flutter/fml/macros.h" #include "flutter/vulkan/procs/vulkan_proc_table.h" #include "third_party/skia/include/core/SkRefCnt.h"