File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1176,7 +1176,7 @@ bool TranslateBuildSPMD(
1176
1176
if (instCombineSinkingSwitch->getValue ()->getNumOccurrences () == 0 )
1177
1177
{
1178
1178
const char * const args[] = { " igc" , instCombineFlag.data () };
1179
- llvm::cl::ParseCommandLineOptions (sizeof (args) / sizeof (args[ 0 ] ), args);
1179
+ llvm::cl::ParseCommandLineOptions (std::size (args), args);
1180
1180
}
1181
1181
}
1182
1182
}
@@ -1829,9 +1829,7 @@ static constexpr STB_TranslationCode g_cICBETranslationCodes[] =
1829
1829
TRANSLATION_BLOCK_API void Register (STB_RegisterArgs* pRegisterArgs)
1830
1830
{
1831
1831
pRegisterArgs->Version = TC::STB_VERSION;
1832
- pRegisterArgs->NumTranslationCodes =
1833
- sizeof (g_cICBETranslationCodes) /
1834
- sizeof (g_cICBETranslationCodes[0 ]);
1832
+ pRegisterArgs->NumTranslationCodes = std::size (g_cICBETranslationCodes);
1835
1833
1836
1834
if (pRegisterArgs->pTranslationCodes )
1837
1835
{
Original file line number Diff line number Diff line change @@ -1980,7 +1980,7 @@ namespace TC
1980
1980
}
1981
1981
1982
1982
unsigned int i;
1983
- for (i = 0 ; i < sizeof (g_cClangTranslationCodes) / sizeof (g_cClangTranslationCodes[ 0 ] ); i++)
1983
+ for (i = 0 ; i < std::size (g_cClangTranslationCodes); i++)
1984
1984
{
1985
1985
// Some quick checks to ensure that the input and output types
1986
1986
// are compatible with this translation blocks
@@ -1991,7 +1991,7 @@ namespace TC
1991
1991
}
1992
1992
}
1993
1993
1994
- if (i >= sizeof (g_cClangTranslationCodes) / sizeof (g_cClangTranslationCodes[ 0 ] ))
1994
+ if (i >= std::size (g_cClangTranslationCodes))
1995
1995
{
1996
1996
return false ;
1997
1997
}
You can’t perform that action at this time.
0 commit comments