[driver] Refactor output filename generation into a helper function.
[driver] Refactor output filename generation into a helper function.

Use early returns instead of nested ifs. No functionality change.

Swift SVN r13467

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