diff --git a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp index baec0b2924ba..8933f5439bec 100644 --- a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp +++ b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp @@ -173,8 +173,8 @@ IRSimilarityCandidate::IRSimilarityCandidate(unsigned StartIdx, unsigned Len, assert(LastInstIt != nullptr && "Instruction is nullptr!"); assert(StartIdx + Len > StartIdx && "Overflow for IRSimilarityCandidate range?"); - assert(Len - 1 == - std::distance(iterator(FirstInstIt), iterator(LastInstIt)) && + assert(Len - 1 == static_cast(std::distance( + iterator(FirstInstIt), iterator(LastInstIt))) && "Length of the first and last IRInstructionData do not match the " "given length");