Merge branch 'master' into parser-experiments

This commit is contained in:
gingerBill
2020-12-06 00:49:48 +00:00
committed by GitHub
86 changed files with 14317 additions and 5037 deletions

View File

@@ -104,6 +104,37 @@ enum BuildModeKind {
BuildMode_Assembly,
};
enum CommandKind : u32 {
Command_run = 1<<0,
Command_build = 1<<1,
Command_check = 1<<3,
Command_query = 1<<4,
Command_doc = 1<<5,
Command_version = 1<<6,
Command_test = 1<<7,
Command__does_check = Command_run|Command_build|Command_check|Command_query|Command_doc|Command_test,
Command__does_build = Command_run|Command_build|Command_test,
Command_all = ~(u32)0,
};
char const *odin_command_strings[32] = {
"run",
"build",
"check",
"query",
"doc",
"version",
};
enum CmdDocFlag : u32 {
CmdDocFlag_Short = 1<<0,
CmdDocFlag_AllPackages = 1<<1,
};
// This stores the information for the specify architecture of this build
struct BuildContext {
@@ -124,6 +155,7 @@ struct BuildContext {
i64 word_size; // Size of a pointer, must be >= 4
i64 max_align; // max alignment, must be >= 1 (and typically >= word_size)
CommandKind command_kind;
String command;
TargetMetrics metrics;
@@ -143,6 +175,8 @@ struct BuildContext {
bool generate_docs;
i32 optimization_level;
bool show_timings;
bool show_unused;
bool show_unused_with_location;
bool show_more_timings;
bool show_system_calls;
bool keep_temp_files;
@@ -151,6 +185,7 @@ struct BuildContext {
bool no_dynamic_literals;
bool no_output_files;
bool no_crt;
bool no_entry_point;
bool use_lld;
bool vet;
bool cross_compiling;
@@ -165,6 +200,9 @@ struct BuildContext {
bool ignore_microsoft_magic;
bool linker_map_file;
u32 cmd_doc_flags;
Array<String> extra_packages;
QueryDataSetSettings query_data_set_settings;
gbAffinity affinity;
@@ -297,6 +335,19 @@ bool is_excluded_target_filename(String name) {
String original_name = name;
name = remove_extension_from_path(name);
if (string_starts_with(name, str_lit("."))) {
// Ignore .*.odin files
return true;
}
String test_suffix = str_lit("_test");
if (build_context.command_kind != Command_test) {
if (string_ends_with(name, test_suffix) && name != test_suffix) {
// Ignore *_test.odin files
return true;
}
}
String str1 = {};
String str2 = {};
isize n = 0;