Skip to content

Conversation

@rupprecht
Copy link
Collaborator

#140210 added #include "clang/Frontend/FrontendDiagnostic.h" to clang/lib/Sema/SemaAMDGPU.cpp, but Frontend itself has a dependency on Sema. This creates a layering issue as described in https://llvm.org/docs/CodingStandards.html#library-layering.

Fortunately, d076608 made this easy to fix, as clang/Frontend/FrontendDiagnostic.h just forwards to clang/Basic/DiagnosticFrontend.h, so it's trivial to make this depend on basic instead of frontend.

@rupprecht rupprecht added the skip-precommit-approval PR for CI feedback, not intended for review label Oct 10, 2025
@llvmbot llvmbot added clang Clang issues not falling into any other category backend:AMDGPU clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Oct 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 10, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-backend-amdgpu

Author: Jordan Rupprecht (rupprecht)

Changes

#140210 added #include "clang/Frontend/FrontendDiagnostic.h" to clang/lib/Sema/SemaAMDGPU.cpp, but Frontend itself has a dependency on Sema. This creates a layering issue as described in https://llvm.org/docs/CodingStandards.html#library-layering.

Fortunately, d076608 made this easy to fix, as clang/Frontend/FrontendDiagnostic.h just forwards to clang/Basic/DiagnosticFrontend.h, so it's trivial to make this depend on basic instead of frontend.


Full diff: https://github.com/llvm/llvm-project/pull/162865.diff

1 Files Affected:

  • (modified) clang/lib/Sema/SemaAMDGPU.cpp (+1-1)
diff --git a/clang/lib/Sema/SemaAMDGPU.cpp b/clang/lib/Sema/SemaAMDGPU.cpp
index 45fe80de53fbc..e32f4376a5ebf 100644
--- a/clang/lib/Sema/SemaAMDGPU.cpp
+++ b/clang/lib/Sema/SemaAMDGPU.cpp
@@ -11,9 +11,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/Sema/SemaAMDGPU.h"
+#include "clang/Basic/DiagnosticFrontend.h"
 #include "clang/Basic/DiagnosticSema.h"
 #include "clang/Basic/TargetBuiltins.h"
-#include "clang/Frontend/FrontendDiagnostic.h"
 #include "clang/Sema/Ownership.h"
 #include "clang/Sema/Sema.h"
 #include "llvm/Support/AMDGPUAddrSpace.h"

@rupprecht rupprecht enabled auto-merge (squash) October 10, 2025 15:20
@rupprecht rupprecht merged commit 5391c68 into llvm:main Oct 10, 2025
14 of 15 checks passed
@rupprecht rupprecht deleted the amdgpu-layering branch October 10, 2025 15:44
rupprecht added a commit to rupprecht/llvm-project that referenced this pull request Oct 10, 2025
…Frontend.h

d076608 moved some deps around to avoid cycles and left clang/Frontend/FrontendDiagnostic.h as a shim that simply includes clang/Basic/DiagnosticFrontend.h. This PR inlines it so that nothing in tree still includes clang/Frontend/FrontendDiagnostic.h.

Doing this will help prevent future layering issues. See llvm#162865.
DharuniRAcharya pushed a commit to DharuniRAcharya/llvm-project that referenced this pull request Oct 13, 2025
llvm#140210 added `#include "clang/Frontend/FrontendDiagnostic.h"` to
clang/lib/Sema/SemaAMDGPU.cpp, but Frontend itself has a dependency on
Sema. This creates a layering issue as described in
https://llvm.org/docs/CodingStandards.html#library-layering.

Fortunately, d076608 made this easy to
fix, as clang/Frontend/FrontendDiagnostic.h just forwards to
clang/Basic/DiagnosticFrontend.h, so it's trivial to make this depend on
basic instead of frontend.
akadutta pushed a commit to akadutta/llvm-project that referenced this pull request Oct 14, 2025
llvm#140210 added `#include "clang/Frontend/FrontendDiagnostic.h"` to
clang/lib/Sema/SemaAMDGPU.cpp, but Frontend itself has a dependency on
Sema. This creates a layering issue as described in
https://llvm.org/docs/CodingStandards.html#library-layering.

Fortunately, d076608 made this easy to
fix, as clang/Frontend/FrontendDiagnostic.h just forwards to
clang/Basic/DiagnosticFrontend.h, so it's trivial to make this depend on
basic instead of frontend.
rupprecht added a commit to rupprecht/llvm-project that referenced this pull request Nov 20, 2025
…Frontend.h

d076608 moved some deps around to avoid cycles and left clang/Frontend/FrontendDiagnostic.h as a shim that simply includes clang/Basic/DiagnosticFrontend.h. This PR inlines it so that nothing in tree still includes clang/Frontend/FrontendDiagnostic.h.

Doing this will help prevent future layering issues. See llvm#162865.
rupprecht added a commit that referenced this pull request Nov 21, 2025
…Frontend.h (#162883)

d076608 moved some deps around to avoid
cycles and left clang/Frontend/FrontendDiagnostic.h as a shim that
simply includes clang/Basic/DiagnosticFrontend.h. This PR inlines it so
that nothing in tree still includes clang/Frontend/FrontendDiagnostic.h.

Doing this will help prevent future layering issues. See #162865.

Frontend already depends on Basic, so no new deps need to be added
anywhere except for places that do strict dep checking.
aadeshps-mcw pushed a commit to aadeshps-mcw/llvm-project that referenced this pull request Nov 26, 2025
…Frontend.h (llvm#162883)

d076608 moved some deps around to avoid
cycles and left clang/Frontend/FrontendDiagnostic.h as a shim that
simply includes clang/Basic/DiagnosticFrontend.h. This PR inlines it so
that nothing in tree still includes clang/Frontend/FrontendDiagnostic.h.

Doing this will help prevent future layering issues. See llvm#162865.

Frontend already depends on Basic, so no new deps need to be added
anywhere except for places that do strict dep checking.
Priyanshu3820 pushed a commit to Priyanshu3820/llvm-project that referenced this pull request Nov 26, 2025
…Frontend.h (llvm#162883)

d076608 moved some deps around to avoid
cycles and left clang/Frontend/FrontendDiagnostic.h as a shim that
simply includes clang/Basic/DiagnosticFrontend.h. This PR inlines it so
that nothing in tree still includes clang/Frontend/FrontendDiagnostic.h.

Doing this will help prevent future layering issues. See llvm#162865.

Frontend already depends on Basic, so no new deps need to be added
anywhere except for places that do strict dep checking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:AMDGPU clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category skip-precommit-approval PR for CI feedback, not intended for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants