renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
// Compare a new (the passed in) 'range' against the existing set, and see
// if there are any collisions.
//
// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
//
Compare a new (the passed in) 'range' against the existing set, and see
if there are any collisions.

Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
Compare a new ( the passed in ) ' range ' against the existing set and see if there are any collisions . Returns < 0 if no collision > = 0 if collision and the value returned is a colliding value .
int TIntermediate::checkLocationRange(int set, const TIoRange& range, const TType& type, bool& typeCollision)
{
    for (size_t r = 0; r < usedIo[set].size(); ++r) {
        if (range.overlap(usedIo[set][r])) {
            return std::max(range.location.start, usedIo[set][r].location.start);
        } else if (range.location.overlap(usedIo[set][r].location) && type.getBasicType() != usedIo[set][r].basicType) {
            typeCollision = true;
            return std::max(range.location.start, usedIo[set][r].location.start);
        }
    }
    return -1; 
}
int TIntermediate :: checkLocationRange ( int set , const TIoRange & range , const TType & type , bool & typeCollision ) { for ( size_t r = 0 ; r < usedIo [ set ] . size ( ) ; ++ r ) { if ( range . overlap ( usedIo [ set ] [ r ] ) ) { return std :: max ( range . location . start , usedIo [ set ] [ r ] . location . start ) ; } else if ( range . location . overlap ( usedIo [ set ] [ r ] . location ) && type . getBasicType ( ) != usedIo [ set ] [ r ] . basicType ) { typeCollision = true ; return std :: max ( range . location . start , usedIo [ set ] [ r ] . location . start ) ; } } return -1 ; }
Compare a new (the passed in) 'range' against the existing set, and see
if there are any collisions.
Compare a new ( the passed in ) ' range ' against the existing set and see if there are any collisions .
// there is a collision; pick one // aliased-type mismatch // no collision