[Polly] Decompose object construction and detection algorithm. NFC.

Avoid doing the detection work inside the constructor. In addition to
polymorphism being unintuitive in constructors and other design problems
such as if an exception is thrown, the ScopDetection class is usable
without detection in the sense of "no Scop found" or "function skipped".

GitOrigin-RevId: 0232c1d10dd79f5c8f9530d636655488eb3c9e7e
2 files changed