Make build_check_stmt accept an SSA_NAME for its base