[llvm] [AArch64] Use nullptr instead of NULL (NFC) (PR #166083)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 2 13:24:33 PST 2025


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

>From ebbee69951161af208389d4c249e9858e916ea98 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 2 Nov 2025 10:44:29 -0800
Subject: [PATCH 1/2] [AArch64] Use nullptr instead of NULL (NFC)

Identified with modernize-use-nullptr.
---
 llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp b/llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp
index 4dfc0bcb0dc4c..08e3f05123db7 100644
--- a/llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp
+++ b/llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp
@@ -37,9 +37,9 @@ static std::string AArch64InstPrinterTestPrintAlignedLabel(uint64_t value) {
   MCInstrInfo MII;
   MCRegisterInfo MRI;
   MCSubtargetInfo STI(Triple(""), "", "", "", {},
-                      ArrayRef((SubtargetFeatureKV *)NULL, (size_t)0),
-                      ArrayRef((SubtargetSubTypeKV *)NULL, (size_t)0), NULL,
-                      NULL, NULL, NULL, NULL, NULL);
+                      ArrayRef((SubtargetFeatureKV *)nullptr, (size_t)0),
+                      ArrayRef((SubtargetSubTypeKV *)nullptr, (size_t)0),
+                      nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
   MCContext Ctx(Triple(""), &MAI, &MRI, &STI);
   MCInst MI;
 

>From 0ab6817e5bd9d385d7a2f087bbd329804bdeaca1 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 2 Nov 2025 13:22:46 -0800
Subject: [PATCH 2/2] Address a comment.

---
 llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp b/llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp
index 08e3f05123db7..a835a34fea58b 100644
--- a/llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp
+++ b/llvm/unittests/Target/AArch64/AArch64InstPrinterTest.cpp
@@ -36,10 +36,8 @@ static std::string AArch64InstPrinterTestPrintAlignedLabel(uint64_t value) {
   MCAsmInfo MAI;
   MCInstrInfo MII;
   MCRegisterInfo MRI;
-  MCSubtargetInfo STI(Triple(""), "", "", "", {},
-                      ArrayRef((SubtargetFeatureKV *)nullptr, (size_t)0),
-                      ArrayRef((SubtargetSubTypeKV *)nullptr, (size_t)0),
-                      nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
+  MCSubtargetInfo STI(Triple(""), "", "", "", {}, {}, {}, nullptr, nullptr,
+                      nullptr, nullptr, nullptr, nullptr);
   MCContext Ctx(Triple(""), &MAI, &MRI, &STI);
   MCInst MI;
 



More information about the llvm-commits mailing list