[closure-spec] Refactor closure spec so that we can in a subsequent commit handle both partial_apply and thin_to_thick_function.
[closure-spec] Refactor closure spec so that we can in a subsequent commit handle both partial_apply and thin_to_thick_function.

Since this is just a refactoring, it should be NFC.

This is to fix a dumb bug where we will propagate closures if the
closure captures variables (i.e. partial_apply), but we will not
propagate closures that do not capture any values (i.e.
thin_to_thick_function).

  a.map {
    return $0 + v
  }

But this will not be:

  a.map {
    return $0 + 1
  }

This will also give us the flexibility in the future to support the
propagation of function pointers (at which point we should probably
rename this pass).

Swift SVN r24759

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