-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AST] Include clang/Basic/DiagnosticComment.h instead of clang/AST/CommentDiagnostic.h #117499
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
[AST] Include clang/Basic/DiagnosticComment.h instead of clang/AST/CommentDiagnostic.h #117499
Conversation
Since: commit d076608 Author: Richard Trieu <[email protected]> Date: Sat Dec 8 05:05:03 2018 +0000 clang/AST/CommentDiagnostic.h has been forwarding to clang/Basic/DiagnosticParse.h. This patch removes the indirection and clang/AST/CommentDiagnostic.h.
@llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) ChangesSince: commit d076608 clang/AST/CommentDiagnostic.h has been forwarding to Full diff: https://github.com/llvm/llvm-project/pull/117499.diff 6 Files Affected:
diff --git a/clang/include/clang/AST/CommentDiagnostic.h b/clang/include/clang/AST/CommentDiagnostic.h
deleted file mode 100644
index 2e498d5db38648..00000000000000
--- a/clang/include/clang/AST/CommentDiagnostic.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//===--- CommentDiagnostic.h - Diagnostics for the AST library --*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_AST_COMMENTDIAGNOSTIC_H
-#define LLVM_CLANG_AST_COMMENTDIAGNOSTIC_H
-
-#include "clang/Basic/DiagnosticComment.h"
-
-#endif
-
diff --git a/clang/include/module.modulemap b/clang/include/module.modulemap
index b399f0beee59a1..56b0409e74a150 100644
--- a/clang/include/module.modulemap
+++ b/clang/include/module.modulemap
@@ -111,7 +111,6 @@ module Clang_Diagnostics {
module All { header "clang/Basic/AllDiagnostics.h" export * }
module Analysis { textual header "clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def" }
module AST { header "clang/AST/ASTDiagnostic.h" export * }
- module Comment { header "clang/AST/CommentDiagnostic.h" export * }
module Driver { header "clang/Driver/DriverDiagnostic.h" export * }
module Frontend { header "clang/Frontend/FrontendDiagnostic.h" export * }
module Lex { header "clang/Lex/LexDiagnostic.h" export * }
diff --git a/clang/lib/AST/CommentLexer.cpp b/clang/lib/AST/CommentLexer.cpp
index f0250fc9fd55eb..ec9a5b480aa295 100644
--- a/clang/lib/AST/CommentLexer.cpp
+++ b/clang/lib/AST/CommentLexer.cpp
@@ -8,8 +8,8 @@
#include "clang/AST/CommentLexer.h"
#include "clang/AST/CommentCommandTraits.h"
-#include "clang/AST/CommentDiagnostic.h"
#include "clang/Basic/CharInfo.h"
+#include "clang/Basic/DiagnosticComment.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/ConvertUTF.h"
diff --git a/clang/lib/AST/CommentParser.cpp b/clang/lib/AST/CommentParser.cpp
index 61508fe886efc0..12ed8e3f1b79a0 100644
--- a/clang/lib/AST/CommentParser.cpp
+++ b/clang/lib/AST/CommentParser.cpp
@@ -8,9 +8,9 @@
#include "clang/AST/CommentParser.h"
#include "clang/AST/CommentCommandTraits.h"
-#include "clang/AST/CommentDiagnostic.h"
#include "clang/AST/CommentSema.h"
#include "clang/Basic/CharInfo.h"
+#include "clang/Basic/DiagnosticComment.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/Support/ErrorHandling.h"
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp
index 69eda00643a8fa..bd2206bb8a3bc7 100644
--- a/clang/lib/AST/CommentSema.cpp
+++ b/clang/lib/AST/CommentSema.cpp
@@ -9,9 +9,9 @@
#include "clang/AST/CommentSema.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CommentCommandTraits.h"
-#include "clang/AST/CommentDiagnostic.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclTemplate.h"
+#include "clang/Basic/DiagnosticComment.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Preprocessor.h"
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 74b0e5ad23bd48..1e9db39a7fb579 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -16,7 +16,6 @@
#include "clang/AST/ASTLambda.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/CharUnits.h"
-#include "clang/AST/CommentDiagnostic.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
@@ -30,6 +29,7 @@
#include "clang/AST/StmtCXX.h"
#include "clang/AST/Type.h"
#include "clang/Basic/Builtins.h"
+#include "clang/Basic/DiagnosticComment.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we can remove this header at this point.
I do have a question about the modulemap though.
clang/include/module.modulemap
Outdated
@@ -111,7 +111,6 @@ module Clang_Diagnostics { | |||
module All { header "clang/Basic/AllDiagnostics.h" export * } | |||
module Analysis { textual header "clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def" } | |||
module AST { header "clang/AST/ASTDiagnostic.h" export * } | |||
module Comment { header "clang/AST/CommentDiagnostic.h" export * } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to replace this with a reference to DiagnosticComment.h
instead of removing it entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing no, but I admit I am no modulemap expert though.
module.modulemap
says:
module Clang_Diagnostics {
requires cplusplus
module All { header "clang/Basic/AllDiagnostics.h" export * }
Now, AllDiagnostics.h
includes clang/Basic/DiagnosticComment.h
, so module All
above seems to imply DiagnosticComment.h
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo the module question.
@Weverything :) |
I'm going to go conservative for now by including |
I support getting rid of the Diagnostic.h files outside of the Basic directory, at least when they are just forwarding headers. From a layering point of view, Clang_Diagnostics should be the same level as Basic so it shouldn't be having things from AST. Removing the forwarding headers will help clean up the layering. |
Since:
commit d076608
Author: Richard Trieu [email protected]
Date: Sat Dec 8 05:05:03 2018 +0000
clang/AST/CommentDiagnostic.h has been forwarding to
clang/Basic/DiagnosticComment.h. This patch includes
clang/Basic/DiagnosticComment.h instead of
clang/AST/CommentDiagnostic.h.