[clang] [AST] Remove clang/AST/CommentDiagnostic.h (PR #117499)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 22:32:17 PST 2024


https://github.com/kazutakahirata updated https://github.com/llvm/llvm-project/pull/117499

>From e9427756de508dc386a10ee9ee19cc4733a40465 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 24 Nov 2024 09:14:54 -0800
Subject: [PATCH 1/2] [AST] Remove clang/AST/CommentDiagnostic.h

Since:

  commit d076608d58d1ec55016eb747a995511e3a3f72aa
  Author: Richard Trieu <rtrieu at google.com>
  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.
---
 clang/include/clang/AST/CommentDiagnostic.h | 15 ---------------
 clang/include/module.modulemap              |  1 -
 clang/lib/AST/CommentLexer.cpp              |  2 +-
 clang/lib/AST/CommentParser.cpp             |  2 +-
 clang/lib/AST/CommentSema.cpp               |  2 +-
 clang/lib/Sema/SemaDecl.cpp                 |  2 +-
 6 files changed, 4 insertions(+), 20 deletions(-)
 delete mode 100644 clang/include/clang/AST/CommentDiagnostic.h

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"

>From 9eb476000d84b87d036a14d56d9fe865f843ef18 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 5 Dec 2024 22:29:50 -0800
Subject: [PATCH 2/2] Restore CommentDiagnostic.h and module.modulemap.

---
 clang/include/clang/AST/CommentDiagnostic.h | 15 +++++++++++++++
 clang/include/module.modulemap              |  1 +
 2 files changed, 16 insertions(+)
 create mode 100644 clang/include/clang/AST/CommentDiagnostic.h

diff --git a/clang/include/clang/AST/CommentDiagnostic.h b/clang/include/clang/AST/CommentDiagnostic.h
new file mode 100644
index 00000000000000..2e498d5db38648
--- /dev/null
+++ b/clang/include/clang/AST/CommentDiagnostic.h
@@ -0,0 +1,15 @@
+//===--- 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 56b0409e74a150..b399f0beee59a1 100644
--- a/clang/include/module.modulemap
+++ b/clang/include/module.modulemap
@@ -111,6 +111,7 @@ 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 * }



More information about the cfe-commits mailing list