Move twice-repeated clang path operation into a new function.