@@ -146,10 +146,10 @@ void IntrinsicEmitter::EmitEnumInfo(const CodeGenIntrinsicTable &Ints,
146146 OS << " #ifdef GET_INTRINSIC_ENUM_VALUES\n " ;
147147 } else {
148148 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);
151151 OS << " namespace llvm::Intrinsic {\n " ;
152- OS << formatv (" enum {0 }Intrinsics : unsigned {{\n " , UpperPrefix);
152+ OS << formatv (" enum {}Intrinsics : unsigned {{\n " , UpperPrefix);
153153 }
154154
155155 OS << " // Enum values for intrinsics.\n " ;
@@ -167,12 +167,12 @@ void IntrinsicEmitter::EmitEnumInfo(const CodeGenIntrinsicTable &Ints,
167167 OS << " , " ;
168168 if (Int.EnumName .size () < 40 )
169169 OS.indent (40 - Int.EnumName .size ());
170- OS << formatv (" // {0 }\n " , Int.Name );
170+ OS << formatv (" // {}\n " , Int.Name );
171171 }
172172
173173 // Emit num_intrinsics into the target neutral enum.
174174 if (IntrinsicPrefix.empty ()) {
175- OS << formatv (" num_intrinsics = {0 }\n " , Ints.size () + 1 );
175+ OS << formatv (" num_intrinsics = {}\n " , Ints.size () + 1 );
176176 OS << " #endif\n\n " ;
177177 } else {
178178 OS << R"( }; // enum
@@ -230,7 +230,7 @@ struct IntrinsicTargetInfo {
230230static constexpr IntrinsicTargetInfo TargetInfos[] = {
231231)" ;
232232 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);
234234 OS << R"( };
235235#endif
236236
@@ -342,7 +342,7 @@ void IntrinsicEmitter::EmitGenerator(const CodeGenIntrinsicTable &Ints,
342342
343343 OS << formatv (R"( // Global intrinsic function declaration type table.
344344#ifdef GET_INTRINSIC_GENERATOR_GLOBAL
345- static constexpr {0 } IIT_Table[] = {{
345+ static constexpr {} IIT_Table[] = {{
346346 )" ,
347347 FixedEncodingTypeName);
348348
@@ -363,7 +363,7 @@ static constexpr {0} IIT_Table[] = {{
363363
364364 // Otherwise, emit the offset into the long encoding table. We emit it this
365365 // 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);
367367 }
368368
369369 OS << " 0\n };\n\n " ;
@@ -494,18 +494,18 @@ static AttributeSet getIntrinsicArgAttributeSet(LLVMContext &C, unsigned ID) {
494494 assert (is_sorted (Attrs) && " Argument attributes are not sorted" );
495495
496496 OS << formatv (R"(
497- case {0 }:
497+ case {}:
498498 return AttributeSet::get(C, {{
499499)" ,
500500 ID);
501501 for (const CodeGenIntrinsic::ArgAttribute &Attr : Attrs) {
502502 StringRef AttrName = getArgAttrEnumName (Attr.Kind );
503503 if (Attr.Kind == CodeGenIntrinsic::Alignment ||
504504 Attr.Kind == CodeGenIntrinsic::Dereferenceable)
505- OS << formatv (" Attribute::get(C, Attribute::{0 }, {1 }),\n " ,
505+ OS << formatv (" Attribute::get(C, Attribute::{}, {}),\n " ,
506506 AttrName, Attr.Value );
507507 else
508- OS << formatv (" Attribute::get(C, Attribute::{0 }),\n " , AttrName);
508+ OS << formatv (" Attribute::get(C, Attribute::{}),\n " , AttrName);
509509 }
510510 OS << " });" ;
511511 }
@@ -530,12 +530,12 @@ static AttributeSet getIntrinsicFnAttributeSet(LLVMContext &C, unsigned ID) {
530530 if (!UniqFnAttributes.try_emplace (&Int, ID).second )
531531 continue ;
532532 OS << formatv (R"(
533- case {0 }:
533+ case {}:
534534 return AttributeSet::get(C, {{
535535)" ,
536536 ID);
537537 auto addAttribute = [&OS](StringRef Attr) {
538- OS << formatv (" Attribute::get(C, Attribute::{0 }),\n " , Attr);
538+ OS << formatv (" Attribute::get(C, Attribute::{}),\n " , Attr);
539539 };
540540 if (!Int.canThrow )
541541 addAttribute (" NoUnwind" );
@@ -564,9 +564,9 @@ static AttributeSet getIntrinsicFnAttributeSet(LLVMContext &C, unsigned ID) {
564564
565565 const MemoryEffects ME = getEffectiveME (Int);
566566 if (ME != MemoryEffects::unknown ()) {
567- OS << formatv (" // {0 }\n " , ME);
567+ OS << formatv (" // {}\n " , ME);
568568 OS << formatv (" Attribute::getWithMemoryEffects(C, "
569- " MemoryEffects::createFromIntValue({0 })),\n " ,
569+ " MemoryEffects::createFromIntValue({})),\n " ,
570570 ME.toIntValue ());
571571 }
572572 OS << " });" ;
@@ -598,11 +598,11 @@ AttributeList Intrinsic::getAttributes(LLVMContext &C, ID id) {
598598 // entry, for the function itself (index ~1), which is usually nounwind.
599599 OS << " static constexpr uint16_t IntrinsicsToAttributesMap[] = {" ;
600600 for (const CodeGenIntrinsic &Int : Ints)
601- OS << formatv (" \n {0 }, // {1 }" , UniqAttributes[&Int], Int.Name );
601+ OS << formatv (" \n {}, // {}" , UniqAttributes[&Int], Int.Name );
602602
603603 OS << formatv (R"(
604604 };
605- std::pair<unsigned, AttributeSet> AS[{0 }];
605+ std::pair<unsigned, AttributeSet> AS[{}];
606606 unsigned NumAttrs = 0;
607607 if (id != 0) {{
608608 switch(IntrinsicsToAttributesMap[id - 1]) {{
@@ -611,7 +611,7 @@ AttributeList Intrinsic::getAttributes(LLVMContext &C, ID id) {
611611 MaxArgAttrs + 1 );
612612
613613 for (const auto [IntPtr, UniqueID] : UniqAttributes) {
614- OS << formatv (" case {0 }:\n " , UniqueID);
614+ OS << formatv (" case {}:\n " , UniqueID);
615615 const CodeGenIntrinsic &Int = *IntPtr;
616616
617617 // Keep track of the number of attributes we're writing out.
@@ -623,19 +623,19 @@ AttributeList Intrinsic::getAttributes(LLVMContext &C, ID id) {
623623
624624 unsigned ArgAttrID = UniqArgAttributes.find (Attrs)->second ;
625625 OS << formatv (
626- " AS[{0 }] = {{{1 }, getIntrinsicArgAttributeSet(C, {2 })};\n " ,
626+ " AS[{}] = {{{}, getIntrinsicArgAttributeSet(C, {})};\n " ,
627627 NumAttrs++, AttrIdx, ArgAttrID);
628628 }
629629
630630 if (hasFnAttributes (Int)) {
631631 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 " ,
634634 NumAttrs++, FnAttrID);
635635 }
636636
637637 if (NumAttrs) {
638- OS << formatv (R"( NumAttrs = {0 };
638+ OS << formatv (R"( NumAttrs = {};
639639 break;
640640)" ,
641641 NumAttrs);
@@ -709,9 +709,9 @@ void IntrinsicEmitter::EmitIntrinsicToBuiltinMap(
709709// Get the LLVM intrinsic that corresponds to a builtin. This is used by the
710710// C front-end. The builtin name is passed in as BuiltinName, and a target
711711// prefix (e.g. 'ppc') is passed in as TargetPrefix.
712- #ifdef GET_LLVM_INTRINSIC_FOR_{0 }_BUILTIN
712+ #ifdef GET_LLVM_INTRINSIC_FOR_{}_BUILTIN
713713Intrinsic::ID
714- Intrinsic::getIntrinsicFor{1 }Builtin(StringRef TargetPrefix,
714+ Intrinsic::getIntrinsicFor{}Builtin(StringRef TargetPrefix,
715715 StringRef BuiltinName) {{
716716 using namespace Intrinsic;
717717)" ,
@@ -721,7 +721,7 @@ Intrinsic::getIntrinsicFor{1}Builtin(StringRef TargetPrefix,
721721 OS << formatv (R"(
722722 return not_intrinsic;
723723 }
724- #endif // GET_LLVM_INTRINSIC_FOR_{0 }_BUILTIN
724+ #endif // GET_LLVM_INTRINSIC_FOR_{}_BUILTIN
725725)" ,
726726 UpperCompilerName);
727727 return ;
@@ -757,14 +757,14 @@ Intrinsic::getIntrinsicFor{1}Builtin(StringRef TargetPrefix,
757757 }
758758
759759 // 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 " ,
761761 TargetPrefix);
762762 for (const auto &[BuiltinName, EnumName] : Map) {
763763 StringRef Suffix = BuiltinName.substr (CommonPrefix->size ());
764- OS << formatv (" {{{0 }, {1 }}, // {2 }\n " , EnumName,
764+ OS << formatv (" {{{}, {}}, // {}\n " , EnumName,
765765 *Table.GetStringOffset (Suffix), BuiltinName);
766766 }
767- OS << formatv (" }; // {0 }Names\n\n " , TargetPrefix);
767+ OS << formatv (" }; // {}Names\n\n " , TargetPrefix);
768768 }
769769
770770 // After emitting the builtin tables for all targets, emit a lookup table for
@@ -800,7 +800,7 @@ Intrinsic::getIntrinsicFor{1}Builtin(StringRef TargetPrefix,
800800 // Copy the builtin name so we can use it in consume_front without clobbering
801801 // if for the lookup in the target specific table.
802802 StringRef Suffix = BuiltinName;
803- if (Suffix.consume_front("{0 }")) {{
803+ if (Suffix.consume_front("{}")) {{
804804 auto II = lower_bound(Names, Suffix);
805805 if (II != std::end(Names) && II->getName() == Suffix)
806806 return II->IntrinsicID;
@@ -823,7 +823,7 @@ Intrinsic::getIntrinsicFor{1}Builtin(StringRef TargetPrefix,
823823 return not_intrinsic;
824824 return II->IntrinsicID;
825825}
826- #endif // GET_LLVM_INTRINSIC_FOR_{0 }_BUILTIN
826+ #endif // GET_LLVM_INTRINSIC_FOR_{}_BUILTIN
827827
828828)" ,
829829 UpperCompilerName);
0 commit comments