@@ -146,10 +146,10 @@ void IntrinsicEmitter::EmitEnumInfo(const CodeGenIntrinsicTable &Ints,
146
146
OS << " #ifdef GET_INTRINSIC_ENUM_VALUES\n " ;
147
147
} else {
148
148
std::string UpperPrefix = StringRef (IntrinsicPrefix).upper ();
149
- OS << formatv (" #ifndef LLVM_IR_INTRINSIC_{0 }_ENUMS_H\n " , UpperPrefix);
150
- OS << formatv (" #define LLVM_IR_INTRINSIC_{0 }_ENUMS_H\n " , UpperPrefix);
149
+ OS << formatv (" #ifndef LLVM_IR_INTRINSIC_{}_ENUMS_H\n " , UpperPrefix);
150
+ OS << formatv (" #define LLVM_IR_INTRINSIC_{}_ENUMS_H\n " , UpperPrefix);
151
151
OS << " namespace llvm::Intrinsic {\n " ;
152
- OS << formatv (" enum {0 }Intrinsics : unsigned {{\n " , UpperPrefix);
152
+ OS << formatv (" enum {}Intrinsics : unsigned {{\n " , UpperPrefix);
153
153
}
154
154
155
155
OS << " // Enum values for intrinsics.\n " ;
@@ -167,12 +167,12 @@ void IntrinsicEmitter::EmitEnumInfo(const CodeGenIntrinsicTable &Ints,
167
167
OS << " , " ;
168
168
if (Int.EnumName .size () < 40 )
169
169
OS.indent (40 - Int.EnumName .size ());
170
- OS << formatv (" // {0 }\n " , Int.Name );
170
+ OS << formatv (" // {}\n " , Int.Name );
171
171
}
172
172
173
173
// Emit num_intrinsics into the target neutral enum.
174
174
if (IntrinsicPrefix.empty ()) {
175
- OS << formatv (" num_intrinsics = {0 }\n " , Ints.size () + 1 );
175
+ OS << formatv (" num_intrinsics = {}\n " , Ints.size () + 1 );
176
176
OS << " #endif\n\n " ;
177
177
} else {
178
178
OS << R"( }; // enum
@@ -230,7 +230,7 @@ struct IntrinsicTargetInfo {
230
230
static constexpr IntrinsicTargetInfo TargetInfos[] = {
231
231
)" ;
232
232
for (const auto [Name, Offset, Count] : Ints.Targets )
233
- OS << formatv (" {{\" {0 }\" , {1 }, {2 }},\n " , Name, Offset, Count);
233
+ OS << formatv (" {{\" {}\" , {}, {}},\n " , Name, Offset, Count);
234
234
OS << R"( };
235
235
#endif
236
236
@@ -342,7 +342,7 @@ void IntrinsicEmitter::EmitGenerator(const CodeGenIntrinsicTable &Ints,
342
342
343
343
OS << formatv (R"( // Global intrinsic function declaration type table.
344
344
#ifdef GET_INTRINSIC_GENERATOR_GLOBAL
345
- static constexpr {0 } IIT_Table[] = {{
345
+ static constexpr {} IIT_Table[] = {{
346
346
)" ,
347
347
FixedEncodingTypeName);
348
348
@@ -363,7 +363,7 @@ static constexpr {0} IIT_Table[] = {{
363
363
364
364
// Otherwise, emit the offset into the long encoding table. We emit it this
365
365
// way so that it is easier to read the offset in the .def file.
366
- OS << formatv (" (1U<<{0 }) | {1 }, " , MSBPostion, Offset);
366
+ OS << formatv (" (1U<<{}) | {}, " , MSBPostion, Offset);
367
367
}
368
368
369
369
OS << " 0\n };\n\n " ;
@@ -494,18 +494,18 @@ static AttributeSet getIntrinsicArgAttributeSet(LLVMContext &C, unsigned ID) {
494
494
assert (is_sorted (Attrs) && " Argument attributes are not sorted" );
495
495
496
496
OS << formatv (R"(
497
- case {0 }:
497
+ case {}:
498
498
return AttributeSet::get(C, {{
499
499
)" ,
500
500
ID);
501
501
for (const CodeGenIntrinsic::ArgAttribute &Attr : Attrs) {
502
502
StringRef AttrName = getArgAttrEnumName (Attr.Kind );
503
503
if (Attr.Kind == CodeGenIntrinsic::Alignment ||
504
504
Attr.Kind == CodeGenIntrinsic::Dereferenceable)
505
- OS << formatv (" Attribute::get(C, Attribute::{0 }, {1 }),\n " ,
505
+ OS << formatv (" Attribute::get(C, Attribute::{}, {}),\n " ,
506
506
AttrName, Attr.Value );
507
507
else
508
- OS << formatv (" Attribute::get(C, Attribute::{0 }),\n " , AttrName);
508
+ OS << formatv (" Attribute::get(C, Attribute::{}),\n " , AttrName);
509
509
}
510
510
OS << " });" ;
511
511
}
@@ -530,12 +530,12 @@ static AttributeSet getIntrinsicFnAttributeSet(LLVMContext &C, unsigned ID) {
530
530
if (!UniqFnAttributes.try_emplace (&Int, ID).second )
531
531
continue ;
532
532
OS << formatv (R"(
533
- case {0 }:
533
+ case {}:
534
534
return AttributeSet::get(C, {{
535
535
)" ,
536
536
ID);
537
537
auto addAttribute = [&OS](StringRef Attr) {
538
- OS << formatv (" Attribute::get(C, Attribute::{0 }),\n " , Attr);
538
+ OS << formatv (" Attribute::get(C, Attribute::{}),\n " , Attr);
539
539
};
540
540
if (!Int.canThrow )
541
541
addAttribute (" NoUnwind" );
@@ -564,9 +564,9 @@ static AttributeSet getIntrinsicFnAttributeSet(LLVMContext &C, unsigned ID) {
564
564
565
565
const MemoryEffects ME = getEffectiveME (Int);
566
566
if (ME != MemoryEffects::unknown ()) {
567
- OS << formatv (" // {0 }\n " , ME);
567
+ OS << formatv (" // {}\n " , ME);
568
568
OS << formatv (" Attribute::getWithMemoryEffects(C, "
569
- " MemoryEffects::createFromIntValue({0 })),\n " ,
569
+ " MemoryEffects::createFromIntValue({})),\n " ,
570
570
ME.toIntValue ());
571
571
}
572
572
OS << " });" ;
@@ -598,11 +598,11 @@ AttributeList Intrinsic::getAttributes(LLVMContext &C, ID id) {
598
598
// entry, for the function itself (index ~1), which is usually nounwind.
599
599
OS << " static constexpr uint16_t IntrinsicsToAttributesMap[] = {" ;
600
600
for (const CodeGenIntrinsic &Int : Ints)
601
- OS << formatv (" \n {0 }, // {1 }" , UniqAttributes[&Int], Int.Name );
601
+ OS << formatv (" \n {}, // {}" , UniqAttributes[&Int], Int.Name );
602
602
603
603
OS << formatv (R"(
604
604
};
605
- std::pair<unsigned, AttributeSet> AS[{0 }];
605
+ std::pair<unsigned, AttributeSet> AS[{}];
606
606
unsigned NumAttrs = 0;
607
607
if (id != 0) {{
608
608
switch(IntrinsicsToAttributesMap[id - 1]) {{
@@ -611,7 +611,7 @@ AttributeList Intrinsic::getAttributes(LLVMContext &C, ID id) {
611
611
MaxArgAttrs + 1 );
612
612
613
613
for (const auto [IntPtr, UniqueID] : UniqAttributes) {
614
- OS << formatv (" case {0 }:\n " , UniqueID);
614
+ OS << formatv (" case {}:\n " , UniqueID);
615
615
const CodeGenIntrinsic &Int = *IntPtr;
616
616
617
617
// Keep track of the number of attributes we're writing out.
@@ -623,19 +623,19 @@ AttributeList Intrinsic::getAttributes(LLVMContext &C, ID id) {
623
623
624
624
unsigned ArgAttrID = UniqArgAttributes.find (Attrs)->second ;
625
625
OS << formatv (
626
- " AS[{0 }] = {{{1 }, getIntrinsicArgAttributeSet(C, {2 })};\n " ,
626
+ " AS[{}] = {{{}, getIntrinsicArgAttributeSet(C, {})};\n " ,
627
627
NumAttrs++, AttrIdx, ArgAttrID);
628
628
}
629
629
630
630
if (hasFnAttributes (Int)) {
631
631
unsigned FnAttrID = UniqFnAttributes.find (&Int)->second ;
632
- OS << formatv (" AS[{0 }] = {{AttributeList::FunctionIndex, "
633
- " getIntrinsicFnAttributeSet(C, {1 })};\n " ,
632
+ OS << formatv (" AS[{}] = {{AttributeList::FunctionIndex, "
633
+ " getIntrinsicFnAttributeSet(C, {})};\n " ,
634
634
NumAttrs++, FnAttrID);
635
635
}
636
636
637
637
if (NumAttrs) {
638
- OS << formatv (R"( NumAttrs = {0 };
638
+ OS << formatv (R"( NumAttrs = {};
639
639
break;
640
640
)" ,
641
641
NumAttrs);
@@ -709,9 +709,9 @@ void IntrinsicEmitter::EmitIntrinsicToBuiltinMap(
709
709
// Get the LLVM intrinsic that corresponds to a builtin. This is used by the
710
710
// C front-end. The builtin name is passed in as BuiltinName, and a target
711
711
// prefix (e.g. 'ppc') is passed in as TargetPrefix.
712
- #ifdef GET_LLVM_INTRINSIC_FOR_{0 }_BUILTIN
712
+ #ifdef GET_LLVM_INTRINSIC_FOR_{}_BUILTIN
713
713
Intrinsic::ID
714
- Intrinsic::getIntrinsicFor{1 }Builtin(StringRef TargetPrefix,
714
+ Intrinsic::getIntrinsicFor{}Builtin(StringRef TargetPrefix,
715
715
StringRef BuiltinName) {{
716
716
using namespace Intrinsic;
717
717
)" ,
@@ -721,7 +721,7 @@ Intrinsic::getIntrinsicFor{1}Builtin(StringRef TargetPrefix,
721
721
OS << formatv (R"(
722
722
return not_intrinsic;
723
723
}
724
- #endif // GET_LLVM_INTRINSIC_FOR_{0 }_BUILTIN
724
+ #endif // GET_LLVM_INTRINSIC_FOR_{}_BUILTIN
725
725
)" ,
726
726
UpperCompilerName);
727
727
return ;
@@ -757,14 +757,14 @@ Intrinsic::getIntrinsicFor{1}Builtin(StringRef TargetPrefix,
757
757
}
758
758
759
759
// Emit the builtin table for this target prefix.
760
- OS << formatv (" static constexpr BuiltinEntry {0 }Names[] = {{\n " ,
760
+ OS << formatv (" static constexpr BuiltinEntry {}Names[] = {{\n " ,
761
761
TargetPrefix);
762
762
for (const auto &[BuiltinName, EnumName] : Map) {
763
763
StringRef Suffix = BuiltinName.substr (CommonPrefix->size ());
764
- OS << formatv (" {{{0 }, {1 }}, // {2 }\n " , EnumName,
764
+ OS << formatv (" {{{}, {}}, // {}\n " , EnumName,
765
765
*Table.GetStringOffset (Suffix), BuiltinName);
766
766
}
767
- OS << formatv (" }; // {0 }Names\n\n " , TargetPrefix);
767
+ OS << formatv (" }; // {}Names\n\n " , TargetPrefix);
768
768
}
769
769
770
770
// After emitting the builtin tables for all targets, emit a lookup table for
@@ -800,7 +800,7 @@ Intrinsic::getIntrinsicFor{1}Builtin(StringRef TargetPrefix,
800
800
// Copy the builtin name so we can use it in consume_front without clobbering
801
801
// if for the lookup in the target specific table.
802
802
StringRef Suffix = BuiltinName;
803
- if (Suffix.consume_front("{0 }")) {{
803
+ if (Suffix.consume_front("{}")) {{
804
804
auto II = lower_bound(Names, Suffix);
805
805
if (II != std::end(Names) && II->getName() == Suffix)
806
806
return II->IntrinsicID;
@@ -823,7 +823,7 @@ Intrinsic::getIntrinsicFor{1}Builtin(StringRef TargetPrefix,
823
823
return not_intrinsic;
824
824
return II->IntrinsicID;
825
825
}
826
- #endif // GET_LLVM_INTRINSIC_FOR_{0 }_BUILTIN
826
+ #endif // GET_LLVM_INTRINSIC_FOR_{}_BUILTIN
827
827
828
828
)" ,
829
829
UpperCompilerName);
0 commit comments