-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AMDGPU][NFC] Fix clang frontend<->sema layering issue #162865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-clang @llvm/pr-subscribers-backend-amdgpu Author: Jordan Rupprecht (rupprecht) Changes#140210 added 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:
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"
|
…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.
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.
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.
…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.
…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.
…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.
…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.
#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.