[llvm] 4a17964 - Hexagon: Register null TargetStreamer
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 31 20:08:25 PDT 2022
Author: Matt Arsenault
Date: 2022-10-31T18:32:41-07:00
New Revision: 4a179646addabd6fa27ffefbbffed0f08c973d68
URL: https://github.com/llvm/llvm-project/commit/4a179646addabd6fa27ffefbbffed0f08c973d68
DIFF: https://github.com/llvm/llvm-project/commit/4a179646addabd6fa27ffefbbffed0f08c973d68.diff
LOG: Hexagon: Register null TargetStreamer
Unlike just about every target, I don't
see an obvious null dereference this fixes.
Added:
Modified:
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
index b2eb968714e63..3fd69a1b97602 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
@@ -346,6 +346,10 @@ createHexagonObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI) {
return new HexagonTargetELFStreamer(S, STI);
}
+static MCTargetStreamer *createHexagonNullTargetStreamer(MCStreamer &S) {
+ return new HexagonTargetStreamer(S);
+}
+
static void LLVM_ATTRIBUTE_UNUSED clearFeature(MCSubtargetInfo* STI, uint64_t F) {
if (STI->getFeatureBits()[F])
STI->ToggleFeature(F);
@@ -660,6 +664,10 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeHexagonTargetMC() {
TargetRegistry::RegisterAsmTargetStreamer(getTheHexagonTarget(),
createMCAsmTargetStreamer);
+ // Register the null streamer
+ TargetRegistry::RegisterNullTargetStreamer(getTheHexagonTarget(),
+ createHexagonNullTargetStreamer);
+
// Register the MC Inst Printer
TargetRegistry::RegisterMCInstPrinter(getTheHexagonTarget(),
createHexagonMCInstPrinter);
More information about the llvm-commits
mailing list