[driver] Added support for determining a better output for a merge module Command.
[driver] Added support for determining a better output for a merge module Command.

First, prefer -module-output-path over any other options when binding the output
for a merge module Command. If that’s not set, use the same behavior as other
intermediate outputs, but use the module name as the base name (instead of the
BaseInput, which is not descriptive enough for a swiftmodule).

This does not yet handle the case where the emitted module should be treated as
a top-level output, even though it’s not the top-level job (essentially,
whenever -emit-module is passed but the driver isn't in EmitModuleOnly mode).

Swift SVN r12500

OscarSwanros/swift,stephentyrone/swift,roambotics/swift,ben-ng/swift,austinzheng/swift,stephentyrone/swift,harlanhaskins/swift,huonw/swift,swiftix/swift,ahoppen/swift,atrick/swift,MukeshKumarS/Swift,emilstahl/swift,Jnosh/swift,apple/swift,hooman/swift,milseman/swift,kentya6/swift,ahoppen/swift,djwbrown/swift,practicalswift/swift,jtbandes/swift,practicalswift/swift,therealbnut/swift,JGiola/swift,stephentyrone/swift,Ivacker/swift,xedin/swift,amraboelela/swift,kstaring/swift,calebd/swift,benlangmuir/swift,djwbrown/swift,calebd/swift,frootloops/swift,xwu/swift,jopamer/swift,parkera/swift,atrick/swift,roambotics/swift,tjw/swift,dduan/swift,therealbnut/swift,kusl/swift,gmilos/swift,dduan/swift,gribozavr/swift,shajrawi/swift,xedin/swift,emilstahl/swift,deyton/swift,Jnosh/swift,cbrentharris/swift,jtbandes/swift,kstaring/swift,practicalswift/swift,sschiau/swift,gribozavr/swift,arvedviehweger/swift,huonw/swift,sschiau/swift,tkremenek/swift,return/swift,frootloops/swift,harlanhaskins/swift,tjw/swift,zisko/swift,frootloops/swift,swiftix/swift,Jnosh/swift,OscarSwanros/swift,adrfer/swift,swiftix/swift,emilstahl/swift,CodaFi/swift,xedin/swift,allevato/swift,gribozavr/swift,karwa/swift,KrishMunot/swift,rudkx/swift,sdulal/swift,codestergit/swift,nathawes/swift,harlanhaskins/swift,shajrawi/swift,tjw/swift,zisko/swift,emilstahl/swift,danielmartin/swift,kentya6/swift,mightydeveloper/swift,karwa/swift,aschwaighofer/swift,johnno1962d/swift,SwiftAndroid/swift,JaSpa/swift,airspeedswift/swift,xwu/swift,dduan/swift,airspeedswift/swift,aschwaighofer/swift,hughbe/swift,amraboelela/swift,sdulal/swift,natecook1000/swift,shajrawi/swift,codestergit/swift,uasys/swift,adrfer/swift,ahoppen/swift,calebd/swift,khizkhiz/swift,swiftix/swift.old,ahoppen/swift,huonw/swift,hooman/swift,kperryua/swift,tinysun212/swift-windows,nathawes/swift,jckarter/swift,manavgabhawala/swift,uasys/swift,jmgc/swift,mightydeveloper/swift,CodaFi/swift,jmgc/swift,devincoughlin/swift,mightydeveloper/swift,deyton/swift,arvedviehweger/swift,codestergit/swift,apple/swift,benlangmuir/swift,deyton/swift,gribozavr/swift,danielmartin/swift,devincoughlin/swift,austinzheng/swift,sschiau/swift,mightydeveloper/swift,khizkhiz/swift,natecook1000/swift,kusl/swift,jopamer/swift,tkremenek/swift,tinysun212/swift-windows,uasys/swift,adrfer/swift,tjw/swift,LeoShimonaka/swift,swiftix/swift.old,swiftix/swift.old,cbrentharris/swift,djwbrown/swift,roambotics/swift,tinysun212/swift-windows,felix91gr/swift,harlanhaskins/swift,adrfer/swift,SwiftAndroid/swift,kentya6/swift,JaSpa/swift,hughbe/swift,OscarSwanros/swift,amraboelela/swift,JGiola/swift,deyton/swift,modocache/swift,sdulal/swift,tardieu/swift,hughbe/swift,CodaFi/swift,xedin/swift,atrick/swift,lorentey/swift,stephentyrone/swift,swiftix/swift.old,uasys/swift,glessard/swift,danielmartin/swift,return/swift,gregomni/swift,lorentey/swift,slavapestov/swift,xwu/swift,CodaFi/swift,bitjammer/swift,sdulal/swift,therealbnut/swift,tjw/swift,IngmarStein/swift,amraboelela/swift,adrfer/swift,cbrentharris/swift,arvedviehweger/swift,therealbnut/swift,johnno1962d/swift,codestergit/swift,KrishMunot/swift,sschiau/swift,roambotics/swift,gregomni/swift,jckarter/swift,xedin/swift,khizkhiz/swift,stephentyrone/swift,swiftix/swift.old,allevato/swift,austinzheng/swift,dduan/swift,jmgc/swift,kusl/swift,modocache/swift,rudkx/swift,huonw/swift,calebd/swift,uasys/swift,kperryua/swift,gmilos/swift,Jnosh/swift,danielmartin/swift,austinzheng/swift,sdulal/swift,kusl/swift,JGiola/swift,djwbrown/swift,benlangmuir/swift,return/swift,gottesmm/swift,manavgabhawala/swift,alblue/swift,calebd/swift,shahmishal/swift,slavapestov/swift,bitjammer/swift,kentya6/swift,emilstahl/swift,felix91gr/swift,xwu/swift,jtbandes/swift,shajrawi/swift,djwbrown/swift,sdulal/swift,arvedviehweger/swift,nathawes/swift,devincoughlin/swift,stephentyrone/swift,KrishMunot/swift,return/swift,harlanhaskins/swift,milseman/swift,benlangmuir/swift,apple/swift,deyton/swift,hooman/swift,lorentey/swift,russbishop/swift,shahmishal/swift,lorentey/swift,kstaring/swift,kentya6/swift,arvedviehweger/swift,apple/swift,hughbe/swift,IngmarStein/swift,allevato/swift,hooman/swift,brentdax/swift,kusl/swift,tkremenek/swift,jckarter/swift,kentya6/swift,jmgc/swift,gmilos/swift,bitjammer/swift,jckarter/swift,harlanhaskins/swift,huonw/swift,zisko/swift,jmgc/swift,cbrentharris/swift,tardieu/swift,mightydeveloper/swift,apple/swift,parkera/swift,milseman/swift,benlangmuir/swift,airspeedswift/swift,felix91gr/swift,nathawes/swift,shajrawi/swift,SwiftAndroid/swift,CodaFi/swift,alblue/swift,LeoShimonaka/swift,hughbe/swift,cbrentharris/swift,kperryua/swift,jopamer/swift,harlanhaskins/swift,airspeedswift/swift,sschiau/swift,felix91gr/swift,jopamer/swift,khizkhiz/swift,kstaring/swift,bitjammer/swift,natecook1000/swift,gregomni/swift,ben-ng/swift,frootloops/swift,OscarSwanros/swift,emilstahl/swift,allevato/swift,gribozavr/swift,practicalswift/swift,slavapestov/swift,atrick/swift,austinzheng/swift,swiftix/swift.old,CodaFi/swift,Ivacker/swift,frootloops/swift,MukeshKumarS/Swift,aschwaighofer/swift,kperryua/swift,huonw/swift,felix91gr/swift,bitjammer/swift,IngmarStein/swift,frootloops/swift,ben-ng/swift,shahmishal/swift,ken0nek/swift,natecook1000/swift,tinysun212/swift-windows,gribozavr/swift,tkremenek/swift,hughbe/swift,manavgabhawala/swift,swiftix/swift.old,ben-ng/swift,glessard/swift,slavapestov/swift,johnno1962d/swift,rudkx/swift,karwa/swift,johnno1962d/swift,shahmishal/swift,dduan/swift,shahmishal/swift,tkremenek/swift,gmilos/swift,gribozavr/swift,kperryua/swift,manavgabhawala/swift,zisko/swift,gregomni/swift,jtbandes/swift,return/swift,gottesmm/swift,modocache/swift,sschiau/swift,LeoShimonaka/swift,shajrawi/swift,manavgabhawala/swift,adrfer/swift,russbishop/swift,karwa/swift,kusl/swift,calebd/swift,ken0nek/swift,kstaring/swift,gmilos/swift,jckarter/swift,johnno1962d/swift,devincoughlin/swift,LeoShimonaka/swift,swiftix/swift,deyton/swift,nathawes/swift,JaSpa/swift,allevato/swift,gregomni/swift,MukeshKumarS/Swift,xedin/swift,Ivacker/swift,lorentey/swift,slavapestov/swift,gottesmm/swift,alblue/swift,brentdax/swift,dduan/swift,jopamer/swift,aschwaighofer/swift,kentya6/swift,tardieu/swift,ben-ng/swift,danielmartin/swift,therealbnut/swift,mightydeveloper/swift,gmilos/swift,shahmishal/swift,glessard/swift,JaSpa/swift,lorentey/swift,return/swift,zisko/swift,KrishMunot/swift,rudkx/swift,djwbrown/swift,mightydeveloper/swift,parkera/swift,MukeshKumarS/Swift,danielmartin/swift,practicalswift/swift,therealbnut/swift,kusl/swift,johnno1962d/swift,allevato/swift,kperryua/swift,gribozavr/swift,Jnosh/swift,mightydeveloper/swift,russbishop/swift,tinysun212/swift-windows,kstaring/swift,russbishop/swift,kperryua/swift,karwa/swift,LeoShimonaka/swift,khizkhiz/swift,rudkx/swift,LeoShimonaka/swift,swiftix/swift,tkremenek/swift,slavapestov/swift,swiftix/swift.old,gregomni/swift,djwbrown/swift,ben-ng/swift,gottesmm/swift,alblue/swift,amraboelela/swift,gmilos/swift,brentdax/swift,kusl/swift,modocache/swift,atrick/swift,devincoughlin/swift,karwa/swift,jckarter/swift,jckarter/swift,MukeshKumarS/Swift,SwiftAndroid/swift,karwa/swift,ben-ng/swift,ken0nek/swift,dreamsxin/swift,aschwaighofer/swift,xwu/swift,OscarSwanros/swift,LeoShimonaka/swift,KrishMunot/swift,Ivacker/swift,JaSpa/swift,russbishop/swift,brentdax/swift,atrick/swift,cbrentharris/swift,tjw/swift,xedin/swift,OscarSwanros/swift,zisko/swift,jmgc/swift,brentdax/swift,austinzheng/swift,Ivacker/swift,devincoughlin/swift,natecook1000/swift,zisko/swift,modocache/swift,xwu/swift,airspeedswift/swift,milseman/swift,allevato/swift,practicalswift/swift,natecook1000/swift,JGiola/swift,nathawes/swift,shahmishal/swift,tinysun212/swift-windows,dduan/swift,rudkx/swift,johnno1962d/swift,tardieu/swift,emilstahl/swift,alblue/swift,dreamsxin/swift,SwiftAndroid/swift,glessard/swift,tardieu/swift,glessard/swift,codestergit/swift,ken0nek/swift,arvedviehweger/swift,Jnosh/swift,sdulal/swift,uasys/swift,roambotics/swift,MukeshKumarS/Swift,lorentey/swift,benlangmuir/swift,adrfer/swift,cbrentharris/swift,devincoughlin/swift,khizkhiz/swift,apple/swift,lorentey/swift,airspeedswift/swift,uasys/swift,sschiau/swift,natecook1000/swift,hughbe/swift,OscarSwanros/swift,shajrawi/swift,tkremenek/swift,russbishop/swift,amraboelela/swift,practicalswift/swift,slavapestov/swift,brentdax/swift,parkera/swift,tardieu/swift,hooman/swift,devincoughlin/swift,IngmarStein/swift,gottesmm/swift,amraboelela/swift,modocache/swift,JaSpa/swift,jopamer/swift,bitjammer/swift,frootloops/swift,aschwaighofer/swift,Jnosh/swift,calebd/swift,nathawes/swift,IngmarStein/swift,xwu/swift,CodaFi/swift,huonw/swift,felix91gr/swift,ahoppen/swift,SwiftAndroid/swift,JGiola/swift,KrishMunot/swift,parkera/swift,emilstahl/swift,alblue/swift,arvedviehweger/swift,manavgabhawala/swift,bitjammer/swift,milseman/swift,ahoppen/swift,ken0nek/swift,cbrentharris/swift,jopamer/swift,austinzheng/swift,IngmarStein/swift,sdulal/swift,JGiola/swift,KrishMunot/swift,gottesmm/swift,manavgabhawala/swift,codestergit/swift,kentya6/swift,gottesmm/swift,modocache/swift,milseman/swift,kstaring/swift,airspeedswift/swift,aschwaighofer/swift,brentdax/swift,swiftix/swift,jtbandes/swift,karwa/swift,sschiau/swift,therealbnut/swift,hooman/swift,SwiftAndroid/swift,jtbandes/swift,jmgc/swift,xedin/swift,russbishop/swift,ken0nek/swift,parkera/swift,shajrawi/swift,Ivacker/swift,jtbandes/swift,hooman/swift,khizkhiz/swift,codestergit/swift,ken0nek/swift,deyton/swift,MukeshKumarS/Swift,tinysun212/swift-windows,glessard/swift,alblue/swift,return/swift,Ivacker/swift,LeoShimonaka/swift,swiftix/swift,roambotics/swift,JaSpa/swift,IngmarStein/swift,stephentyrone/swift,tardieu/swift,tjw/swift,danielmartin/swift,practicalswift/swift,parkera/swift,felix91gr/swift,Ivacker/swift,shahmishal/swift,parkera/swift,milseman/swift