CodeGen: Clean up CommonLinkage calculation

No functionality change.