This function is full of special casing so some readability improvements
help its digestibility:
- Fix an incorrect assert message (after 22a52dfddc)
- Hoist early exit for decl-only function to before analysis over subprogram metadata by DIFinder
- Give an unweildy repeated expression a name
- use ranged for basic block iterator
- clang-format
Capitalize message for consistency.