@@ -438,7 +438,7 @@ TEST_F(IRBuilderTest, ConstrainedFPFunctionCall) {
438
438
// Now call the empty constrained FP function.
439
439
Builder.setIsFPConstrained (true );
440
440
Builder.setConstrainedFPFunctionAttr ();
441
- CallInst *FCall = Builder.CreateCall (Callee, std::nullopt );
441
+ CallInst *FCall = Builder.CreateCall (Callee, {} );
442
442
443
443
// Check the attributes to verify the strictfp attribute is on the call.
444
444
EXPECT_TRUE (
@@ -697,24 +697,24 @@ TEST_F(IRBuilderTest, FastMathFlags) {
697
697
auto Callee =
698
698
Function::Create (CalleeTy, Function::ExternalLinkage, " " , M.get ());
699
699
700
- FCall = Builder.CreateCall (Callee, std::nullopt );
700
+ FCall = Builder.CreateCall (Callee, {} );
701
701
EXPECT_FALSE (FCall->hasNoNaNs ());
702
702
703
703
Function *V =
704
704
Function::Create (CalleeTy, Function::ExternalLinkage, " " , M.get ());
705
- FCall = Builder.CreateCall (V, std::nullopt );
705
+ FCall = Builder.CreateCall (V, {} );
706
706
EXPECT_FALSE (FCall->hasNoNaNs ());
707
707
708
708
FMF.clear ();
709
709
FMF.setNoNaNs ();
710
710
Builder.setFastMathFlags (FMF);
711
711
712
- FCall = Builder.CreateCall (Callee, std::nullopt );
712
+ FCall = Builder.CreateCall (Callee, {} );
713
713
EXPECT_TRUE (Builder.getFastMathFlags ().any ());
714
714
EXPECT_TRUE (Builder.getFastMathFlags ().NoNaNs );
715
715
EXPECT_TRUE (FCall->hasNoNaNs ());
716
716
717
- FCall = Builder.CreateCall (V, std::nullopt );
717
+ FCall = Builder.CreateCall (V, {} );
718
718
EXPECT_TRUE (Builder.getFastMathFlags ().any ());
719
719
EXPECT_TRUE (Builder.getFastMathFlags ().NoNaNs );
720
720
EXPECT_TRUE (FCall->hasNoNaNs ());
@@ -856,7 +856,7 @@ TEST_F(IRBuilderTest, createFunction) {
856
856
auto File = DIB.createFile (" error.swift" , " /" );
857
857
auto CU =
858
858
DIB.createCompileUnit (dwarf::DW_LANG_Swift, File, " swiftc" , true , " " , 0 );
859
- auto Type = DIB.createSubroutineType (DIB.getOrCreateTypeArray (std::nullopt ));
859
+ auto Type = DIB.createSubroutineType (DIB.getOrCreateTypeArray ({} ));
860
860
auto NoErr = DIB.createFunction (
861
861
CU, " noerr" , " " , File, 1 , Type, 1 , DINode::FlagZero,
862
862
DISubprogram::SPFlagDefinition | DISubprogram::SPFlagOptimized);
@@ -896,8 +896,7 @@ TEST_F(IRBuilderTest, DIBuilder) {
896
896
auto CU = DIB.createCompileUnit (dwarf::DW_LANG_Cobol74,
897
897
DIB.createFile (" F.CBL" , " /" ),
898
898
" llvm-cobol74" , true , " " , 0 );
899
- auto Type =
900
- DIB.createSubroutineType (DIB.getOrCreateTypeArray (std::nullopt));
899
+ auto Type = DIB.createSubroutineType (DIB.getOrCreateTypeArray ({}));
901
900
auto SP = DIB.createFunction (
902
901
CU, " foo" , " " , File, 1 , Type, 1 , DINode::FlagZero,
903
902
DISubprogram::SPFlagDefinition | DISubprogram::SPFlagOptimized);
@@ -1014,7 +1013,7 @@ TEST_F(IRBuilderTest, createArtificialSubprogram) {
1014
1013
auto CU = DIB.createCompileUnit (dwarf::DW_LANG_C, File, " clang" ,
1015
1014
/* isOptimized=*/ true , /* Flags=*/ " " ,
1016
1015
/* Runtime Version=*/ 0 );
1017
- auto Type = DIB.createSubroutineType (DIB.getOrCreateTypeArray (std::nullopt ));
1016
+ auto Type = DIB.createSubroutineType (DIB.getOrCreateTypeArray ({} ));
1018
1017
auto SP = DIB.createFunction (
1019
1018
CU, " foo" , /* LinkageName=*/ " " , File,
1020
1019
/* LineNo=*/ 1 , Type, /* ScopeLine=*/ 2 , DINode::FlagZero,
@@ -1168,8 +1167,7 @@ TEST_F(IRBuilderTest, DebugLoc) {
1168
1167
auto CU = DIB.createCompileUnit (dwarf::DW_LANG_C_plus_plus_11,
1169
1168
DIB.createFile (" tmp.cpp" , " /" ), " " , true , " " ,
1170
1169
0 );
1171
- auto SPType =
1172
- DIB.createSubroutineType (DIB.getOrCreateTypeArray (std::nullopt));
1170
+ auto SPType = DIB.createSubroutineType (DIB.getOrCreateTypeArray ({}));
1173
1171
auto SP =
1174
1172
DIB.createFunction (CU, " foo" , " foo" , File, 1 , SPType, 1 , DINode::FlagZero,
1175
1173
DISubprogram::SPFlagDefinition);
@@ -1183,13 +1181,13 @@ TEST_F(IRBuilderTest, DebugLoc) {
1183
1181
IRBuilder<> Builder (Ctx);
1184
1182
Builder.SetInsertPoint (Br);
1185
1183
EXPECT_EQ (DL1, Builder.getCurrentDebugLocation ());
1186
- auto Call1 = Builder.CreateCall (Callee, std::nullopt );
1184
+ auto Call1 = Builder.CreateCall (Callee, {} );
1187
1185
EXPECT_EQ (DL1, Call1->getDebugLoc ());
1188
1186
1189
1187
Call1->setDebugLoc (DL2);
1190
1188
Builder.SetInsertPoint (Call1->getParent (), Call1->getIterator ());
1191
1189
EXPECT_EQ (DL2, Builder.getCurrentDebugLocation ());
1192
- auto Call2 = Builder.CreateCall (Callee, std::nullopt );
1190
+ auto Call2 = Builder.CreateCall (Callee, {} );
1193
1191
EXPECT_EQ (DL2, Call2->getDebugLoc ());
1194
1192
1195
1193
DIB.finalize ();
@@ -1202,7 +1200,7 @@ TEST_F(IRBuilderTest, DIImportedEntity) {
1202
1200
auto CU = DIB.createCompileUnit (dwarf::DW_LANG_Cobol74,
1203
1201
F, " llvm-cobol74" ,
1204
1202
true , " " , 0 );
1205
- MDTuple *Elements = MDTuple::getDistinct (Ctx, std::nullopt );
1203
+ MDTuple *Elements = MDTuple::getDistinct (Ctx, {} );
1206
1204
1207
1205
DIB.createImportedDeclaration (CU, nullptr , F, 1 );
1208
1206
DIB.createImportedDeclaration (CU, nullptr , F, 1 );
0 commit comments