muon/include/lang/analyze.h
Stone Tickle 802d17bd06
add -Wno-redirect-script-error to analyzer
This helps when debugging script modules
2024-01-02 12:05:42 -05:00

33 lines
901 B
C

/*
* SPDX-FileCopyrightText: Stone Tickle <lattis@mochiro.moe>
* SPDX-License-Identifier: GPL-3.0-only
*/
#ifndef MUON_LANG_ANALYZE_H
#define MUON_LANG_ANALYZE_H
#include "error.h"
#include "workspace.h"
enum analyze_diagnostic {
analyze_diagnostic_unused_variable = 1 << 0,
analyze_diagnostic_reassign_to_conflicting_type = 1 << 1,
analyze_diagnostic_dead_code = 1 << 2,
analyze_diagnostic_redirect_script_error = 1 << 3,
};
struct analyze_opts {
bool subdir_error;
bool eval_trace;
enum error_diagnostic_store_replay_opts replay_opts;
const char *file_override, *internal_file, *get_definition_for;
uint64_t enabled_diagnostics;
};
bool analyze_diagnostic_name_to_enum(const char *name, enum analyze_diagnostic *ret);
void analyze_print_diagnostic_names(void);
void analyze_check_dead_code(struct workspace *wk, struct ast *ast);
bool do_analyze(struct analyze_opts *opts);
#endif