From 606fed88456edea4067573c91ca9ca030016381b Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 28 Jan 2021 22:21:12 -0800 Subject: [PATCH] [llvm] Forward-declare formatted_raw_ostream (NFC) Various *TargetStreamer.h need formatted_raw_ostream but rely on a forward declaration of formatted_raw_ostream in MCStreamer.h. This patch adds forward declarations right in *TargetStreamer.h. While we are at it, this patch removes the one in MCStreamer.h, where it is unnecessary. --- include/llvm/MC/MCStreamer.h | 1 - lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h | 1 + lib/Target/Mips/MipsTargetStreamer.h | 2 ++ lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h | 2 ++ lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.h | 3 +++ .../WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h | 1 + 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index cdc728f7377..94fb2c828ac 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -39,7 +39,6 @@ namespace llvm { class AssemblerConstantPools; -class formatted_raw_ostream; class MCAsmBackend; class MCCodeEmitter; class MCContext; diff --git a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h index 1ad64532931..4dbb37dca9e 100644 --- a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h +++ b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h @@ -23,6 +23,7 @@ class MCSymbol; class MDNode; class Module; class Type; +class formatted_raw_ostream; namespace AMDGPU { namespace HSAMD { diff --git a/lib/Target/Mips/MipsTargetStreamer.h b/lib/Target/Mips/MipsTargetStreamer.h index f4282f5d697..44615b987e3 100644 --- a/lib/Target/Mips/MipsTargetStreamer.h +++ b/lib/Target/Mips/MipsTargetStreamer.h @@ -19,6 +19,8 @@ namespace llvm { +class formatted_raw_ostream; + class MipsTargetStreamer : public MCTargetStreamer { public: MipsTargetStreamer(MCStreamer &S); diff --git a/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h b/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h index 32fa20f25d8..0bda3de0ce5 100644 --- a/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h +++ b/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h @@ -14,6 +14,8 @@ namespace llvm { +class formatted_raw_ostream; + class RISCVTargetStreamer : public MCTargetStreamer { public: RISCVTargetStreamer(MCStreamer &S); diff --git a/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.h b/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.h index 9f729a6c2cf..27976d16606 100644 --- a/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.h +++ b/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.h @@ -13,6 +13,9 @@ #include "llvm/MC/MCStreamer.h" namespace llvm { + +class formatted_raw_ostream; + class SparcTargetStreamer : public MCTargetStreamer { virtual void anchor(); diff --git a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h index 75c9fb4e289..80a8c8110fd 100644 --- a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h +++ b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h @@ -22,6 +22,7 @@ namespace llvm { class MCSymbolWasm; +class formatted_raw_ostream; /// WebAssembly-specific streamer interface, to implement support /// WebAssembly-specific assembly directives.