[morello][llvm][NFCI] Refactor some platform dependent code

Using the utilities offered by Path.h can make this code more
platform independent. NFCI.
27 jobs for !190 with nfci_refactor_cherisetbounds in 110 minutes and 21 seconds (queued for 4 seconds)
latest merge request