[stdlib] Rework String bridging
[stdlib] Rework String bridging

Going through an @objc protocol for bridging Cocoa strings to Swift
String was working, but it had several disadvantages, including the cost
of invoking objc_msgsend and the need to viciously cast away type-safety
to get past swift's ObjC bridging restrictions.

Instead, Swift's core stdlib now contains a couple of "function
pointers" (variables of Optional<some-Swift-function-type>) that are set
when Foundation is loaded.  We use C++ dynamic initialization to set up
these variables, which is probably not the right long-term answer, but
works for now.

These functions, instead of invoking objc methods on NSString, go
through CFStringXXX functions, which have a fast path that avoids
objc_msgsend in Cocoa's common cases, and since they're not @objc
methods, they can use Swift's full type vocabulary.

It would still be nice to avoid any dynamic dispatch and checking
overheads for going through these optional function variables, but this
ought to be a lot better than where we were, and it keeps Foundation
decoupled from the core standard library.

Along the way, a fair amount of needless code bulk was shed.  Shedding
FTW!

Swift SVN r12327

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