Reduce the amount of memory required for caching protocol conformances.
Reduce the amount of memory required for caching protocol conformances.

The reason for this patch:
- Currently, when we invoke swift_conformsToProtocol for the first time, we load ALL protocol conformances into conformances cache (to avoid rescanning the conformances section next time), which consumes about 50-70KB of memory even per minimal Swift application (e.g. hello-world app). While it may seem not so much, if you think about apps running on watchOS or writing daemons in Swift (and we have about 120 of those running on iOS), it is a lot of memory.
- In reality, only a couple of those conformances are used by applications, which means that most of the loaded conformances are useless and just consume the memory.

The implemented solution:
- Load only the conformances which were queried by calling swift_conformsToProtocol. Don’t try to load any other conformances, when not asked to do so.
- Use std::vector instead of std::deqeue for SectionsToScan. This shaves off another 4KB of memory, because std::deque reserves at least 4KB by default.

This patch does not seem to produce any detectable performance hit on our benchmark suite.

With these changes, the minimal "hello world" application consumes only 9.8KB, whereas before it used to consume 60KB.

rdar://22331482

Swift SVN r31310

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