This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8ce68969b902: [Sema] Add missing entries to the arrays in GetImplicitConversionName and… (authored by craig.topper).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144990/new/ https://reviews.llvm.org/D144990 Files: clang/lib/Sema/SemaOverload.cpp Index: clang/lib/Sema/SemaOverload.cpp =================================================================== --- clang/lib/Sema/SemaOverload.cpp +++ clang/lib/Sema/SemaOverload.cpp @@ -120,7 +120,7 @@ /// corresponding to the given implicit conversion kind. ImplicitConversionRank clang::GetConversionRank(ImplicitConversionKind Kind) { static const ImplicitConversionRank - Rank[(int)ICK_Num_Conversion_Kinds] = { + Rank[] = { ICR_Exact_Match, ICR_Exact_Match, ICR_Exact_Match, @@ -149,16 +149,20 @@ ICR_Exact_Match, // NOTE(gbiv): This may not be completely right -- // it was omitted by the patch that added // ICK_Zero_Event_Conversion + ICR_Exact_Match, // NOTE(ctopper): This may not be completely right -- + // it was omitted by the patch that added + // ICK_Zero_Queue_Conversion ICR_C_Conversion, ICR_C_Conversion_Extension }; + static_assert(std::size(Rank) == (int)ICK_Num_Conversion_Kinds); return Rank[(int)Kind]; } /// GetImplicitConversionName - Return the name of this kind of /// implicit conversion. static const char* GetImplicitConversionName(ImplicitConversionKind Kind) { - static const char* const Name[(int)ICK_Num_Conversion_Kinds] = { + static const char* const Name[] = { "No conversion", "Lvalue-to-rvalue", "Array-to-pointer", @@ -185,9 +189,11 @@ "Transparent Union Conversion", "Writeback conversion", "OpenCL Zero Event Conversion", + "OpenCL Zero Queue Conversion", "C specific type conversion", "Incompatible pointer conversion" }; + static_assert(std::size(Name) == (int)ICK_Num_Conversion_Kinds); return Name[Kind]; }
Index: clang/lib/Sema/SemaOverload.cpp =================================================================== --- clang/lib/Sema/SemaOverload.cpp +++ clang/lib/Sema/SemaOverload.cpp @@ -120,7 +120,7 @@ /// corresponding to the given implicit conversion kind. ImplicitConversionRank clang::GetConversionRank(ImplicitConversionKind Kind) { static const ImplicitConversionRank - Rank[(int)ICK_Num_Conversion_Kinds] = { + Rank[] = { ICR_Exact_Match, ICR_Exact_Match, ICR_Exact_Match, @@ -149,16 +149,20 @@ ICR_Exact_Match, // NOTE(gbiv): This may not be completely right -- // it was omitted by the patch that added // ICK_Zero_Event_Conversion + ICR_Exact_Match, // NOTE(ctopper): This may not be completely right -- + // it was omitted by the patch that added + // ICK_Zero_Queue_Conversion ICR_C_Conversion, ICR_C_Conversion_Extension }; + static_assert(std::size(Rank) == (int)ICK_Num_Conversion_Kinds); return Rank[(int)Kind]; } /// GetImplicitConversionName - Return the name of this kind of /// implicit conversion. static const char* GetImplicitConversionName(ImplicitConversionKind Kind) { - static const char* const Name[(int)ICK_Num_Conversion_Kinds] = { + static const char* const Name[] = { "No conversion", "Lvalue-to-rvalue", "Array-to-pointer", @@ -185,9 +189,11 @@ "Transparent Union Conversion", "Writeback conversion", "OpenCL Zero Event Conversion", + "OpenCL Zero Queue Conversion", "C specific type conversion", "Incompatible pointer conversion" }; + static_assert(std::size(Name) == (int)ICK_Num_Conversion_Kinds); return Name[Kind]; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits