https://github.com/rupprecht created 
https://github.com/llvm/llvm-project/pull/162865

#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, d076608d58d1ec55016eb747a995511e3a3f72aa 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.

>From 76775e5a4a86edac1fb5bc58d25a6806bd58487f Mon Sep 17 00:00:00 2001
From: Jordan Rupprecht <[email protected]>
Date: Fri, 10 Oct 2025 08:11:40 -0700
Subject: [PATCH] [AMDGPU][NFC] Fix clang frontend<->sema layering issue

---
 clang/lib/Sema/SemaAMDGPU.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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"

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to