aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/CodeGen/MachineInstrTest.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2024-09-21 10:59:50 +0100
committerGitHub <noreply@github.com>2024-09-21 10:59:50 +0100
commiteb6e7e8f89a3d5c1cbc9856774ca00208753fb12 (patch)
treed5f14de42a6c90f29d33430c76921c1a17636d41 /llvm/unittests/CodeGen/MachineInstrTest.cpp
parentfc5de0af33b7fb9b9f745e70dcd351f2de4211cb (diff)
downloadllvm-eb6e7e8f89a3d5c1cbc9856774ca00208753fb12.zip
llvm-eb6e7e8f89a3d5c1cbc9856774ca00208753fb12.tar.gz
llvm-eb6e7e8f89a3d5c1cbc9856774ca00208753fb12.tar.bz2
[unittests] Use {} instead of std::nullopt to initialize empty ArrayRef (#109388)
Follow up to #109133.
Diffstat (limited to 'llvm/unittests/CodeGen/MachineInstrTest.cpp')
-rw-r--r--llvm/unittests/CodeGen/MachineInstrTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/unittests/CodeGen/MachineInstrTest.cpp b/llvm/unittests/CodeGen/MachineInstrTest.cpp
index d1546cf..a3856f4 100644
--- a/llvm/unittests/CodeGen/MachineInstrTest.cpp
+++ b/llvm/unittests/CodeGen/MachineInstrTest.cpp
@@ -276,8 +276,8 @@ TEST(MachineInstrExtraInfo, AddExtraInfo) {
MMOs.push_back(MMO);
MCSymbol *Sym1 = MC->createTempSymbol("pre_label", false);
MCSymbol *Sym2 = MC->createTempSymbol("post_label", false);
- MDNode *HAM = MDNode::getDistinct(Ctx, std::nullopt);
- MDNode *PCS = MDNode::getDistinct(Ctx, std::nullopt);
+ MDNode *HAM = MDNode::getDistinct(Ctx, {});
+ MDNode *PCS = MDNode::getDistinct(Ctx, {});
MDNode *MMRA = MMRAMetadata::getTagMD(Ctx, "foo", "bar");
ASSERT_TRUE(MI->memoperands_empty());
@@ -357,8 +357,8 @@ TEST(MachineInstrExtraInfo, ChangeExtraInfo) {
MMOs.push_back(MMO);
MCSymbol *Sym1 = MC->createTempSymbol("pre_label", false);
MCSymbol *Sym2 = MC->createTempSymbol("post_label", false);
- MDNode *HAM = MDNode::getDistinct(Ctx, std::nullopt);
- MDNode *PCS = MDNode::getDistinct(Ctx, std::nullopt);
+ MDNode *HAM = MDNode::getDistinct(Ctx, {});
+ MDNode *PCS = MDNode::getDistinct(Ctx, {});
MDNode *MMRA1 = MMRAMetadata::getTagMD(Ctx, "foo", "bar");
MDNode *MMRA2 = MMRAMetadata::getTagMD(Ctx, "bar", "bux");
@@ -413,8 +413,8 @@ TEST(MachineInstrExtraInfo, RemoveExtraInfo) {
MMOs.push_back(MMO);
MCSymbol *Sym1 = MC->createTempSymbol("pre_label", false);
MCSymbol *Sym2 = MC->createTempSymbol("post_label", false);
- MDNode *HAM = MDNode::getDistinct(Ctx, std::nullopt);
- MDNode *PCS = MDNode::getDistinct(Ctx, std::nullopt);
+ MDNode *HAM = MDNode::getDistinct(Ctx, {});
+ MDNode *PCS = MDNode::getDistinct(Ctx, {});
MDNode *MMRA = MDTuple::get(Ctx, {});
@@ -506,8 +506,8 @@ MATCHER_P(HasMIMetadata, MIMD, "") {
TEST(MachineInstrBuilder, BuildMI) {
LLVMContext Ctx;
- MDNode *PCS = MDNode::getDistinct(Ctx, std::nullopt);
- MDNode *DI = MDNode::getDistinct(Ctx, std::nullopt);
+ MDNode *PCS = MDNode::getDistinct(Ctx, {});
+ MDNode *DI = MDNode::getDistinct(Ctx, {});
DebugLoc DL(DI);
MIMetadata MIMD(DL, PCS);
EXPECT_EQ(MIMD.getDL(), DL);