Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

Note that createNullStreamer is declared also in
llvm/include/llvm/MC/MCStreamer.h.

Identified with readability-redundant-declaration.

Note that createNullStreamer is declared also in
llvm/include/llvm/MC/MCStreamer.h.

Identified with readability-redundant-declaration.
@llvmbot llvmbot added the llvm:mc Machine (object) code label Nov 1, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 1, 2025

@llvm/pr-subscribers-llvm-mc

Author: Kazu Hirata (kazutakahirata)

Changes

Note that createNullStreamer is declared also in
llvm/include/llvm/MC/MCStreamer.h.

Identified with readability-redundant-declaration.


Full diff: https://github.com/llvm/llvm-project/pull/166025.diff

1 Files Affected:

  • (modified) llvm/include/llvm/MC/TargetRegistry.h (+1-2)
diff --git a/llvm/include/llvm/MC/TargetRegistry.h b/llvm/include/llvm/MC/TargetRegistry.h
index 234c587c8e951..97c0f03c987e7 100644
--- a/llvm/include/llvm/MC/TargetRegistry.h
+++ b/llvm/include/llvm/MC/TargetRegistry.h
@@ -22,6 +22,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/MC/MCObjectFileInfo.h"
+#include "llvm/MC/MCStreamer.h"
 #include "llvm/Support/CodeGen.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
@@ -49,7 +50,6 @@ class MCInstrInfo;
 class MCObjectWriter;
 class MCRegisterInfo;
 class MCRelocationInfo;
-class MCStreamer;
 class MCSubtargetInfo;
 class MCSymbolizer;
 class MCTargetAsmParser;
@@ -65,7 +65,6 @@ class InstrumentManager;
 struct SourceMgr;
 } // namespace mca
 
-LLVM_ABI MCStreamer *createNullStreamer(MCContext &Ctx);
 // Takes ownership of \p TAB and \p CE.
 
 /// Create a machine code streamer which will print out assembly for the native

Copy link
Contributor

@shiltian shiltian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I think this is just a forward declaration such that the header doesn't need to be included. Not sure how this will help.

@kazutakahirata
Copy link
Contributor Author

Well, I think this is just a forward declaration such that the header doesn't need to be included. Not sure how this will help.

To be honest, I was a little bit on the fence. We do have a policy for forward declarations of classes and structs, but I wasn't sure about forward declarations of functions. I'm closing this PR. Thanks for the review anyway!

@kazutakahirata kazutakahirata deleted the cleanup_20251101a_clang_tidy_readability-redundant-declaration_createNullStreamer branch November 2, 2025 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:mc Machine (object) code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants