Skip to content

Commit

Permalink
Fix IWYU inclusion of <atomic> when TRACE_EVENT is used.
Browse files Browse the repository at this point in the history
The TRACE_EVENT macros use std::atomic, but TraceEvent.h already
includes <atomic> alongside the macros themselves. IWYU just can't
see through the preprocessor.

Change-Id: I6060dad2e25f3a7e30c63c2e6c4488545dcf9f96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/793318
Auto-Submit: John Stiles <[email protected]>
Commit-Queue: John Stiles <[email protected]>
Reviewed-by: Brian Osman <[email protected]>
  • Loading branch information
johnstiles-google committed Dec 21, 2023
1 parent 4b16117 commit a9db121
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion gm/gm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "include/gpu/GrRecordingContext.h"
#endif

#include <atomic>
#include <cstdarg>
#include <cstdint>

Expand Down
1 change: 0 additions & 1 deletion src/core/SkCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
#include "src/utils/SkPatchUtils.h"

#include <algorithm>
#include <atomic>
#include <memory>
#include <new>
#include <optional>
Expand Down
1 change: 0 additions & 1 deletion src/gpu/ganesh/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
#include "src/text/gpu/SlugImpl.h"
#include "src/text/gpu/SubRunContainer.h"

#include <atomic>
#include <cstddef>
#include <cstdint>
#include <functional>
Expand Down
1 change: 0 additions & 1 deletion src/gpu/ganesh/GrBlurUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@

#include <algorithm>
#include <array>
#include <atomic>
#include <cmath>
#include <cstdint>
#include <cstring>
Expand Down
1 change: 0 additions & 1 deletion src/gpu/ganesh/gl/GrGLGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
#include "src/sksl/ir/SkSLProgram.h"

#include <algorithm>
#include <atomic>
#include <cmath>
#include <functional>
#include <memory>
Expand Down
1 change: 1 addition & 0 deletions src/gpu/graphite/vk/VulkanGraphiteUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "src/gpu/graphite/vk/VulkanQueueManager.h"
#include "src/gpu/graphite/vk/VulkanSharedContext.h"
#include "src/sksl/SkSLProgramSettings.h"

namespace skgpu::graphite::ContextFactory {

std::unique_ptr<Context> MakeVulkan(const VulkanBackendContext& backendContext,
Expand Down
1 change: 0 additions & 1 deletion src/sksl/SkSLCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "src/sksl/ir/SkSLSymbolTable.h" // IWYU pragma: keep
#include "src/sksl/transform/SkSLTransform.h"

#include <atomic>
#include <cstdint>
#include <memory>
#include <utility>
Expand Down
1 change: 0 additions & 1 deletion src/text/gpu/SkChromeRemoteGlyphCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#include "src/text/gpu/SubRunContainer.h"
#include "src/text/gpu/TextBlob.h"

#include <atomic>
#include <cstring>
#include <memory>
#include <optional>
Expand Down
1 change: 0 additions & 1 deletion tests/TracingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "tests/Test.h"
#include "tools/flags/CommandLineFlags.h"

#include <atomic>
#include <cstdint>

static DEFINE_bool(slowTracingTest, false,
Expand Down
5 changes: 5 additions & 0 deletions toolchain/linux_trampolines/IWYU_mapping.imp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,11 @@

{ symbol: ["SkScalar", "private", "\"include/core/SkScalar.h\"", "public"] },

# The TRACE_EVENT macros use std::atomic, but TraceEvent.h already includes <atomic> alongside
# the macros themselves; IWYU just can't see through the preprocessor.
{ symbol: ["std::atomic", "private", "<atomic>", "public"] },
{ symbol: ["std::atomic", "private", "\"src/core/SkTraceEvent.h\"", "public"] },

# IWYU seems to get confused on where the namespace sktext is "defined". Any files in
# this list are ok.
{ symbol: ["sktext", "private", "\"src/text/StrikeForGPU.h\"", "public"] },
Expand Down

0 comments on commit a9db121

Please sign in to comment.