return const ref instead of ptr from analyze, since we don't need to be able to return nullptr.