Avoid undefined behavior with std::minmax and rvalues.
Avoid undefined behavior with std::minmax and rvalues.

The behavior of std::minmax with rvalue arguments is undefined after the
end of the expression that contains the call to minmax. This code to
special-case the comparisons for ARM vs. Thumb and macOS vs. Darwin was a
little overly clever anyway. Rewrite it to use straightforward comparisons.
This fixes a test failure in Serialization/target-incompatible.swift when
building with a recent version of clang, because these checks were completely
optimized away due to the undefined behavior. rdar://problem/28700005

danielmartin/swift,modocache/swift,gribozavr/swift,harlanhaskins/swift,glessard/swift,alblue/swift,gribozavr/swift,frootloops/swift,stephentyrone/swift,ben-ng/swift,shahmishal/swift,calebd/swift,harlanhaskins/swift,uasys/swift,xedin/swift,austinzheng/swift,allevato/swift,allevato/swift,practicalswift/swift,airspeedswift/swift,ben-ng/swift,tkremenek/swift,Jnosh/swift,danielmartin/swift,karwa/swift,OscarSwanros/swift,ahoppen/swift,ben-ng/swift,harlanhaskins/swift,CodaFi/swift,CodaFi/swift,shahmishal/swift,kstaring/swift,JGiola/swift,lorentey/swift,xedin/swift,tjw/swift,jopamer/swift,tinysun212/swift-windows,gottesmm/swift,lorentey/swift,nathawes/swift,sschiau/swift,gottesmm/swift,felix91gr/swift,manavgabhawala/swift,tinysun212/swift-windows,jckarter/swift,gribozavr/swift,sschiau/swift,hooman/swift,uasys/swift,xedin/swift,airspeedswift/swift,harlanhaskins/swift,OscarSwanros/swift,calebd/swift,gmilos/swift,zisko/swift,parkera/swift,jckarter/swift,alblue/swift,kstaring/swift,JGiola/swift,CodaFi/swift,sschiau/swift,practicalswift/swift,karwa/swift,stephentyrone/swift,codestergit/swift,hooman/swift,rudkx/swift,gmilos/swift,roambotics/swift,jtbandes/swift,zisko/swift,arvedviehweger/swift,swiftix/swift,calebd/swift,huonw/swift,aschwaighofer/swift,return/swift,codestergit/swift,jopamer/swift,xwu/swift,devincoughlin/swift,ben-ng/swift,JaSpa/swift,amraboelela/swift,harlanhaskins/swift,apple/swift,sschiau/swift,felix91gr/swift,uasys/swift,kstaring/swift,tinysun212/swift-windows,karwa/swift,karwa/swift,tkremenek/swift,bitjammer/swift,kstaring/swift,manavgabhawala/swift,devincoughlin/swift,roambotics/swift,parkera/swift,roambotics/swift,frootloops/swift,gmilos/swift,amraboelela/swift,devincoughlin/swift,practicalswift/swift,uasys/swift,apple/swift,shahmishal/swift,arvedviehweger/swift,jckarter/swift,amraboelela/swift,shajrawi/swift,modocache/swift,gmilos/swift,gottesmm/swift,gribozavr/swift,lorentey/swift,JaSpa/swift,practicalswift/swift,tjw/swift,xwu/swift,uasys/swift,tjw/swift,kperryua/swift,karwa/swift,austinzheng/swift,austinzheng/swift,bitjammer/swift,shahmishal/swift,swiftix/swift,alblue/swift,tinysun212/swift-windows,natecook1000/swift,tardieu/swift,glessard/swift,milseman/swift,devincoughlin/swift,calebd/swift,deyton/swift,gregomni/swift,zisko/swift,atrick/swift,devincoughlin/swift,nathawes/swift,swiftix/swift,lorentey/swift,hooman/swift,tardieu/swift,amraboelela/swift,swiftix/swift,huonw/swift,roambotics/swift,roambotics/swift,gregomni/swift,jopamer/swift,jckarter/swift,nathawes/swift,jmgc/swift,apple/swift,rudkx/swift,parkera/swift,arvedviehweger/swift,codestergit/swift,jtbandes/swift,frootloops/swift,jckarter/swift,JaSpa/swift,xedin/swift,aschwaighofer/swift,allevato/swift,parkera/swift,parkera/swift,xwu/swift,airspeedswift/swift,tkremenek/swift,return/swift,jckarter/swift,nathawes/swift,swiftix/swift,Jnosh/swift,tardieu/swift,devincoughlin/swift,tinysun212/swift-windows,milseman/swift,swiftix/swift,alblue/swift,shahmishal/swift,kperryua/swift,bitjammer/swift,nathawes/swift,huonw/swift,allevato/swift,felix91gr/swift,gregomni/swift,brentdax/swift,ahoppen/swift,alblue/swift,bitjammer/swift,kperryua/swift,hughbe/swift,Jnosh/swift,shajrawi/swift,atrick/swift,gottesmm/swift,jopamer/swift,tjw/swift,brentdax/swift,deyton/swift,uasys/swift,glessard/swift,natecook1000/swift,ahoppen/swift,jopamer/swift,djwbrown/swift,therealbnut/swift,gottesmm/swift,milseman/swift,arvedviehweger/swift,Jnosh/swift,deyton/swift,aschwaighofer/swift,codestergit/swift,frootloops/swift,jtbandes/swift,lorentey/swift,swiftix/swift,danielmartin/swift,allevato/swift,JaSpa/swift,OscarSwanros/swift,jmgc/swift,kstaring/swift,ahoppen/swift,return/swift,kstaring/swift,austinzheng/swift,tkremenek/swift,shajrawi/swift,atrick/swift,gregomni/swift,OscarSwanros/swift,deyton/swift,bitjammer/swift,aschwaighofer/swift,felix91gr/swift,gribozavr/swift,djwbrown/swift,brentdax/swift,karwa/swift,return/swift,arvedviehweger/swift,OscarSwanros/swift,djwbrown/swift,benlangmuir/swift,benlangmuir/swift,parkera/swift,benlangmuir/swift,felix91gr/swift,tjw/swift,modocache/swift,austinzheng/swift,shahmishal/swift,rudkx/swift,danielmartin/swift,calebd/swift,natecook1000/swift,jopamer/swift,shajrawi/swift,brentdax/swift,benlangmuir/swift,hooman/swift,ben-ng/swift,alblue/swift,OscarSwanros/swift,apple/swift,tkremenek/swift,CodaFi/swift,stephentyrone/swift,jmgc/swift,jckarter/swift,milseman/swift,JGiola/swift,gregomni/swift,gmilos/swift,bitjammer/swift,return/swift,gottesmm/swift,milseman/swift,roambotics/swift,aschwaighofer/swift,zisko/swift,xedin/swift,zisko/swift,gribozavr/swift,xwu/swift,aschwaighofer/swift,djwbrown/swift,zisko/swift,manavgabhawala/swift,jmgc/swift,parkera/swift,atrick/swift,glessard/swift,alblue/swift,therealbnut/swift,deyton/swift,stephentyrone/swift,stephentyrone/swift,benlangmuir/swift,devincoughlin/swift,hooman/swift,djwbrown/swift,milseman/swift,hughbe/swift,kstaring/swift,kperryua/swift,jtbandes/swift,glessard/swift,return/swift,apple/swift,manavgabhawala/swift,gregomni/swift,shajrawi/swift,manavgabhawala/swift,airspeedswift/swift,djwbrown/swift,rudkx/swift,hooman/swift,natecook1000/swift,modocache/swift,austinzheng/swift,shajrawi/swift,rudkx/swift,kperryua/swift,harlanhaskins/swift,arvedviehweger/swift,xedin/swift,natecook1000/swift,tardieu/swift,atrick/swift,atrick/swift,gmilos/swift,tkremenek/swift,hughbe/swift,amraboelela/swift,natecook1000/swift,hughbe/swift,xwu/swift,gribozavr/swift,therealbnut/swift,felix91gr/swift,allevato/swift,practicalswift/swift,frootloops/swift,xwu/swift,zisko/swift,felix91gr/swift,sschiau/swift,uasys/swift,jtbandes/swift,gmilos/swift,apple/swift,huonw/swift,austinzheng/swift,tinysun212/swift-windows,jopamer/swift,JaSpa/swift,karwa/swift,huonw/swift,sschiau/swift,huonw/swift,natecook1000/swift,xedin/swift,kperryua/swift,tinysun212/swift-windows,xwu/swift,brentdax/swift,therealbnut/swift,OscarSwanros/swift,JaSpa/swift,deyton/swift,bitjammer/swift,hughbe/swift,Jnosh/swift,modocache/swift,glessard/swift,manavgabhawala/swift,practicalswift/swift,nathawes/swift,arvedviehweger/swift,brentdax/swift,modocache/swift,calebd/swift,milseman/swift,hughbe/swift,tjw/swift,manavgabhawala/swift,parkera/swift,rudkx/swift,devincoughlin/swift,JaSpa/swift,codestergit/swift,practicalswift/swift,amraboelela/swift,frootloops/swift,xedin/swift,danielmartin/swift,tardieu/swift,CodaFi/swift,amraboelela/swift,shajrawi/swift,return/swift,airspeedswift/swift,allevato/swift,gribozavr/swift,jmgc/swift,ahoppen/swift,tardieu/swift,shajrawi/swift,jmgc/swift,codestergit/swift,sschiau/swift,lorentey/swift,benlangmuir/swift,shahmishal/swift,gottesmm/swift,Jnosh/swift,shahmishal/swift,frootloops/swift,harlanhaskins/swift,danielmartin/swift,tkremenek/swift,airspeedswift/swift,modocache/swift,practicalswift/swift,tjw/swift,deyton/swift,huonw/swift,lorentey/swift,JGiola/swift,CodaFi/swift,jtbandes/swift,danielmartin/swift,airspeedswift/swift,therealbnut/swift,codestergit/swift,ahoppen/swift,aschwaighofer/swift,jmgc/swift,therealbnut/swift,hooman/swift,sschiau/swift,kperryua/swift,stephentyrone/swift,calebd/swift,djwbrown/swift,JGiola/swift,therealbnut/swift,stephentyrone/swift,ben-ng/swift,nathawes/swift,brentdax/swift,karwa/swift,jtbandes/swift,CodaFi/swift,ben-ng/swift,JGiola/swift,hughbe/swift,Jnosh/swift,tardieu/swift,lorentey/swift