[clang] 7760971 - Forward-declare raw_ostream (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 4 21:43:19 PST 2022


Author: Kazu Hirata
Date: 2022-12-04T21:43:10-08:00
New Revision: 77609717410372e8c43aca49a268511378f58297

URL: https://github.com/llvm/llvm-project/commit/77609717410372e8c43aca49a268511378f58297
DIFF: https://github.com/llvm/llvm-project/commit/77609717410372e8c43aca49a268511378f58297.diff

LOG: Forward-declare raw_ostream (NFC)

This patch adds forward declarations of raw_ostream to those header
files that are relying on the forward declaration of raw_ostream in
llvm/include/llvm/ADT/Optional.h.

I'm planning to move operator<< for Optional<T> and std::optional<T>
from Optional.h to llvm/include/llvm/Support/raw_ostream.h.  Once I do
so, we no longer need to forward-declare raw_ostream in Optional.h.

Added: 
    

Modified: 
    clang/include/clang/APINotes/Types.h
    lldb/include/lldb/Utility/UriParser.h
    llvm/include/llvm/IR/Attributes.h
    llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h
index eb27ffccc17f..8dfc3bf4f1e5 100644
--- a/clang/include/clang/APINotes/Types.h
+++ b/clang/include/clang/APINotes/Types.h
@@ -15,6 +15,10 @@
 #include <climits>
 #include <vector>
 
+namespace llvm {
+class raw_ostream;
+} // namespace llvm
+
 namespace clang {
 namespace api_notes {
 enum class RetainCountConventionKind {

diff  --git a/lldb/include/lldb/Utility/UriParser.h b/lldb/include/lldb/Utility/UriParser.h
index 3c0f8d2273d0..035e44d6a23c 100644
--- a/lldb/include/lldb/Utility/UriParser.h
+++ b/lldb/include/lldb/Utility/UriParser.h
@@ -12,6 +12,10 @@
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 
+namespace llvm {
+class raw_ostream;
+} // namespace llvm
+
 namespace lldb_private {
 
 struct URI {

diff  --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index cb7900343d67..c4e12a673ed2 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -44,6 +44,7 @@ class Function;
 class LLVMContext;
 class MemoryEffects;
 class Type;
+class raw_ostream;
 
 enum class AllocFnKind : uint64_t {
   Unknown = 0,

diff  --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
index 3b4ff548360f..90c771513a61 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
@@ -31,6 +31,7 @@ class MCRegisterInfo;
 class MCSubtargetInfo;
 class StringRef;
 class Triple;
+class raw_ostream;
 
 namespace amdhsa {
 struct kernel_descriptor_t;


        


More information about the cfe-commits mailing list